通过Ollama路由Claude Code的成本计算(约90%的降低)
The cost math behind routing Claude Code through Ollama (~90% cut)

原始链接: https://github.com/Coherence-Daddy/use-ollama-to-enhance-claude

## 使用 Ollama 降低 Claude 代码费用 本教程详细介绍了如何通过 Ollama(一个运行开源大型语言模型平台)大幅降低 Claude 代码费用(高达 90%)。该策略利用两者的优势:使用 Anthropic 的 Claude Desktop (Pro) 进行高级思考和规划,同时将资源密集型任务(如代码检查、重构和批量文件操作)卸载到免费的、本地运行或云托管的开源模型(如 Gemma、Qwen 或 DeepSeek)通过 Ollama 实现。 一个 21 页的视觉教程 ([coherencedaddy.com/tutorials/use-ollama-to-enhance-claude](coherencedaddy.com/tutorials/use-ollama-to-enhance-claude)) 和一个便捷的复制粘贴提示可以自动化在 macOS、Windows (WSL2) 和 Linux 上的设置过程。该系统验证两个引擎可以并排工作,确保具有统一用户界面的无缝体验——同时大幅降低您的 AI 成本。该项目是开源的(MIT 许可证),并可在 GitHub 上获取。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 通过 Ollama 路由 Claude 代码的成本计算 (~90% 的节省) (github.com/coherence-daddy) 9 分,CoherenceDaddy 发表于 1 小时前 | 隐藏 | 过去 | 收藏 | 2 条评论 帮助 irishcoffee 发表于 5 分钟前 | 下一个 [–] > 像 lint、重构、文件批量操作和 grep-and-replace 这样的上下文密集型任务可以在几天内耗尽你的月度限制。 Grep-and-replace?你的意思是 sed?人们用 tokens 代替使用 sed?真诚地提问。回复 fxtentacle 发表于 2 分钟前 | 父评论 | 下一个 [–] AI 初学者将 Opus 作为 grep/sed 的替代品。 平庸的程序员用 AI 为他们编写 sed 一行命令,然后吹嘘 AI 生产力提升。 而专家直接使用 sed,然后他们想知道为什么其他人对 AI 如此狂热。回复 考虑申请 YC 2026 年夏季批次!申请截止至 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Pair Claude Desktop on Anthropic with Claude Code routed through Ollama in your terminal. Strategy stays on Pro. Heavy footwork runs on a free open-source model. Cut your Claude Code bill ~90%.

Live Tutorial Made by Coherence Daddy


A 21-slide visual walkthrough that pairs your Anthropic Claude Desktop app with an Ollama-backed Claude Code terminal session — so the strategic work stays on Pro while the heavy lifting runs on a free open-source model (Gemma, Qwen, DeepSeek, your pick).

  • Auto-detects your OS — macOS, Windows + WSL2, Linux
  • Copy-paste prompt — drop one block into Claude and it does ~98% of the setup for you
  • Verifies both engines side-by-side at the end so you know it actually worked
  • Self-contained HTML — no build step, opens in any browser

Claude Pro on the Desktop app is great for thinking, planning, and architecture. Claude Code in the terminal eats quota fast — context-heavy tasks like lints, refactors, file batch ops, and grep-and-replace can burn through your monthly limit in days.

The fix: route Claude Code through Ollama (local or cloud-hosted free model). Two engines, same UX, one bill cut by an order of magnitude.

1) Open the live tutorial (recommended)

The hosted version has the full visual deck, OS-aware steps, and the copy-paste prompt:

coherencedaddy.com/tutorials/use-ollama-to-enhance-claude

2) Or use the copy-paste prompt directly

If you want to skip the visuals and let Claude do it all for you:

  1. Open prompts/copy-paste-prompt.md
  2. Copy the entire file contents
  3. Paste into a fresh Claude Desktop / Claude.ai conversation
  4. Follow along — it auto-detects your OS, installs everything, configures the router, and verifies both engines

3) Or run the presentation locally

git clone https://github.com/Coherence-Daddy/use-ollama-to-enhance-claude.git
cd use-ollama-to-enhance-claude/presentation
open index.html   # macOS
# or just drag index.html into a browser

What you'll have when you're done

Engine Where it runs What it's for
Claude Desktop (Anthropic) Native app Strategy, architecture, code review, tricky bugs
Claude Code → Ollama Your terminal Lints, refactors, repetitive edits, file batch ops

Two side-by-side panes. Same UX. One of them is free.

.
├── README.md                          ← this file
├── LICENSE                            ← MIT
├── prompts/
│   └── copy-paste-prompt.md           ← the canonical setup prompt
└── presentation/
    ├── index.html                     ← 21-slide visual walkthrough
    ├── cd-face-coral.png              ← brand asset
    └── copy-paste-prompt.md           ← (mirror of /prompts version, kept beside the deck)

The presentation is the same exact HTML served at coherencedaddy.com/tutorials/use-ollama-to-enhance-claude. Open it locally, host it yourself, or fork it for your own walkthroughs.

claude-code ollama gemma llm-tools cost-optimization agentic-coding anthropic open-source-llm

MIT — see LICENSE. Use it, fork it, ship a YouTube walkthrough of it. No attribution required, but if you do credit it, link to coherencedaddy.com.


Coherence Daddy is a 508(c)(1)(A) faith-driven technology organization on a mission to help humanity be more coherent. We build private, secure self-help tools — and the occasional tutorial that saves you a few hundred bucks on AI bills.

If this saved you a real chunk of money, the kindest thing you can do is ⭐ this repo and share the tutorial link.

联系我们 contact @ memedata.com