AGINE Academy

Pay for context, not filler.

How to save tokens in Claude: model routing (Haiku/Sonnet/Opus), Obsidian as long-term memory, GitHub optimizers, /compact, and the real AGINE setup.

How to save tokens

How to stop overspending on Claude. Model choice applies to everyone: Pro subscribers and developers alike. The Obsidian and GitHub sections are for people who work with Claude Code in the terminal.


Who this page is for

The section on model choice (Haiku/Sonnet/Opus) is useful for anyone paying for Claude Pro. The Obsidian and GitHub sections are for developers who use Claude Code (the terminal tool). Don't use the terminal? Jump straight to the first section below.


① Model routing: your biggest source of savings

One project, three models. Each in its place.

The most common mistake is running everything through Opus. It's 5× the price of Sonnet and 15× the price of Haiku, and on simple tasks it buys you nothing. The AGINE rule: a model is a tool matched to a class of task.

ModelPriceUse it forSkip it for
Haiku 4.5$1 / 1M input tokensbulk processing (classification, extraction, translation), high-throughput batch jobs, simple text transformations.complex multi-step tasks, reasoning, architecture generation.
Sonnet 4.6$3 / 1M input tokensday-to-day coding, refactoring, documentation, moderately complex tool use, ~80% of dev tasks.critical architecture decisions that need depth (that's Opus territory).
Opus 4.7$15 / 1M input tokenscritical thinking, system design, gnarly bugs that need deep analysis, high-stakes reviews.routine and bulk tasks (that's Sonnet) or batch processing (that's Haiku).

🎯 The AGINE rule: 70/25/5

70% of tasks go to Sonnet, 25% to Haiku (extraction, classification), 5% to Opus (critical decisions only). That cuts your bill 3-4× vs. "everything through Opus".


② Obsidian = long-term memory

Stop re-explaining context every session. Save it.

Every new Claude Code session means reloading context from scratch (what you're building, what stack, which decisions are already made). With 20 CLAUDE.md files, that's easily 30k tokens at startup. The fix: Obsidian as a persistent memory vault that Claude queries via MCP.

claude-code-memory-setup Obsidian + Graphify for Claude Code UP TO 71.5× FEWER TOKENS PER SESSION The full setup: Obsidian vault + knowledge graph + chat-import pipeline. Claude stores project work as a structured knowledge base and pulls just the parts it needs via MCP, instead of loading everything at the start of a session. When to use it: long-running projects (3+ months), large codebases, team settings where project knowledge needs handing off. lucasrosati/claude-code-memory-setup · Open on GitHub

obsidian-skills (⭐ 3k+) Claude Skills for Obsidian Claude reads sources (articles, videos, notes), extracts entities and concepts, updates cross-references, and files it all into a structured vault. The vault gets richer with every ingest: that's compound memory. When to use it: content work, research projects, knowledge-base building (this very landing page is a dream use case for this stack). SilasMarvin/obsidian-smart-connections · Open on GitHub

claude-obsidian LLM Wiki pattern (Karpathy) An implementation of Karpathy's approach: Claude + Obsidian = a personal wiki. The /wiki /save /autoresearch commands automatically structure knowledge into a vault that grows nonlinearly. When to use it: founders and researchers juggling many projects in parallel. AgriciDaniel/claude-obsidian · Open on GitHub

MCP filesystem-server The basic MCP for vault access If you're building your own Obsidian workflow, there's no getting around this MCP. It gives Claude access to your vault files: reading, search, indexing. Connected via .mcp.json in your project. When to use it: any setup where Claude needs to read and understand a file structure on disk. modelcontextprotocol/servers · Open on GitHub


③ GitHub skills that cut your spend

Ready-made optimizers from the community. Grab them, don't reinvent them.

The Claude Code community has already built 10+ tools for trimming token spend. Each one plugs a specific leak: install only what fits your workflow, not everything at once.

claude-token-efficient One-file CLAUDE.md template UP TO -40% OUTPUT TOKENS A single CLAUDE.md that instructs Claude to answer tersely. Kills 'Sure!', 'Great question!', and long explanations of the obvious. Drop-in: put the file in your project and it just works. When to use it: output-heavy workflows (mass refactoring, documentation generation, big refactors). drona23/claude-token-efficient · Open on GitHub

token-optimizer An external context-analysis process Runs separately from Claude (NOT inside its context, so it doesn't eat your window). Scans session history and finds "ghost tokens": chunks of context that contribute nothing but still get billed. Then it tells you what to trim from CLAUDE.md. When to use it: when your bill keeps climbing and you can't tell why. A weekly run will surface the leaks. alexgreensh/token-optimizer · Open on GitHub

awesome-claude-code (⭐ 2k+) The official catalog from Anthropic A list of tools, integrations, frameworks, and resources for Claude Code, maintained by the Anthropic team. There's a Token Optimization section inside. It's the one list where you won't miss the tool you actually need. When to use it: step one before you build anything: see what's already been done. anthropics/awesome-claude-code · Open on GitHub

everything-claude-code Token-optimization documentation Not a library: a .md document that breaks down where Claude Code spends tokens (initial context, model responses, retries), how to measure it, and how to cut it. A good mental model to build before installing any tools. When to use it: read this first so you understand what gets cut and where. affaan-m/everything-claude-code · Open on GitHub


④ /compact: the money-saving trick you'll use most

Context bloats quietly. /compact fixes that.

Every message in a session piles up in the context window. Halfway through a long task, Claude is hauling ballast: intermediate steps, corrections, debugging. You pay tokens for all of it, even though the next step only needs the gist.

  • 70%: when to run /compact. Don't wait for 90%; at 90% Claude is already losing details from the start of the session. 70% is the sweet spot.
  • ~40–60%: context reduction. /compact strips out intermediate steps and debugging, keeping the decisions made and the current state.
  • 0 lost: what stays intact. Every decision made, the current code, tasks in progress. /compact compresses history; it doesn't delete facts.

# The AGINE rule for /compact

  • Sessions of 2+ hours: run /compact every 60-90 minutes. Long sessions (refactoring, a big feature) accumulate the most ballast.
  • Before new context: if you're switching to a new file or module after a long debugging stretch, run /compact first.
  • After /compact: answer quality bounces back. Claude stops "remembering" the wrong hypotheses from earlier in the session.
  • /compact, not /clear: /clear wipes everything. /compact compresses while keeping the decisions made. Save /clear for when the task has completely changed.

④ What we use at AGINE

Our real setup, no promo, exactly as it is.

  • Sonnet 4.6 as the default for all development (~70% of requests).
  • Haiku 4.5 for extraction agents in the SMM pipeline (trend classification, parsing JSON responses).
  • Opus 4.7 sparingly: critical decisions only (system design, reviewing production changes).
  • Obsidian vault (agine-knowledge): every decision, bug, feature, and session. Claude reaches it through the filesystem MCP.
  • Custom CLAUDE.md: terse-mode instructions, the AGINE voice, links to canonical docs inside the vault.
  • Subagents (general-purpose / Explore) for parallel searches. They run in a separate context and return only a summary, sparing the main context.

AGINE's monthly Claude API budget: ~$80-120 with 6+ hours of work every single day. Without these optimizations it would be $500+.


Next step

Tokens optimized? Now automate your content.

Once your spend is under control, it's the perfect time to build a system that runs 9 platforms in 2 hours a day.

Content Factory ↗ · Claude Code Tricks ↗


Start the free lessonSee the full programAll reference pages