- by x32x01 ||
💰 Stop Wasting Money on AI Tokens
If you're spending $1,000 or more every month on AI APIs, coding agents, and automation tools, a large part of your bill may come from something you don't actually need: sending unnecessary context to AI models.
Two major sources of wasted tokens are oversized agent handoffs and repeated input that could be served from a prompt cache.
Here are five practical ways to reduce AI costs without sacrificing the quality of your results.
For example, when Claude Opus delegates a task to Sonnet, GLM, Kimi, or another model, the receiving agent doesn't necessarily need access to every MCP server, tool, skill, or conversation detail.
In one internal workflow, each delegated job received approximately:
The solution was simple: replace the massive context handoff with a short task brief.
310,000 ⏩ Original context tokens
1,500 ⏩ New context limit
Approximately 99.5% fewer tokens - around 207 times smaller.
This measures context passed into an individual job, not the total API bill or overall system cost.
A good task brief should contain only:
The principle: Give an agent the information it needs to complete the task, not everything the orchestrator knows.
For example, an internal Hermes server sent 21.5 million input tokens over two days with a 0% cache hit rate, costing approximately $100.
Prompt caching can significantly reduce this expense.
Lower input costs
According to Anthropic's pricing documentation, cached input reads are generally charged at 10% of the standard input price. Claude Opus 5.5 and Sonnet 5.5 have a special 5% rate.
For example:
MTok = one million tokens. Prices are based on Anthropic's published rates.
Changing content before a cache breakpoint can prevent reuse of the cached prefix that follows it.
Also remember that cache writes are not free. Anthropic charges more for writing cached prompts than for normal input, so caching is most useful when the same context is reused.
The principle: Keep the reusable context stable and move changing information to the end.
A more efficient multi-agent workflow separates responsibilities:
Expensive model
Plans the task, defines requirements, and reviews the final result.
Cheaper model
Implements the changes using a short, specific task brief.
Automated verification
Runs tests and validation commands before requesting an AI review.
Final review
The expensive model checks the result only after automated verification passes.
A few rules make this workflow more efficient:
This repository provides engineering skills that help AI coding agents work more systematically.
Three particularly useful skills are:
There is no verified universal token-saving percentage for these skills. Their value comes from improving the development workflow and making acceptance criteria easier to verify.
Caveman reduces unnecessary words in AI responses while trying to preserve their meaning.
Its published benchmark uses 10 developer questions:
Caveman reduced output by approximately 41% compared with no instructions in this test.
However, compared with the simple instruction "Answer concisely," the difference was much smaller. The project reports approximately 3% additional reduction at the median.
This is an important distinction: always benchmark your own workload before assuming a tool will deliver the same savings.
Graphify converts a codebase into a searchable knowledge graph.
Instead of repeatedly asking an AI agent to read entire files, you can build a local graph and query specific relationships and code structures.
For example, you can use:
To retrieve relevant information about your codebase without repeatedly scanning every source file.
Its code parsing uses local processing through Tree-sitter, without requiring LLM credits for code-only graph extraction.
The project does not publish a universal token-saving percentage for its open-source version, so actual savings depend on your codebase and workflow.
For example:
Start with these five practices:
Don't pay an expensive model to read information it doesn't need, repeat work that has already been done, or review code that hasn't passed its tests.
If you're spending $1,000 or more every month on AI APIs, coding agents, and automation tools, a large part of your bill may come from something you don't actually need: sending unnecessary context to AI models.
Two major sources of wasted tokens are oversized agent handoffs and repeated input that could be served from a prompt cache.
Here are five practical ways to reduce AI costs without sacrificing the quality of your results.
1. Reduce Context Before Delegating Tasks
One of the biggest mistakes in multi-agent systems is sending the entire orchestrator context to every delegated agent.For example, when Claude Opus delegates a task to Sonnet, GLM, Kimi, or another model, the receiving agent doesn't necessarily need access to every MCP server, tool, skill, or conversation detail.
In one internal workflow, each delegated job received approximately:
- 310,000 tokens of context before processing the actual task.
- 24 MCP servers.
- 171 tools.
- 404 skills.
The solution was simple: replace the massive context handoff with a short task brief.
310,000 ⏩ Original context tokens
1,500 ⏩ New context limit
Approximately 99.5% fewer tokens - around 207 times smaller.
This measures context passed into an individual job, not the total API bill or overall system cost.
- The task objective.
- Relevant file paths.
- Exact line numbers when available.
- Required changes.
- Acceptance criteria.
- A verification command to run before reporting completion.
The principle: Give an agent the information it needs to complete the task, not everything the orchestrator knows.
2. Use Prompt Caching to Avoid Paying Twice
Another major source of wasted money is repeatedly sending the same instructions, rules, and project context to an AI model.For example, an internal Hermes server sent 21.5 million input tokens over two days with a 0% cache hit rate, costing approximately $100.
Prompt caching can significantly reduce this expense.
Lower input costs
According to Anthropic's pricing documentation, cached input reads are generally charged at 10% of the standard input price. Claude Opus 5.5 and Sonnet 5.5 have a special 5% rate.
For example:
| Model | Normal input | Cached read |
|---|---|---|
| Claude Opus 5.5 | $4/MTok | $0.20/MTok |
| Claude Sonnet 5.5 | $2/MTok | $0.10/MTok |
How to get better cache hits
Organize your prompts so that:- Stable instructions and system rules come first.
- Shared project context follows.
- Variable task instructions come last.
Changing content before a cache breakpoint can prevent reuse of the cached prefix that follows it.
Also remember that cache writes are not free. Anthropic charges more for writing cached prompts than for normal input, so caching is most useful when the same context is reused.
The principle: Keep the reusable context stable and move changing information to the end.
3. Use Expensive Models for Planning and Cheap Models for Execution
Not every task needs your most expensive AI model.A more efficient multi-agent workflow separates responsibilities:
Expensive model
Plans the task, defines requirements, and reviews the final result.
Cheaper model
Implements the changes using a short, specific task brief.
Automated verification
Runs tests and validation commands before requesting an AI review.
Final review
The expensive model checks the result only after automated verification passes.
A few rules make this workflow more efficient:
- Run tests before spending tokens on an AI review.
- If verification fails, don't request a review yet.
- Allow a maximum of two repair attempts.
- Start each repair attempt with a fresh executor and a concise brief.
- Escalate unresolved problems to a human.
4. Three GitHub Repositories That Can Help Reduce AI Costs
These three projects tackle different sources of token waste. Their GitHub popularity figures below are approximate snapshots checked on November 12, 2026.🧪 1. Matt Pocock Skills
Repository: https://github.com/mattpocock/skillsThis repository provides engineering skills that help AI coding agents work more systematically.
Three particularly useful skills are:
tdd: Write tests before implementing changes.grilling: Clarify requirements before starting implementation.diagnosing-bugs: Investigate problems systematically instead of guessing.
There is no verified universal token-saving percentage for these skills. Their value comes from improving the development workflow and making acceptance criteria easier to verify.
🪨 2. Caveman
Repository: https://github.com/JuliusBrussee/cavemanCaveman reduces unnecessary words in AI responses while trying to preserve their meaning.
Its published benchmark uses 10 developer questions:
| Instruction | Output tokens |
|---|---|
| No instructions | 6,983 |
| Answer concisely | 4,334 |
| Caveman | 4,119 |
| UltraCave | 2,693 |
However, compared with the simple instruction "Answer concisely," the difference was much smaller. The project reports approximately 3% additional reduction at the median.
This is an important distinction: always benchmark your own workload before assuming a tool will deliver the same savings.
🕸️ 3. Graphify
Repository: https://github.com/safishamsi/graphifyGraphify converts a codebase into a searchable knowledge graph.
Instead of repeatedly asking an AI agent to read entire files, you can build a local graph and query specific relationships and code structures.
For example, you can use:
graphify queryTo retrieve relevant information about your codebase without repeatedly scanning every source file.
Its code parsing uses local processing through Tree-sitter, without requiring LLM credits for code-only graph extraction.
The project does not publish a universal token-saving percentage for its open-source version, so actual savings depend on your codebase and workflow.
5. Reduce the Resource Usage of Your AI Infrastructure
If your AI agents are consuming too much bandwidth and local machine resources, consider moving long-running services to a dedicated server.For example:
- Host frequently used MCP servers remotely.
- Avoid loading unnecessary tools into every agent.
- Keep only task-specific integrations enabled.
- Monitor token consumption and cache hit rates.
- Track input and output costs separately.
✅ Final Takeaway
You don't necessarily need a more expensive AI subscription or a more powerful model to reduce your AI spending.Start with these five practices:
- Reduce context: Send short task briefs instead of entire conversation histories.
- Enable prompt caching: Reuse stable instructions and project context.
- Delegate intelligently: Let expensive models plan and review while cheaper models execute.
- Automate verification: Run tests before spending tokens on AI reviews.
- Optimize your tools: Use specialized skills and code knowledge graphs to avoid unnecessary work.
Don't pay an expensive model to read information it doesn't need, repeat work that has already been done, or review code that hasn't passed its tests.
Last edited: