jambavan
Jambavan is a Model Context Protocol (MCP) server that gives AI coding models live codebase awareness, durable memory, and surgical editing tools — without making any external LLM calls.
Session Initialization (jambavan_awaken): Bootstrap a session by loading the operating protocol and recent project memories in one call.
Code Indexing & Context (jambavan_index, jambavan_watch, jambavan_context, jambavan_diagnostics): Build and incrementally update an AST-aware SQLite index using tree-sitter parsers. Retrieve ranked, token-budgeted snippets relevant to a query (~44–87% fewer tokens than reading full files). Watch files for incremental re-indexing.
Code Graph (jambavan_graph_report, jambavan_graph_query, jambavan_graph_path): Build a lightweight inferred graph of callers, callees, imports, and mentions. Query for neighbors via BFS or find the shortest path between two symbols.
Durable Memory (jambavan_memory_store/search/recall/mine_session/invalidate/delete/status): Store decisions and facts as human-readable markdown with YAML frontmatter. BM25 full-text search, session transcript mining, and memory invalidation — no external database or embeddings needed.
Token Compression (jambavan_sankshipta): Deterministically compress prose/prompts while preserving code, paths, and versions verbatim. Can write back in-place with a backup.
Efficient-Dev Discipline (jambavan_vibhishana_niti, jambavan_rin_mochan): Activate YAGNI-first, minimal-diff coding rules at configurable intensity levels (lite/full/ultra). Audit // rin: technical debt markers into a structured ledger.
File & Shell Tools (read_file, search, list_files, write_file, patch_file, bash): Read files (with optional line ranges), regex search via ripgrep, and list directories — always available, confined to the project root. Write/patch files and run sandboxed shell commands are opt-in via JAMBAVAN_ALLOW_WRITE=1 and JAMBAVAN_ALLOW_BASH=1. Secret-looking files (.env, *.pem, etc.) are blocked by default.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jambavan awaken and load project memories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Jambavan is a local-first Model Context Protocol server. It gives coding agents persistent, repository-aware context: an AST-backed symbol index, durable project decisions, a ledger of dead ends already tried, and branch review context.
No LLM calls. No telemetry. No code upload. Source-mutating and shell tools are off unless you turn them on.
60-second quick start
claude mcp add jambavan -- npx -y jambavanRestart or reload the MCP host after registration. Then call the active MCP server in this order:
jambavan_doctor {}If it reports source: cwd-fallback, bind the repository and awaken in one call:
jambavan_awaken { "root": "/absolute/path/to/repository" }Otherwise awaken without a root:
jambavan_awaken {}After either awaken call, index, watch, and request useful context:
jambavan_index {}
jambavan_watch { "action": "start" }
jambavan_context { "query": "buildReviewPack" }The root-bearing jambavan_awaken call already performs the awaken step, so do not call it twice. A tool-input root can later be re-pointed to another repository inside the original fallback directory; roots fixed by JAMBAVAN_ROOT, MCP roots/list, or a project cwd cannot be re-pointed.
jambavan_doctor above inspects the active MCP process, including its resolved root, tool count, loaded index, and watcher. npx jambavan doctor is a separate, short-lived shell process: it is useful for launch-environment and parser checks, but it cannot report the active MCP server's in-memory index or watcher.
Related MCP server: reflens
Supported hosts and languages
Jambavan uses stdio MCP, so the same npx -y jambavan command works with any compatible host. Documented setup paths are:
Host | Registration |
Claude Code |
|
Codex CLI |
|
Cursor |
|
Continue |
|
Other stdio MCP clients | command |
The index supports TypeScript, TSX, JavaScript, JSX, Python, Go, Rust, and Java. Supported extensions are .ts, .tsx, .mts, .cts, .js, .jsx, .mjs, .py, .go, .rs, and .java.
Measured, not claimed
This historical aggregate was produced with Jambavan v2.0.0 against react/react at commit 9ceb1e7: 4,615 files, 20,595 symbols, Node 24 on macOS arm64.
Result | |
Context tokens vs reading every matching file | 9,207 instead of 261,816 — 96% less |
Cold index | 8.5 s (552 files/s) |
Unchanged re-index | 1.2 s (7.2x faster) |
Context retrieval | 1.2–3.6 ms per query |
Tool schema your host pays for every request | 20 tools, 3,423 tokens (down from 38 tools / 5,680 in 1.x) |
Re-run the same pinned methodology from a clean temporary directory:
WORKDIR="$(mktemp -d)"
git clone --branch v2.0.0 --depth 1 https://github.com/beingmartinbmc/jambavan.git "$WORKDIR/jambavan"
git init "$WORKDIR/react"
git -C "$WORKDIR/react" remote add origin https://github.com/react/react.git
git -C "$WORKDIR/react" fetch --depth 1 origin 9ceb1e7
git -C "$WORKDIR/react" checkout --detach FETCH_HEAD
cd "$WORKDIR/jambavan"
npm ci
npm run build
JAMBAVAN_ROOT="$WORKDIR/react" node dist/benchmark.jsThis re-runs the code and inputs; it does not recreate the original machine or timing conditions, so exact timings can differ. The historical aggregate says five auto-derived queries, but only four per-query rows survive in the React proof card. Those four rows do not sum to the aggregate, and the missing raw row is not reconstructed. The surviving rows still show the non-uniform result: one saved 99%, another only 42% because its matches lived in tiny fixture files. This is a retrieval benchmark; it measures token cost and latency, not task correctness.
Why it exists
Without an index or saved memory, rediscovering a project costs work proportional to the area searched: O(n) files opened, every session, forever. Jambavan persists that work. Index refresh still discovers and hashes candidate files in O(n files), but reparses only files whose content changed.
In the Ramayana, before Hanuman's leap to Lanka, Jambavan reminds him of the strength he already possesses. This project borrows that metaphor narrowly: it restores access to knowledge that was already indexed or stored. It does not make a model smarter.
The remaining Sanskrit names are descriptive: mool kaaran means root cause, praman means evidence, yukti means strategy, vibhaajan means decomposition, Vibhishana Niti means disciplined counsel or rules, rin mochan means debt release, and sankshipta means concise or compressed.
Install
The installers attempt to register Jambavan only for hosts they can detect. Claude Code and Codex use their CLIs; Cursor requires an existing ~/.cursor directory and valid JSON if the config already exists. Continue requires an existing ~/.continue directory; the installer creates config.yaml only when it is absent and otherwise prints an entry for you to merge. A detected host can still reject registration, so review the installer result.
On macOS, Linux, WSL, or Git Bash:
curl -fsSL https://raw.githubusercontent.com/beingmartinbmc/jambavan/main/install.sh | bashOn Windows, in PowerShell 5.1+:
irm https://raw.githubusercontent.com/beingmartinbmc/jambavan/main/install.ps1 | iexNeeds Node >=20.19.0 <27. The scripts are designed to skip undetected hosts and preserve unrelated MCP entries, but registration remains conditional on each host and existing config being usable. As with any internet shell script, read it before piping it into a shell.
Manual registration
Same MCP command everywhere: npx -y jambavan.
Host | Setup |
Claude Code |
|
Codex CLI |
|
Cursor | add to |
Continue | add to |
Any MCP client | command: |
Cursor (~/.cursor/mcp.json global, or .cursor/mcp.json per project)
{
"mcpServers": {
"jambavan": { "command": "npx", "args": ["-y", "jambavan"] }
}
}Continue (~/.continue/config.yaml)
name: Local config
version: 1.0.0
schema: v1
mcpServers:
- name: Jambavan
command: npx
args:
- -y
- jambavanRestart or reload the host after any config change, then follow the 60-second quick start, beginning with the MCP jambavan_doctor. Continue exposes MCP tools only in Agent mode.
Check installed and published versions:
npx jambavan --version
npm view jambavan versionTo uninstall, run claude mcp remove jambavan or codex mcp remove jambavan; for Cursor and Continue, delete the jambavan entry. Repository indexes under <repo>/.jambavan/ and memory/failure documents under ~/.jambavan/memory/ are left intact.
The tools
Jambavan advertises 20 tools by default. JAMBAVAN_ALLOW_WRITE=1 adds write_file, patch_file, and jambavan_compress_prompt for 23; JAMBAVAN_ALLOW_BASH=1 adds bash for 21; enabling both advertises up to 24. Every advertised tool costs your host model tokens on every request whether or not it is called, so the default surface stays small.
Group | Tools | What the agent gets |
Sight |
| AST-backed symbol index, token-budgeted context with bounded extracted call neighbors, optional heuristic test references and recent diff, live watching, and root health. |
Bridge |
| Code-graph report, query, and shortest path in one tool, plus changed-symbol inbound impact and heuristic test-file associations. |
Memory |
| Rootless local Markdown memory, logical collections, and explicit read-only MemPalace federation. |
Failure memory |
| Structured failure records plus an exact-command repeat guard in the opt-in |
Review |
| Bounded branch review context: touched symbols, extracted caller candidates, heuristic test references, |
Debt |
| Harvests every deliberate-shortcut |
Compression |
| Deterministic prose shortening with protected spans for code, URLs, paths, versions, and env vars. Write-gated. |
Awakening |
| Session protocol: what exists, when to use it, and this project's recent memories. |
Hands |
| Guarded project-root file, search, and shell tools. Mutating and shell tools are disabled unless enabled. |
Prompts
The discipline protocols are static text with no repository access, so they ship as MCP prompts rather than tools — they cost nothing per request and appear as slash commands in hosts that support them.
Prompt | Use it |
| Before debugging. Enforces observe → compare → hypothesize → fix; escalates at 3+ failed attempts. |
| Before claiming tests pass, a build succeeds, or a bug is fixed. Demands fresh evidence. |
| Before multi-step work. Scales the plan to task size. |
| When sub-units are genuinely independent. |
| Vibhishana Niti: YAGNI first, stdlib before dependencies, shortest working diff. |
Recommended workflow
Restart or reload the host after registration or config changes.
jambavan_doctor {}to inspect the active MCP root, gates, storage, index, and watcher.If the source is
cwd-fallback, calljambavan_awaken { "root": "/absolute/path/to/repository" }; otherwise calljambavan_awaken {}.jambavan_index {}thenjambavan_watch { "action": "start" }.jambavan_context { "query": "<identifier or focused question>" }before touching unfamiliar code.root_cause/verify_gate/strategy_planwhen debugging, claiming completion, or planning.Run the smallest relevant check.
jambavan_memory_store { "title": "...", "body": "...", "collection": "decisions" }to persist durable context.jambavan_failure_storeto record dead ends with root cause and do-not-retry advice.jambavan_session_handoff {}to hand off; passtextto import one back.
What the output looks like
jambavan_context returns focused spans instead of whole files. This is an illustrative output shape, not captured output from the current repository:
# Jambavan Context: "review pack"
Symbols: 12 included, 18 dropped (budget: 8000 tokens)
## src/tools/review-pack.ts: buildReviewPack
kind: function · score: 0.92
Uses git diff to list touched files, maps symbols from the index, adds callers via graph,
heuristic test references via test-map, and risk flags for rin debt / missing tests / failures.jambavan_review_pack { "base": "main" } turns a branch into reviewer-oriented context. This example is illustrative:
# Jambavan Review Pack
Base: main
Touched files: src/mcp/server.ts, src/mcp/tool-aliases.ts
src/mcp/server.ts
- touched symbols: startServer, handleToolCall
- callers: dist/index.js -> startServer
- heuristic test references: test/tool-aliases.test.ts
- risk flags: write-gated tool alias; verify disabled-tool listingjambavan_failure_search { "query": "timeout" } surfaces a prior dead end before another retry. This example is illustrative:
FailureRecord: flaky auth test timeout
Root cause: unawaited promise in token refresh mock.
Do not retry: increasing the test timeout; it hid the race.
Next check: run the focused auth test with fake timers enabled.Privacy and safety
Code indexes and caches stay in the active repository's .jambavan/; memory and failure documents live in ~/.jambavan/memory by default. Both generated-state roots get a nested .gitignore with *. These operational writes still happen when source mutation is disabled.
Source-mutating and shell tools are not advertised unless you opt in:
Tool(s) | Enable with |
|
|
|
|
Direct path arguments to file, search, and list tools, plus the bash working directory, are confined to JAMBAVAN_ROOT or the detected project root. The same guard refuses known secret-file basenames, extensions, and immediate parent directories unless JAMBAVAN_ALLOW_SECRETS=1. This is a direct-path guard, not content scanning, and it does not stop an enabled shell command from reading files.
bash uses a minimal no-color environment and blocks a few obvious footguns such as rm -rf /, git reset --hard, git clean -fx, and blind curl | sh. It redacts and stores failed-command records locally; once the same unresolved command fails unchanged again, a do-not-retry record can block another exact retry unless retry_known_failure=true. These checks are not a security boundary. Treat the tool like a local shell and sandbox the workspace if you need isolation.
MemPalace is never contacted during ordinary recall, context enrichment, or awakening — only when a memory read explicitly sets provider. See memory docs.
Configuration
Env var | Default | Description |
| auto-detect | Project root to index and serve |
| Git-derived | Validated clone-independent scope override |
|
| Override for the root-independent OKF archive |
|
| Executable for explicit read-only MemPalace calls |
|
| Max approximate |
|
| Default |
| off | Registers |
| off | Registers |
| off | Disables direct-path project-root containment |
| off | Allows direct paths matching the secret-file guard |
| off | Passes full host env to |
|
| Global cap on tool output |
|
| Max file size |
Upgrading from 1.x
2.0 renamed the Sanskrit tool names to English and merged near-duplicate tools, cutting the advertised surface from 38 tools to 20 and the tools/list schema your host pays for on every request from 5,680 tokens to 3,423. Every old name still works — retired names are resolved internally, they are just no longer advertised, and tool-check fails the build if any of them stops dispatching.
Was | Now |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Claude Code plugin
This repo is also a Claude Code plugin marketplace:
/plugin marketplace add beingmartinbmc/jambavan
/plugin install jambavan@jambavanDocumentation
Host setup: Claude Code · Cursor · Codex CLI · Continue
Contributing
Read CONTRIBUTING.md before proposing a change. Use the issue forms for bugs and focused feature requests, and report vulnerabilities privately through SECURITY.md.
npm run docs-check && npm run lint && npm test && npm run coverageAvailable Tools
20 toolsjambavan_awakenA
Return the Jambavan operating protocol: recall memory, index/watch code, retrieve context before edits, patch surgically, run checks, and store durable decisions. Call once at the start of every host session. Includes recent project memories by default.
Inputs: root, include_memories.
jambavan_contextA
Search the Jambavan index for code symbols and snippets most relevant to a query. Returns a ranked, token-budgeted context block of matching functions, classes, and types. Inject this block into your prompt to give the model precise, token-efficient codebase knowledge. Much cheaper than reading whole files — only the relevant symbol bodies are returned. Automatically includes top project-memory matches and a bounded set of extracted callers/callees under the same token budget. Options: compress_prose shrinks comments for extra budget; include_diff adds recent git changes; include_tests shows heuristic test associations/references, not execution coverage.
Inputs: query (required), limit, include_diff, include_tests, +1 more.
jambavan_debt_ledgerA
Harvest every rin marker (lines marked with a ceiling and upgrade path) from the project into a debt ledger. Groups findings by file and flags any marker with no upgrade trigger — those are the ones that silently rot. Read-only. Call before a release or refactor sprint.
Inputs: no named parameters.
jambavan_doctorA
One-shot environment health check: root detection source, tree-sitter vs regex parser backends, write/bash tool gates, token budget, memory dir writability, .gitignore/CI presence, and index/watcher status. Call this first when something feels off (e.g. context results look like the wrong project) — it catches the most common cause: the MCP host resolving the wrong project root.
Inputs: issue_report.
jambavan_failure_searchA
Search past failure records for a command, error, or symptom. Call BEFORE retrying a failing command to check if it was already diagnosed. Returns structured failure records with status and resolution info.
Inputs: query (required), limit, scope.
jambavan_failure_storeA
Store a structured failure record in the memory palace. Use after a command/approach fails to prevent repeating the same mistake in future sessions. Stores: command, symptom, attempted fix, root cause, resolution, status, and advice on what NOT to retry.
Inputs: command (required), symptom (required), scope, status, +5 more.
jambavan_graphA
Navigate the code graph built from the current index. Call jambavan_index first. action=report lists hub nodes and edge-confidence notes; action=query finds matching nodes and their BFS neighbors; action=path finds the shortest route between two symbols. Action is inferred from the arguments when omitted. Ambiguous same-name edges are excluded unless include_inferred=true.
Inputs: to, from, query, action, +5 more.
jambavan_impactA
Analyze changed symbols against inbound extracted graph edges and test associations/references. Reports bounded transitive callers, test associations/references, and explicit graph incompleteness. Use before a risky refactor or PR review; call jambavan_index first.
Inputs: base, max_depth, include_worktree.
jambavan_indexA
Build or refresh the Jambavan codebase index. Parses source files with a tree-sitter AST extractor and stores symbols in a local SQLite database. Run once per project, then incrementally on file changes. Returns indexing statistics (files processed, symbols extracted, duration).
Inputs: root.
jambavan_memory_forgetA
Retire a memory. mode=invalidate (the default) marks it superseded but keeps the document for temporal history; mode=delete permanently removes it. Provide id for one memory, or scope with delete_scope: true to wipe a scope.
Inputs: id, mode, scope, reason, +1 more.
jambavan_memory_mine_sessionA
Mine durable facts, decisions, TODOs, and constraints from a pasted session transcript or log. Stores each extracted item as an OKF memory in the requested scope. This is deterministic text mining — no summarization or external service.
Inputs: text (required), scope, source, collection.
jambavan_memory_readA
Read stored memories. Pass id to fetch one document, query to BM25-search, or neither to recall the most recent. Set provider=mempalace for explicit read-only MemPalace access, or provider=all for separate provider sections; ordinary reads never start MemPalace. Jambavan scope/collection map to MemPalace wing/room.
Inputs: id, limit, query, scope, +2 more.
jambavan_memory_statusA
Show active Jambavan counts by scope and collection by default. Set provider=mempalace or provider=all to explicitly include read-only MemPalace status and taxonomy.
Inputs: provider.
jambavan_memory_storeA
Persist a memory as an Open Knowledge Format (OKF) concept document. Memories are markdown files with YAML frontmatter — human-readable and portable. Each memory has a title, body (markdown), optional tags, and a scope (e.g. project name). Memories with the same title in the same scope are overwritten (idempotent). Returns the OKF concept ID (scope/slug) of the stored document.
Inputs: body (required), title (required), tags, type, +5 more.
jambavan_review_packA
Assemble a review pack for the current branch vs a base branch: touched files, the symbols changed or deleted in them, their callers (via the knowledge graph), related test associations/references, past failure records mentioning the same files, and risk flags (open rin debt, no matching test association). Call before opening/updating a PR, or whenever asked "what changed" / "review this branch". Requires jambavan_index to have been run at least once for symbol/caller/test/risk analysis.
Inputs: base, max_files, include_worktree.
jambavan_session_handoffA
Move session context between sessions, hosts, or people as one self-contained markdown document containing recent memories, rin debt markers, and git status. Omit text to export; pass text to import it back (idempotent — re-importing creates no duplicates).
Inputs: text, scope, share_safe, include_git, +2 more.
jambavan_watchA
Control the live file watcher that keeps the index in sync as you edit code. Actions: "start" — begin watching (index must exist first); "stop" — stop watching; "status" — show watcher state. While running, supported non-ignored source-file changes trigger incremental re-indexing (no full rescan). Use "start" after jambavan_index, then forget about it — the index stays fresh automatically.
Inputs: action (required).
list_filesA
List project files in a directory. Paths are confined to the project root unless JAMBAVAN_ALLOW_OUTSIDE_ROOT=1.
Inputs: path, pattern, recursive.
read_fileA
Read the contents of a project file. Paths are confined to the project root unless JAMBAVAN_ALLOW_OUTSIDE_ROOT=1.
Inputs: path (required), end_line, start_line.
searchA
Search project files using ripgrep, with grep fallback. Fast regex search. Paths are confined to the project root unless JAMBAVAN_ALLOW_OUTSIDE_ROOT=1.
Inputs: pattern (required), path, max_results, file_pattern, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have clearly distinct purposes: file access, indexing, memory, failures, and review functions are separated. The main ambiguity is among jambavan_context, jambavan_graph, jambavan_impact, and jambavan_review_pack, which all touch code relationships, but their descriptions are specific enough to guide selection.
The majority of tools follow a consistent jambavan_<action> pattern with snake_case, making the naming predictable. However, list_files, read_file, and search break the prefix convention, and a few names like jambavan_review_pack and jambavan_session_handoff are more noun-like than verb-focused.
At 20 tools, the server sits at the heavy end of the range. The count is defensible given the broad scope of indexing, memory, failures, review, and project navigation, but it feels slightly more than strictly necessary and borders on overwhelming.
The tool surface covers the full memory lifecycle (store/read/mine/forget/status), failure diagnosis (store/search), code indexing and navigation, and branch review preparation. Minor gaps exist such as no direct tool for updating/deleting failure records or explicit index destruction, but these do not create severe dead ends.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
An MCP memory server. One memory your agents share — across models, devices and apps.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server that gives AI coding assistants persistent memory, structural code graph analysis, and safe multi-agent coordination, enabling them to answer architectural questions, track decisions across sessions, and coordinate safely in multi-agent workflows.394MIT
- AlicenseAqualityDmaintenanceAn MCP server that indexes reference repositories and provides tools for AI coding agents to retrieve lossless code context, enabling reasoning over codebases larger than the agent's context window.82Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server for code intelligence that maps source code into a knowledge graph, enabling AI tools to understand architecture and structure rather than just individual files.8MIT
- AlicenseAqualityBmaintenanceAn MCP server that indexes a repository locally and provides keyword, semantic, hybrid, and SQL search tools, enabling coding agents to answer questions about the codebase efficiently without reading files one by one.385 npm31Apache 2.0