Stop Burning Tokens: How Agent Orchestration and Knowledge Graphs Cut AI Coding Costs by 70%
The Augment Code community has a pricing problem. Users on $200/month plans hit their credit limits in two days. Teams petition to switch tools. Engineers abandon Auggie mid-sprint. The root cause is not the subscription price. It is how tokens get spent.
A single Auggie session on a moderately complex codebase burns 15,000 to 20,000 tokens just re-establishing project context at session start. Multiply that across 20 sessions per week and a significant portion of your credit budget does nothing useful. Then add the real work: every agent turn re-sends the full conversation history, tool outputs accumulate, and input token cost grows quadratically. A 20-step agent loop where each step generates 1,000 tokens produces 210,000 cumulative input tokens, not the 20,000 a per-step estimate suggests.
On top of that, Auggie defaults to Opus 4.6 for every task. A file rename. A git status. A simple code search. All billed at 167% of the Sonnet baseline rate. No wonder people run out of credits.
I built oh-my-auggie (OMA) to fix this. It is a native Auggie marketplace plugin that attacks token waste at three layers: agent orchestration, model routing, and knowledge graph context.
The Three Layers of Token Waste
Before explaining the solution, understanding where tokens actually go is useful.
Layer 1: Context accumulation. Every tool call result stays in the conversation history. By turn 15, the agent carries hundreds of thousands of tokens of intermediate scaffolding it no longer needs. Augment’s own engineering team documented this: naive agent loops compound token costs at O(N-squared) because LLM APIs bill for the entire conversation history on every call.
Layer 2: Wrong model for the task. Opus 4.6 costs 167% of Sonnet. GPT-5.4 costs 143%. Most coding tasks do not need the most expensive model. Exploration, file search, git operations, and documentation lookups work identically on cheaper models. But Auggie defaults to the premium option.
Layer 3: Redundant file reads. Every new session re-reads the same files to rebuild context. A codebase with 50 files can cost over 100,000 tokens per session just for the initial orientation pass. Across a work week, that is half a million tokens spent remembering what you already knew.
OMA addresses all three.
Layer 1 Fix: Agent Orchestration with Context Isolation
OMA splits work across 19 native Auggie subagents. Each subagent runs in its own independent context window. This is the single most impactful change for token efficiency.
Without OMA, a single agent handles everything: reads the codebase, plans the work, writes the code, reviews the result, runs tests, and fixes failures. By the end, its context window is packed with exploration output, planning artifacts, implementation details, test results, and error traces. Most of that context is irrelevant to the current step. The agent is paying to carry dead weight.
With OMA, the Explorer maps the codebase in one context window. It finishes and returns a compact summary. The Planner receives only that summary and decomposes the task. The Executor receives only its specific subtask with file paths and instructions. The Architect receives only the diff and test results for verification. Each agent starts clean. No accumulated garbage.
Research on shared context windows in multi-agent systems found that token consumption dropped by 53.7% on average when context isolation replaced redundant re-encoding across agent calls. That number comes from the coordinator-specialist pattern, which is exactly what OMA implements.
The agents are not interchangeable. Each one has specific tool restrictions that prevent scope creep:
The Architect (Opus 4.6) verifies designs but physically cannot edit files. Its tools for str-replace-editor, save-file, and remove-files are disabled at the Auggie subagent level. It reviews. It does not implement.
The Explorer (Gemini 3.1 Pro) navigates the codebase but can only use view and codebase-retrieval. It cannot run commands, write files, or make changes. It maps. It does not build.
The Executor (Sonnet 4.6) has full tool access but receives only a self-contained task prompt. It does not see the Planner’s full decomposition, the Explorer’s raw output, or the Architect’s previous verdicts. It implements exactly what it was told.
This isolation is not just about cost. It prevents the “helpful agent” problem where every agent tries to do everything and none of them do their actual job well.
Layer 2 Fix: Cost-Aware Model Routing
OMA assigns each agent a model tier based on what it actually needs.
Agent Model Relative Cost Why oma-explore haiku4.5 30% Read-only search. Speed matters more than reasoning. oma-writer haiku4.5 30% Documentation. Does not need deep reasoning. oma-executor sonnet4.6 100% Implementation. The baseline for coding tasks. oma-debugger sonnet4.6 100% Root cause analysis. Needs tool access. oma-planner opus4.6 167% Task decomposition. Needs deep reasoning. oma-architect opus4.6 167% Design verification. Needs nuanced judgment. oma-explorer (alt) gemini-3.1-pro 92% Planning and structural reasoning at lower cost.
The default Auggie behavior bills everything at the Opus rate. OMA bills exploration at the Haiku rate and implementation at the Sonnet rate. Opus only fires for tasks that genuinely need it.
For a typical autopilot run (explore, plan, execute, verify), the cost breakdown shifts dramatically. Instead of 4 Opus calls, you get 1 Haiku call, 1 Gemini call, 1 Sonnet call, and 1 Opus call. The blended cost drops by roughly 40–50% for the same output quality.
Layer 3 Fix: Graphify and LLM Wiki
The third layer attacks the most wasteful pattern: re-reading the same codebase every session.
Graphify is a knowledge graph skill that reads your codebase once, builds a persistent graph of entities and relationships, and lets agents query the graph instead of re-reading raw files. The measured token reduction is 71.5x on a 52-file corpus. A query that costs 123,000 tokens against raw files costs 1,700 tokens against the graph.
Graphify uses Tree-sitter for deterministic AST extraction (classes, functions, imports, call graphs) and LLM-driven semantic extraction for docs, papers, and images. The results merge into a NetworkX graph clustered with Leiden community detection. No vector database. No embeddings. The graph structure itself is the similarity signal.
The key insight for OMA: Graphify’s --wiki flag generates Wikipedia-style markdown articles per community and "god node" (the most connected entities in the graph). It produces an index.md entry point that any agent can navigate by reading files instead of parsing JSON. Point the Explorer subagent at index.md and it understands the entire codebase architecture without reading a single source file.
This is where OMA and Graphify compound. The Explorer subagent (running on Haiku at 30% cost) reads the wiki index instead of scanning the raw codebase. It produces a context summary for the Planner. The Planner decomposes tasks with file paths extracted from the graph, not from expensive codebase-retrieval calls. The Executor receives precise file references and implements directly.
The combined savings: context isolation cuts 50%+ of accumulated token waste. Model routing cuts 40–50% of per-call cost. Graph-based context eliminates the 15,000–20,000 token orientation tax per session. In practice, teams report 60–70% total token reduction on the same workloads.
How OMA Works Inside Auggie
OMA is a native Auggie marketplace plugin. It uses Auggie’s own extension primitives. No external runtime. No separate process. No tmux.
Subagents (agents/*.md) define each specialized agent with YAML frontmatter specifying model, description, color, and tool restrictions. Auggie spawns them in parallel with independent context windows.
Slash commands (commands/*.md) provide the user interface. /oma:autopilot runs the full orchestration loop. /oma:ralph enters persistence mode. /oma:ultrawork maximizes parallelism. 28 commands total.
Hooks intercept Auggie’s lifecycle events. SessionStart injects the orchestration brain and restores active mode. PreToolUse blocks direct file edits when orchestration is active, forcing delegation to the Executor. Stop blocks premature completion in ralph (persistence) mode until the Architect approves.
MCP state server persists orchestration state, notepad entries, and skill data to .oma/state.json. Agents read and write state across turns through MCP tools.
Skills auto-activate based on trigger keywords. Type “autopilot” naturally in your prompt and the autopilot skill activates. Type “don’t stop” and the ralph persistence loop engages. No slash command needed.
Installation
Prerequisites
All platforms need:
- Node.js 22 or later
- An Augment Code account (any plan)
- Auggie CLI installed and authenticated
macOS
Open Terminal (or iTerm2, Ghostty, Alacritty, Kitty).
Install Auggie CLI if you have not already:
npm install -g @augmentcode/auggieLog in to your Augment account:
auggie loginAdd the OMA marketplace and install the plugin:
auggie plugin marketplace add r3dlex/oh-my-auggie
auggie plugin install oma@oh-my-auggieStart Auggie and verify OMA loaded:
auggieThen type /oma:help inside the Auggie TUI. You should see the full command listing.
Get Andre Burgstahler’s stories in your inbox
Join Medium for free to get updates from this writer.
Optional: install Graphify for knowledge graph context:
pip install graphifyyThen inside Auggie, run /graphify to build the graph for your current project.
Linux (Ubuntu/Debian)
Install Node.js 22:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejsInstall Auggie CLI:
npm install -g @augmentcode/auggieLog in:
auggie loginInstall OMA:
auggie plugin marketplace add r3dlex/oh-my-auggie
auggie plugin install oma@oh-my-auggieVerify:
auggie
# Type /oma:help inside the TUIOptional Graphify:
pip install graphifyyLinux (Fedora/RHEL)
Install Node.js 22:
sudo dnf module install nodejs:22The remaining steps are identical to Ubuntu. Install Auggie, log in, add the OMA marketplace, install the plugin.
Windows (WSL2)
OMA requires WSL2 on Windows. Native Windows is not supported.
Install WSL2 if you have not already:
wsl --installInside your WSL2 terminal, follow the Linux (Ubuntu/Debian) instructions above.
Verify Installation
After installing on any platform, run:
auggieInside the Auggie TUI:
- Type /oma:help to see all available commands.
- Type /oma:doctor to run diagnostic checks.
- Type /oma:autopilot “describe what this project does” to test the full orchestration loop.
If /oma:help does not appear, the plugin may not have loaded. Run:
auggie plugin listConfirm that oma@oh-my-auggie shows as enabled. If it does not appear:
auggie plugin install oma@oh-my-auggieUpdating OMA
OMA updates automatically when Auggie starts if automatic marketplace updates are enabled (they are by default). To update manually:
auggie plugin marketplace update oh-my-auggieQuick Start After Install
Once installed, the fastest path to value:
- Navigate to your project directory.
- Run auggie.
- Type: autopilot “add input validation to the user registration endpoint”
- Walk away. OMA explores the codebase, plans the tasks, delegates to the Executor, and verifies with the Architect.
For cost-conscious usage, run /oma:configure and set the enterprise profile. This routes exploration to Gemini 3.1 Pro by default and warns before tasks that would consume more than 500 credits.
Open Source and Sponsorship
OMA is fully open source under MIT license.
GitHub: https://github.com/r3dlex/oh-my-auggie
PRs welcome. If you build an agent or workflow that works well for your codebase, open an issue or submit it as a skill.
If OMA saves you credits and you want to support development, consider sponsoring the project:
https://github.com/sponsors/r3dlex
Sponsorship funds go toward maintaining the plugin, adding new agents and workflows, and building the Elixir team runtime for advanced tmux-based parallel workers.
What OMA Does Not Fix
OMA does not fix broken MCP connections, API errors, or Auggie crashes. Those are Augment platform problems.
OMA does not reduce the base cost of your Augment subscription. It reduces how fast you burn through credits within that subscription.
OMA does not replace Auggie. It runs inside Auggie as a plugin. If Auggie itself does not work for your team, OMA will not change that.
What OMA does is make every token count. Exploration on cheap models. Implementation on the right model. Verification on the expensive model. No wasted context. No redundant file reads. No quadratic history accumulation.
For teams staying on Augment and tired of watching credits disappear on tasks that should cost a fraction of what they do, this is the fix.
oh-my-auggie (OMA): https://github.com/r3dlex/oh-my-auggie
Sponsor: https://github.com/sponsors/r3dlex
Graphify: https://github.com/safishamsi/graphify
Auggie Plugin Docs: https://docs.augmentcode.com/cli/plugins
oh-my-claudecode (the original): https://github.com/Yeachan-Heo/oh-my-claudecode







