19 hacks
Keep the root CLAUDE.md short and drop domain-specific CLAUDE.md files under paths like src/db/ so Claude loads them only when it works in that area.
Spin up a subagent for codebase search or verification so only the conclusion returns to your main context.
Proactively run `/compact` with focus instructions so summaries keep the work that matters instead of stale debugging.
Every installed skill spends context just being listed, before you invoke anything. Sort the list by cost, then set the ones you never use to name-only.
Double-Esc /rewind back to after useful file reads, then re-prompt with what you learned—without the failed approach still in context.
Instruct Claude (and yourself) to search with rg/Glob first so giant file reads do not blow the context window.
A skill that checks a link or reformats a file does not need your session model. Set model, effort and context: fork in the frontmatter so cheap skills stay cheap.
Put domain-specific instructions in path-scoped `.claude/rules/` so they load only when Claude touches matching files.
Claude Code re-reads your whole conversation at the cached rate. Come back after a long lunch and the first message reprocesses all of it at full price.
Trim project memory to under ~200 lines so Claude follows critical rules instead of drowning them in noise.
Run /context to break down token consumers—CLAUDE.md, MCP tools, conversation—and prune the expensive ones.
When a skill hits an edge case, append it to a gotchas section in that skill rather than to CLAUDE.md. The lesson then loads only when the skill runs.
Turn off MCP servers unrelated to the current project—their tool schemas still consume context at session start.
Declare a Compact Instructions section in CLAUDE.md so both manual /compact and autocompact preserve the project’s critical decisions by default.
Use /clear between unrelated tasks so leftover debugging does not bias the next feature.
Use /btw for single-turn clarifications that share full context but never enter conversation history or burn future tokens.
Auto-compact waits until your context is nearly full, which is well past the point where answer quality starts sliding. Set the window lower and compact while the session is still sharp.
"Never add comments" in CLAUDE.md plus "make this readable" in your prompt is a contradiction Claude has to resolve before it writes a line. Find those pairs and pick one.
Most CLAUDE.md lines exist to correct a model that no longer makes that mistake. Delete them after an upgrade and re-add only the ones a failure proves you need.