7 Tools to Reduce Token Waste in AI Coding Workflows
Sean Kochelgo watch the original →
the gist
A guide to optimizing token usage in AI coding agents by auditing session startup, enforcing concise communication, and implementing structured context management.
Auditing and Baseline Optimization
To stop burning tokens, you must first identify where they are being spent. The token-optimizer tool provides a dashboard that breaks down token consumption by session startup, skill definitions, and MCP tools. Many users inadvertently bloat their context with dozens of globally installed skills that aren't relevant to the current task. A regular audit allows you to prune unused skills and tools, which significantly lowers the baseline token cost for every new session.
Enforcing Concise Communication
Language models often default to verbose, narrative-driven responses that consume unnecessary output tokens. The caveman skill forces the AI to communicate in direct, technical, and sparse language. By stripping away filler while maintaining technical accuracy, this approach can reduce output token usage by 30-40%. This is particularly effective during the planning phase of a project, where the model doesn't need to provide a conversational explanation of its logic.
Context Engineering with Intent Layers
When working in large, existing codebases, AI agents often struggle to understand project-specific constraints, leading them to read irrelevant files or hallucinate patterns. The intent-layer tool solves this by creating nested agent.md files within project directories. These files act as localized context, providing the model with architectural rules, anti-patterns, and project-specific conventions (e.g., "always use this specific Stripe helper function"). This ensures the model is grounded in the project's reality without needing to scan the entire repository.
Managing Session State
Long-running sessions inevitably lead to context bloat. The handoff tool facilitates a "scratchpad" workflow: you perform research or brainstorming in one session, then use handoff to generate a concise summary that is passed into a fresh, clean session for implementation. This prevents the "slow death" of a session where the context window becomes cluttered with outdated plans and irrelevant conversation history.
Optimizing the Claude Markdown File
Many developers maintain outdated or overly long claude.md files. An effective file should be under 300 lines and focus on information the model cannot infer from the code itself. This includes the project's core intent, specific version constraints for frameworks (like Next.js), and tribal knowledge or "gotchas" discovered during development. Treat this file as a living document, updating it weekly to reflect the current state and rules of the project.