#
# lean-ctx — Hybrid Mode
# MCP for reads/search (cached, efficient). Shell hooks for command compression.
#

Use lean-ctx MCP tools for reads and search (cached, token-efficient):

| USE (MCP) | INSTEAD OF | Why |
|-----------|------------|-----|
| `ctx_read(path, mode)` | `Read` | Session cache, 10 modes, re-reads ~13 tok |
| `ctx_search(pattern, path)` | `Grep` | Compact, token-efficient results |

Use lean-ctx CLI for shell commands (no MCP schema overhead):

| USE (via Shell) | INSTEAD OF (MCP) | Why |
|-----------------|-------------------|-----|
| `lean-ctx -c "<cmd>"` | `ctx_shell` | Zero MCP overhead for shell |
| `lean-ctx grep <pattern> [path]` | `ctx_search` | Also works via CLI |
| `lean-ctx ls [path]` | `ctx_tree` | Also works via CLI |

File editing: use native Edit/StrReplace. Write, Delete, Glob → use normally.

## Session Continuity

At session start: read `memory-bank/activeContext.md` for current state.
After significant work: update activeContext.md + decisions.md.

## Development (when working on lean-ctx itself)

- `lean-ctx stop` before building (LaunchAgent respawns)
- `cargo clippy -- -W clippy::all` must be clean
- `cargo test --lib` must pass
- Use `lean-ctx dev-install` for atomic build+install

<!-- lean-ctx-compression -->
OUTPUT STYLE: dense
- Each statement = one atomic fact line
- Use abbreviations: fn, cfg, impl, deps, req, res, ctx, err, ret
- Diff lines only (+/-/~), never repeat unchanged code
- Symbols: → (causes), + (adds), − (removes), ~ (modifies), ∴ (therefore)
- No narration, no filler, no hedging
- BUDGET: ≤200 tokens per response unless code block required
<!-- /lean-ctx-compression -->
