This is a personal reference workflow for minimizing token usage while maintaining project continuity across Claude Code (Sonnet 4 with file access).
Claude loads CLAUDE.md
automatically at session start.
Keep it under 5k tokens. Claude uses this as project memory.
Populate and maintain CLAUDE.md with all relevant project-wide context so you can resume work efficiently without me repeating context each session. Include:
- Project summary & active features
- Tech stack
- Code style & naming conventions
- Known bugs and next TODOs
- Test scenarios we havenβt completed yet (if any)
Keep it under 5k tokens total.
If it becomes impossible to keep all relevant info under 5k tokens, split less critical sections into separate files under the docs/ directory. For example, if there are details about a future system version (e.g., MK2), create a separate markdown file like docs/mk2_notes.md instead of bloating CLAUDE.md.
- Run:
/compact Focus on code samples and API usage
(You can change the focus as needed β e.g., "design decisions" or "test coverage, or just /compact, but will have more fluff and save less on tokens")
- Prompt Claude:
Append that summary to docs/progress.md
Also save a standalone summary to session_summary.md
-
Do NOT run
/clear
unless you want to reset everything.- It's safer to just exit or start a new chat.
- Session will stay available if you want to revisit it later.
- Start new chat
- Load:
@CLAUDE.md
@docs/progress.md
@session_summary.md (optional)
- Run:
/compact Focus on code samples and API usage
- Prompt Claude:
Save that summary to session_summary.md
This keeps the working context tight and avoids token bloat.
Maintain progress.md
, log.md
, etc. for running session history.
- Update at end of each session
- Claude can read it at session start
- Load it manually with
@progress.md
if needed
Pro tip: Keep logs in docs/
and only load when needed.
Instead of pasting long blocks:
- Split reusable info into standalone
.md
or.yaml
files - Load on demand via
@filename.md
Good for:
- Command syntax
- API docs
- Configs / routes / edge cases
Write like a spec. Be precise.
Bad:
Hey can you fix this bug?
Good:
Fix the off-by-one bug in
utils.py
line 12 that causes the last item to be skipped. Input: list of ints. Output: adjusted list. Keep type hints.
Other tips:
- Ask grouped questions instead of one-by-one
- Avoid redundant background unless necessary
- Use
CLAUDE.md
for persistent context (β€ 5k tokens) - End sessions with
/compact
, then log toprogress.md
and optionallysession_summary.md
- Start sessions by loading only needed files
- Compact every ~40 messages to keep things clean
- Use modular files and focused prompts to minimize token load
Keep it lean. Let Claude handle memory. You just keep shipping.