언제 쓸까: Your monthly AI coding bill is growing and you want to reduce it without changing your workflow.
사전 조건
- lean-ctx installed — brew install lean-ctx or curl -fsSL https://leanctx.com/install.sh | sh
흐름
-
One-command setup
→ Shell hooks installed, all detected editors configured automatically
-
Code normally for a day
Use your AI coding tool as usual — lean-ctx works transparently in the background.✓ 복사됨
→ No workflow change; compression happens silently
-
Check savings
→ Dashboard showing token savings per category (file reads, git, shell, etc.)
결과: Measurable token reduction (typically 60-90%) with zero workflow friction.
함정
- Compressed output confuses some edge-case prompts — Use
lean-ctx-off to temporarily disable, or use ctx_read with 'full' mode for specific files
언제 쓸까: Your AI assistant wastes tokens reading entire files when it only needs the structure or signature.
흐름
-
Use map mode for overview
lean-ctx read src/main.rs -m map✓ 복사됨
→ File structure at ~10% of full token cost
-
Use signatures mode for API
lean-ctx read src/lib.rs -m signatures✓ 복사됨
→ Just function/type signatures, no bodies
-
Use diff mode for changes
lean-ctx read src/main.rs -m diff✓ 복사됨
→ Only lines changed since last read — minimal tokens
결과: The AI gets exactly the context it needs at a fraction of the token cost.
함정
- Aggressive mode strips too much for complex refactoring — Use 'task' mode instead — it preserves context relevant to the current task
언제 쓸까: You're using Claude Code for architecture and Cursor for implementation, and they keep re-reading the same files.
흐름
-
Build context in agent A
In Claude Code: analyze the architecture of this project using ctx_overview.✓ 복사됨
→ Context built and cached by lean-ctx
-
Share to agent B
In Cursor: use ctx_share to pull the architecture context from the last session.✓ 복사됨
→ Cursor gets the architecture map without re-reading all files
-
Track costs across agents
lean-ctx gain --all-sessions✓ 복사됨
→ Combined savings across both agents
결과: Multiple agents share a cached context layer, avoiding redundant file reads.
함정
- Stale cache after file changes — lean-ctx tracks file modification times — cache invalidates automatically on change