Your CLAUDE.md is read every message. Keep it small.
// Two shell scripts that keep Claude Code's context small — a status line and a session-start hook — plus 11 skills for trimming it further. Zero runtime dependencies. The portable skills also run on Codex and Gemini CLI.
the_whole_idea
- 1,625 words · ~2,100 tokens, loaded before you type a word- prose rules, repeated defaults, a verify table, three doc layers+ 583 words · ~760 tokens — same constraints, none dropped+ under the hook's own 600-word line, so it never warns on itself
// this repo's own CLAUDE.md, over one day. The hook counts words × 1.3 — an estimate, labelled as one.
session_start_hook
// a hook that saves tokens must not spend them: nothing reaches the model unless a file is over the line.
thresholds
under 390 tokens of CLAUDE.md
390+ tokens · time to think about /compact
780+ tokens · run optimize-claudemd
1300+ tokens · compact now
// the palette is the tmux "Night City" theme — yellow is your prefix colour, purple your copy-mode colour. Needs a Nerd Font for the separators.
install
npx skills@latest add kyuna0312/context_forge -a codexnpx skills@latest add kyuna0312/context_forge -a gemini-clibash scripts/install.shclaude --plugin-dir /path/to/context_forge// skills.sh copies the portable skills; skip the ones marked Claude Code only.
// full setup, thresholds and smoke tests in the README.
skills
| skill | what it does |
|---|---|
/context-forge:optimize-claudemd | rewrite a bloated instruction file under 300 words, no constraint dropped |
/context-forge:estimate-tokens | per-source token estimate with size thresholds |
/context-forge:low-token-mode | terse replies for the rest of the session |
/context-forge:reset-context | paste-back summary, then compact or clear |
/context-forge:task-brain-lite | dependency-ordered task table, one step per response |
/context-forge:llm-wiki | a wiki the agent reads instead of raw docs |
/context-forge:tune-settings · cc | documented token-saving settings keys, diff + backup first |
/context-forge:manage-skills · cc | audit skill descriptions, the only per-session cost |
/context-forge:debug-hooks · cc | diagnose failing hooks; ships validate-hooks.sh |
/context-forge:project-isolation · cc | scope a session to the current project |
/context-forge:token-statusline · cc | install the status line |
// cc = Claude Code only (settings.json, hooks, status line). Descriptions total ~350 tokens per session — measured as words × 1.3.