Local-first context tooling

Keep your coding agent's context lean.

Set up supported coding tools, trim noisy command output, map source files, and audit real Claude Code sessions. The CLI runs locally, with no proxy or model calls.

MIT licensed Node.js 18+ No runtime dependencies
lean — local command view ready

$ lean prune npm test

Running project test suite...

✓ ALL TESTS PASSED

4 test groups completed

[LeanToken: condensed output]

↳ Full output: .lean/logs/<time>-<command>.log

Pruned output saved locally0 CLI network calls
↘ noisy output
✳ useful signal
BUILT FOR PRACTICAL CODING WORKFLOWS01 deterministic pruning02 lightweight outlines03 local project memory

A smaller loop, not another layer

Useful context in.
Less noise out.

LeanToken works at the edges of your coding workflow. It doesn't sit between your agent and its model.

THE LOCAL FLOW01 / 03
Your commandgit · tests · JSON · more
LeanTokendeterministic local rules
Focused contextagent sees the signal

Full output stays close. When output is actually pruned, the original is best-effort saved to your local .lean/logs/ folder.

LOCAL

Small tools. Clear jobs.

Keep the useful.
Leave the rest nearby.

Independent CLI features you can use together or one at a time.

01 / OUTPUT

Prune command noise

Condense common Git, test, directory, and JSON output with predictable local rules. Unexpected parsing trouble fails open to the original output.

lean prune git status

02 / STRUCTURE

See code shape

Get lightweight source signatures or Markdown section maps with line ranges, so you can read only the parts you need.

lean symbols src/

03 / LEARNING

Remember project patterns

Analyze recent Claude Code sessions to map frequently read files and recurring command errors into local project memory.

lean learn session.jsonl

04 / MEASUREMENT

Audit real sessions

See model token counts, shell output pruned or skipped, repeated reads, and the files your Claude Code sessions use most.

lean audit

LOCAL BY DESIGN

Your workflow stays yours.

LeanToken sets up local instructions for supported coding tools and, when Claude Code is detected, its output-pruning hook. It does not proxy or rewrite model conversations.

Language-friendly, not language-bound

Work in the stack
you already have.

Command pruning is language-agnostic. Symbol outlines cover 12 common source languages, Markdown section maps, and a generic summary for other files.

See usage details (opens in a new tab)
OUTLINE SUPPORT 12 languages
JavaScriptTypeScriptPythonPHPJavaC#GoRustRubyKotlinSwiftC / C++

Best-effort, lightweight outlines — not compiler-grade parsing.

v0.3.1 · Open source · MIT · Node.js 18+

Make room for
the real work.

Install LeanToken from npm, then initialize the coding tools detected for your project. Preview the changes first if you like.

A few quick answers

Good to know.

LeanToken is intentionally small. Here’s what that means in practice.

Does LeanToken send code or prompts to a service?

No. The CLI does not send source code, command output, or prompts to a LeanToken service. The documentation chat on this website is a separate Context7 widget, not part of the CLI.

Does it require a specific coding agent?

No. LeanToken can write instructions for supported coding tools. Its automatic shell-output pruning hook is for Claude Code; you can also run the CLI commands directly.

Does symbol outlining parse every language perfectly?

No. It uses lightweight heuristics for supported source languages, provides section maps for Markdown, and a generic summary for other individual files. It is for quick orientation, not a replacement for a compiler or language server.

What happens to the full command output?

When output is actually pruned, the raw output is best-effort saved to .lean/logs/ in a per-run file. LeanToken keeps the 20 newest logs.