MCP server · local-first · open core

Stop paying your model
to re-read your own code.

Lemma keeps repeated reads, noisy command output and tool schemas you can't use out of your agent's context. Then it prints a ledger of what that actually saved, including the sessions where it saved nothing.

$ claude mcp add lemma -- npx -y @nxuss/lemma mcp
Works withClaude CodeCursorWindsurfCodexKiroOpenCode
SESSION LEDGER
token_receipt · brain_stats

run_workspace_command · npx jest
raw output≈27K chars
reached the model142 chars
the restoutput_region

Brain reuse, our own project
memories written on purpose12 / 76 reused
memories auto-captured2 / 267 reused

Lemma's own prompt and schemas are charged to the ledger first. A session that doesn't pay for itself prints NET COST.

Real output from running Lemma on Lemma, 2026-10-03. Not a projection.

Proof

The numbers we publish, including the unflattering ones.

We run Lemma on Lemma. These are measurements, not a savings calculator.

27K → 142
characters of test output that reached the model

A full jest run, distilled to what a failing or passing run needs. The rest is one output_region call away, so nothing is lost, only not paid for until you ask.

16% vs 1%
reuse: memories written on purpose vs. auto-captured from commits

Measured on our own Brain (361 memories, 2026-10-03). Curated memories earn their place far more often. brain_stats now breaks reuse down by writer so you can run the same audit on yours.

20 rounds
of using Lemma's tools to build Lemma, and fixing what lied

validate_patch_sandbox approved every patch. surgical_ast_insert wrote broken files and said "Success". Both fixed, and a test now fails when a tool advertises an option it ignores.

1,200+ tests
plus evals that drive a real MCP client against a real server

Unit tests call handlers as functions and miss what an agent actually sees. The evals run the server over stdio and assert on the tool listing and the text of results.

What it does

Four jobs, done so the result is checkable.

Memory that checks itself

The Brain stores each answer next to the hash of the files it came from. Change the code and the memory turns STALE instead of being served as fact. You verify it, refresh it, or forget it. Nothing rots quietly.

search_memoryverify_memoryrefresh_memory

A context diet

A file you already read comes back as UNCHANGED. Command output is distilled and the full text stays recoverable. By default only about 35 of the 110 tool schemas are advertised; the rest wait behind lemma_toolbox.

read_workspace_fileoutput_regionlemma_toolbox

Safe to hand an agent

Secrets are masked in file reads and in command output. Commands run on an allowlist with a filtered environment and paths held inside the workspace. For real isolation, opt in to a Docker sandbox: no network, read-only root, and it refuses to run on your host if Docker is down.

scrub_privacyrun_workspace_command

Code intelligence, no LLM

Dependency graphs, coupling, entropy, dead exports, affected tests, and AST-level inserts and renames, computed locally with the TypeScript compiler. The model gets an answer, not a pile of files to read.

depgraphaffected_testssurgical_ast_insert
The Brain

Not a cache. A memory that knows when it's wrong.

A semantic cache serves an old answer when a new question looks similar. The Brain serves it only while the files behind it still match, and tells you when it does. Try it.

src/auth/jwt.ts
sha256 9f2c41e7
anchored to src/auth/jwt.ts · sha256 9f2c41e7
FRESH
How do we validate JWTs?
RS256 only, keys from JWKS, 60s clock skew.

The file still hashes the same as when this was stored. Safe to reuse.

Why this matters

  • Every hit is labeled: cache hit, near-miss, or STALE. You are never handed an old answer as new.
  • refresh_memory re-anchors a verified memory and keeps its id, hit count and links. Re-saving a copy would lose all three.
  • brain_upkeep audits the whole corpus: duplicates, dead weight, and what is stale.
Tools

110 tools. 60 are free.

Free is not a demo: the whole memory lifecycle is free, because a tier you can't export or correct isn't a tier where you own your memories. Pro adds the tools that write, run and refactor.

Where to start

search_memoryFree

Ranked recall. Every hit carries a freshness verdict.

Memory
verify_memoryFree

Re-hash a memory's evidence: FRESH, STALE or untracked.

Memory
refresh_memoryFree

Re-anchor a checked memory, keeping its id and links.

Memory
brain_statsFree

Reuse per writer, dead weight and integrity of the corpus.

Memory
token_receiptFree

The ledger. Honest when the answer is "nothing saved".

Memory
state_hash_cacheFree

Answers keyed on file hashes: exact invalidation, no guessing.

Memory
read_workspace_fileFree

Real line numbers, secrets masked, UNCHANGED on repeat reads.

Context
output_regionPro

Recover any part of output that was distilled away.

Context
smart_file_slicePro

Only the windows of a big file that match your question.

Context
scrub_privacyFree

Mask keys and PII before text leaves your machine.

Context
search_workspacePro

Code-first grep that respects .gitignore. Scope it with dirPath.

Workspace
run_workspace_commandPro

Allowlisted commands, filtered env, distilled output, optional Docker sandbox.

Workspace
apply_workspace_patchPro

Patch from a numbered read. A failed patch changes nothing. Keeps CRLF.

Workspace
surgical_ast_insertPro

Insert a method via the TS compiler. Refuses a patch that breaks syntax.

Workspace
validate_patch_sandboxPro

Typecheck a patch before it touches your files.

Workspace
refactorPro

Rename or move across the workspace; importers update with it.

Workspace
depgraphPro

Blast radius of any file, through barrels, require and import().

Analysis
affected_testsPro

Which tests to run, using the owning package's own runner.

Analysis
coupling_radarPro

Cycles, god modules and dead islands.

Analysis
entropy_scorePro

Complexity per file, worst offenders first.

Analysis
review_diffPro

Local review of a diff: regressions, security, breaking changes.

Review
review_prPro

Review a PR from GitHub, Azure DevOps or GitLab and post the findings as comments.

Review
jenkins_generate_pipelineFree

Jenkinsfile from your project, with every input validated.

Infrastructure
terraform_planFree

Plan, drift and state, from the same session.

Infrastructure

Every registered tool

110 of 110
  • affected_tests
  • apply_workspace_patch
  • ast_flow_visualizer
  • auto_context_bundle
  • auto_heal
  • batch_tool_calls
  • brain_export
  • brain_import
  • brain_merge
  • brain_stats
  • brain_team
  • brain_trash
  • brain_upkeep
  • bulk_file_digest
  • changelog_auto
  • cognitive_map
  • compress_context
  • conversation_checkpoint
  • coupling_radar
  • create_workspace_file
  • dead_export_necromancer
  • depgraph
  • diff_only
  • downvote_memory
  • entropy_score
  • env_snapshot
  • file_fingerprint
  • file_intent_index
  • forget_memory
  • generate_executive_roi_report
  • generate_pr_workflow
  • get_ast_hologram
  • get_memory
  • get_project_history
  • get_project_onboarding
  • get_routing_advice
  • get_symbol_surgical_context
  • get_telepathic_hints
  • git_blame_heat
  • git_heatmap_risk
  • import_tree_context
  • imports_skeleton_resolver
  • infra_analyze_monolith
  • infra_connect
  • infra_diagnose
  • infra_discover
  • infra_health_check
  • infra_status
  • infra_suggest_split
  • jenkins_build_status
  • jenkins_generate_pipeline
  • jenkins_logs
  • jenkins_trigger_build
  • lemma_toolbox
  • list_memories
  • list_workspace_dir
  • local_semantic_autofix
  • migration_tracer
  • multi_file_patch
  • okd_apply
  • okd_describe
  • okd_events
  • okd_generate_manifests
  • okd_logs
  • okd_route_url
  • okd_status
  • output_region
  • pattern_fossil
  • pr_status
  • precrime_static
  • prompt_pattern_cache
  • prune_conversation_history
  • query_hybrid_consensus
  • read_token_budgeted
  • read_workspace_file
  • refactor
  • refresh_memory
  • repeat_guard
  • review_diff
  • review_pr
  • run_workspace_command
  • schema_extract
  • scrub_privacy
  • search_memory
  • search_workspace
  • semantic_dedup_guard
  • semantic_grep
  • smart_file_slice
  • smarter_cache
  • spec_to_stub
  • squeeze_prompt
  • state_hash_cache
  • store_memory
  • summarize_long_text
  • surgical_ast_insert
  • terraform_apply
  • terraform_drift
  • terraform_plan
  • terraform_state_list
  • test_autofix_interceptor
  • test_oracle
  • token_budget
  • token_receipt
  • turbosqueeze
  • type_coverage_report
  • update_memory
  • validate_patch_sandbox
  • verify_memory
  • wormhole_squeeze
  • write_workspace_file
Pricing

Free keeps your memory. Pro gets things done.

$5 a month, locked for as long as you stay subscribed.

Free
$0forever

60 tools, open-core, MIT.

  • The whole Brain lifecycle: store, search, verify, refresh, forget, export
  • token_receipt and brain_stats: the audit trail
  • read_workspace_file with secret masking, scrub_privacy
  • Token budgeting and prompt squeezing
  • All 22 infrastructure tools: Jenkins, OKD, Terraform
  • Share verified memories with your team through your own repo
Install free

No account, no card.

Early-bird price
Pro
$5/ month

Everything in Free, plus 50 tools.

  • Write and patch: apply_workspace_patch, surgical_ast_insert, multi_file_patch
  • run_workspace_command, with the opt-in Docker sandbox
  • search_workspace, smart_file_slice, get_ast_hologram
  • Static analysis: depgraph, coupling, entropy, dead exports, affected_tests
  • Refactor across the workspace
  • PR review, auto_heal and CI workflow generation

7-day free trial · cancel anytime · keep Free forever

Need managed private infrastructure? Talk to us about Enterprise

Hosted team memory (Cloud) isn't generally available yet. Join the waitlist

Install

One command, then ask normally.

No proxy, no baseURL change. Your agent talks to Lemma over MCP.

1 · Connect your agent
Run once per project.
claude mcp add lemma -- npx -y @nxuss/lemma mcp

After upgrading, reconnect the server (Claude Code: /mcp) so the running process loads the new build.

2 · Activate Pro (optional)
lemma activate YOUR_LICENSE_KEY

Free works without a key. Pro unlocks the other 50 tools.

3 · Just ask

No new syntax. Ask "what breaks if I change engine.ts?" and your agent calls depgraph. Ask "have we solved this before?" and it calls search_memory.

FAQ

Fair questions.

Sometimes a lot, sometimes nothing, and token_receipt tells you which. It books Lemma's own overhead first and prints NET COST when a session doesn't pay for itself. We don't publish a savings percentage, because it depends on how your agent works. Measure your own first week.

Run it for a week. Read the receipt.

If it doesn't pay for itself, it says so. That's the point.

Install Lemma

Want hosted team memory?

Cloud sync is in development. Leave your email and we'll write when it opens.