128 ways to spend fewer tokens
The 22 Beginner tips are free to read. The 106 advanced tactics unlock with Pro — plus a fresh tip in your inbox every morning.
Ask for the Patch, Not the Whole File
When editing an existing file, tell the assistant to return only the changed lines as a diff or snippet instead of regenerating the entire file.
Run /clear Between Tasks in Claude Code Instead of Letting Context Pile Up
Claude Code resends the whole conversation every turn. Finishing one task and starting an unrelated one in the same thread means you keep paying for stale tool output and dead files.
Add a .cursorignore So Cursor Stops Indexing Your node_modules
Cursor's @codebase and automatic context can pull in build artifacts, lockfiles, and vendored dependencies. A .cursorignore file keeps that noise out of every prompt.
Return only changed lines when an agent re-reads a file
Coding agents re-read the same file many times per session, paying full-file token cost each time even when almost nothing changed. Serve a delta — only the lines that changed since the agent last saw the file — instead of the whole thing, and replace re-reads for structure with a signatures-only map.
Scope Copilot Chat With #file Instead of @workspace
@workspace tells Copilot to search your entire repo and stuff retrieved snippets into the prompt. For targeted work, naming specific files with #file is leaner and usually more accurate.
Use Inline Completion for Trivial Edits, Save Chat for Reasoning
Route boilerplate and one-liners through tab-style inline completion instead of opening a chat panel, which drags in your whole conversation and attached files.
Call Tools as Code, Not by Injecting Every Tool Definition
Default MCP setups load every tool's JSON schema into the prompt on every turn and round-trip each intermediate result back through the model. Let the agent search for the few tools it needs and orchestrate them in code instead.
Turn Off Auto Codebase Context When You Don't Need It
Features like 'codebase' auto-retrieval and automatic open-file context silently attach extra tokens to every message. Switch them off for narrow tasks and attach context explicitly.
Estimate, Execute, Expand: Read the Minimum, Widen Only on Failure
Most coding agents front-load context — open a dozen files, grep the whole repo, pull broad retrieval — before making a one-line edit, then re-bill all of it every turn. Estimate the task's real scope, execute the minimal path, and only widen context when a verification step actually fails.
Anchor edits with a content hash, not the echoed old string
Search/replace edit tools force the model to re-type the exact original code as a match anchor. Swap that echoed 'old string' for a short content hash the read step already handed back, and the model generates far fewer output tokens per edit — the expensive side of the bill.
Minify Source Code Before It Enters the Agent's Context
In a state-in-context coding agent, the source files pasted into every turn are the single biggest token contributor. Strip whitespace, comments, and needless formatting from that payload before it reaches the model and you cut input tokens dramatically — but only if you accept a measurable accuracy tradeoff and restore names on the way out.
Give Agents Predicate-Flag CLIs and Pre-Filtered Command Output
Coding agents burn tokens reading verbose --help text and giant JSON dumps, then burn more composing jq/wc/python pipelines to interpret them — and under a stateless API the dump is re-billed on every turn. Shape command output into a compact, answer-shaped form before it ever reaches the context window.
Quarantine Heavy Reads in a Sub-Agent, Return Only the Summary
Delegate token-heavy exploration — large-file reads, log digging, multi-file research — to a sub-agent with its own throwaway context window, so only a distilled summary lands in the main thread instead of the entire exploration trail you'd otherwise re-bill every turn.
Pipe Logs Through head/grep Before Pasting Them Into an Assistant
A 4,000-line stack trace or verbose build log is mostly repetition the model doesn't need. Extract the signal first; pasting the whole thing is the single most wasteful coding-assistant habit.
Tee the Agent's Own Reads to a Cheap Live-Memory Model
Instead of letting your premium coding agent re-read the same files into its own context over and over, tee the reads it already performs to an always-on cheap model that distills them into a queryable memory ledger. The expensive model then asks one question instead of re-opening files.
Tier Sub-Agent Models by Depth: Opus at the Root, Haiku at the Leaves
Claude Code sub-agents can now spawn their own sub-agents up to 5 levels deep. If every frame inherits your flagship model, a deep tree multiplies Opus-priced tokens. Make the model cheaper as depth increases.
Like what you see?
Get a fresh one in your inbox — weekly free, daily on Pro.