Skip to main content
Glama
Infinite Code Next

Infinite Code Next

by Kawai-Senpai

A zero-config MCP server that gives AI coding agents persistent, verifiable memory of a codebase — the decisions behind it, what was already tried and rejected, and what must never break — anchored to the code and carried with it as the code moves.

tests python mcp no llm

Quick start · Agent setup · Explorer · Sharing · For agents · How it works · Brand


Git blame tells you who changed a line. This tells an agent why the code exists, what was already tried and rejected, and what must stay true — and it knows when its own knowledge has gone stale.


The problem

Every session, an AI agent arrives with no memory. It reads files to re-derive what the last agent already knew. Then it re-proposes the fix that was rejected three months ago, because nothing in the repository records that it was tried.

The expensive knowledge is never in the code:

The code says

It never says

stdin=subprocess.DEVNULL

why — that git inherits the MCP pipe and stalls every call for 20s

if touched:

that or None here means "resolve everything" and costs minutes

A coordinator class

that a Redis mutex was tried first and deadlocks on partition

This server stores that layer, keeps it attached to the code, and tells you when it can no longer vouch for it.


Related MCP server: lore

Quick start

pip install -e .

Register once with your MCP client — there is no second step. No admin panel, no port, no daemon, no per-repository setup.

claude mcp add icn -- infinite-code-next
[mcp_servers.icn]
command = 'infinite-code-next'
args = []
{ "mcpServers": { "icn": { "command": "infinite-code-next" } } }

The server works out which repository it is in from its working directory, and every response echoes the root it resolved, so a wrong workspace is obvious immediately.

Verify the complete client setup, including a real stdio handshake, tool discovery, repository open, and parser/index health:

icn doctor --client codex --root /path/to/repository

If the client was already running when ICN was installed or configured, restart it after the doctor reports READY so its deferred tool catalogue is refreshed.

Opt-in updates on restart

With Git and uv installed, add --auto-update to your existing MCP command to follow this project's GitHub main branch.

[mcp_servers.icn]
command = "infinite-code-next"
args = ["--auto-update"]

The installed launcher serves the first session and checks for a newer commit in the background. It installs and checks a commit-pinned environment under ICN's cache/update-envs/ using the launcher's store schema. A later MCP restart runs that environment directly, including offline. If it is unavailable, the installed server can still launch. A schema-changing update requires a newer installed launcher. Set UV_OFFLINE=1 to skip the update check and use the cache. Add --preview or --semantic to the arguments to include those optional features in the cached environment. Remove --auto-update to use the installed version on every restart.

The loop

workspace(action="open")          →  a briefing: rules, prior failures, what is unverified
investigate("what you're doing")  →  code + rationale + blast radius, budgeted
        ... do the work ...
record(summary=..., warnings=[...], failed_attempts=[...])

Two calls to get productive. One to leave the next agent smarter.


The knowledge explorer

Everything the server knows — repository, files, symbols, memories, and every edge between them — as one interactive graph.

./explore.sh          # macOS / Linux
explore.bat           # Windows
icn-explore           # if the package is on your PATH

Above: the export menu open over the full graph.

Filter

by node type, memory severity, anchor status, or edge kind — counts update live

Search

any node by name, path, or the text of its body

Inspect

click a node for its full body, metadata, and every typed connection

Navigate

click any connection to jump there — walk from a warning to the code it guards to the test that covers it

Zoom & pan

scroll and drag; node size is call-degree, so load-bearing code looks load-bearing

Export

markdown, graph JSON, the page itself, a PNG, or just what is currently on screen

Self-contained: one HTML file with the data inlined. No CDN, no build step, no npm. Save it, email it, commit it — it still works.

icn-explore --no-serve -o graph.html    # just write the file
icn-explore --port 8080                 # pick the port
icn-explore --include-deleted           # include tombstoned code

Sharing knowledge

Hand another codebase's hard-won knowledge to someone else — or to another agent.

From the explorer

The Export button offers everything below without leaving the page. It all runs offline in the browser against the embedded graph — no server call, so a saved page still exports.

Markdown

readable anywhere, and re-importable

Graph JSON

nodes and edges, raw

This page

the self-contained explorer, to send to someone

Image

PNG of the current view

Copy visible

only what is on screen — filter and search first, and the filtered view becomes a shareable subset

From the CLI

icn-explore export -o knowledge.md      # readable markdown, renders anywhere
icn-explore export -o knowledge.icn     # bundle: markdown + graph
icn-explore export -o graph.json        # raw graph

The markdown is the canonical shareable form, and it is readable on its own — in an editor, in a diff, on a wiki, in a pull request. A knowledge base nobody can read without the tool is a knowledge base nobody checks. A JSON block at the end makes the import lossless.

icn-explore import knowledge.icn        # bring it in
icn-explore import ./team-knowledge/    # a whole directory of .md / .icn
icn-explore import shared.md --preview  # look first, import nothing

Import never overwrites. Everything from outside is stored as authority='imported' with its origin attached, and anchored only where a matching symbol actually exists here. A memory about code you do not have is still worth keeping — but it must not claim to describe a span it never saw.


Guide for AI agents

Read this section before your first call.

1. Open first — do not read files to orient yourself

workspace(action="open")

Returns a briefing: the rules that govern this code, what has already been tried and rejected, what is currently unverified, and where knowledge is concentrated. Headlines and ids only — bodies stay out, investigate() is one call away.

This exists because of a measured failure. Every session building this server began by reading files to re-derive knowledge that already existed. open used to report symbol counts, which tells you nothing about what you are walking into. You cannot ask the right question before you know what is on the shelf.

2. Investigate, then check the source

investigate("I need to change refresh token rotation. What will I break?")

Include a qualified symbol, path, config key, or exact error text when you have one. Broad queries return ranked leads. If the top results miss the question, check index_state, then use repository search to find concrete identifiers. For example, if "repository map token budget" returns unrelated hits, look for max_map_tokens in the source and use that name in a follow-up investigation. Read the relevant implementation and tests before relying on a result. A partial index can omit files, so use source search or retry when it is ready.

For one bounded investigation across several repositories, pass their roots explicitly. This does not require pre-existing contract edges:

investigate(
    query="change the trip-notification event contract",
    roots=["/work/accounting-service", "/work/be-nf-service", "/work/be-service"],
    intent="modify",
)

cross_repos=True remains the provenance-aware mode that follows recorded contracts. roots=[...] is the explicit search scope for repositories that have not yet had those contracts recorded.

Ground broad searches with a repository glossary

Add a reviewed .icn-concepts.json at the repository root. A concept connects phrases people use to the source symbols that implement them. Review each target in the code, then generate its path, qualified name, and fingerprint:

icn concept-anchor src/icn/update.py prepare

Put the command's output in the concept's targets array:

{
  "concepts": [
    {
      "name": "Offline updates",
      "aliases": [
        "restart updates",
        {
          "phrase": "background download",
          "requires_any": ["update", "updates", "release", "wheel", "next launch", "next restart"]
        }
      ],
      "targets": [
        {
          "path": "src/icn/update.py",
          "symbol": "prepare",
          "fingerprint": "<fingerprint from concept-anchor>"
        }
      ]
    }
  ]
}

Use forward slashes in repository-relative paths. Names and aliases match whole phrases of at least two words, with case and punctuation normalized. Use requires_any for an alias shared by unrelated parts of a project. ICN matches that alias only when the query contains at least one of its context phrases, which can be a single word. Code review is the review step for changes to the glossary.

investigate() returns phrase matches, source locations, and target status in grounding. A target contributes to ranking only when it resolves uniquely and its indexed fingerprint matches. A changed fingerprint calls for source review and a fresh anchor. Shared phrases are reported as ambiguous. An incomplete index can report phrase matches while withholding their ranking boost. unmapped_terms describes glossary coverage. Code search may still find answers for those terms. When grounding does not affect ranking, code and memory results get first use of the response budget.

Use investigate(..., use_concepts=False) to compare results with ordinary retrieval. A uniquely indexed qualified symbol entered on its own takes precedence over glossary matches.

Paste a source reference such as src/icn/search.py:344 or a stack-frame location with a column to find the most specific indexed symbol on that line. For a question that names an exact file, glossary matches can boost reviewed targets inside that file.

Installing an MCP server does not guarantee an agent will proactively use it. Add the following short instruction to the agent's global instruction file. Keep it short: the MCP tool descriptions teach the detailed workflow after the first call.

Codex (~/.codex/AGENTS.md)

## Infinite Code Next (ICN)
- For any task involving an existing codebase, use ICN. At the beginning of a session and whenever you switch repositories, discover deferred tools if necessary and call `mcp__icn__workspace(action="open", root=<repo>)`.
- Before investigating, diagnosing, designing, or modifying code, call `mcp__icn__investigate(query=<task>, intent=<intent>, root=<repo>)`. Treat memories whose anchor status is not `ACTIVE` as unverified leads.
- Include known symbol names, paths, configuration keys, or exact error text. Treat broad results as leads. If the results are weak or the index is partial, search the repository directly and read the source and tests before drawing conclusions.
- After verified findings or changes, call `mcp__icn__record` with the decision, failure prevented, affected files/symbols, invariants, warnings, failed attempts, contracts, and tests. Skip investigation and recording only for purely mechanical actions such as correcting a typo or running an explicitly requested command.
- Checkpoint your own work with `mcp__icn__agit(action="commit", message=...)` before risky edits or broad refactors, and roll back with `mcp__icn__agit(action="restore", paths=[...])`. It commits to `.agit/`, never the user's `.git`, so it is not a substitute for asking before a real commit.
- If `mcp__icn__*` is not visible, search the available/deferred tool catalogue and load it. If it still cannot be loaded, explicitly report that ICN is unavailable and continue with the best evidence. Never silently skip ICN or claim it was used when it was not.

Claude Code (~/.claude/CLAUDE.md)

## Infinite Code Next (ICN)
- For any task involving an existing codebase, use ICN. At the beginning of a session and whenever you switch repositories, ensure the `icn` MCP server and its tools are loaded and call `workspace(action="open", root=<repo>)`.
- Before investigating, diagnosing, designing, or modifying code, call `investigate(query=<task>, intent=<intent>, root=<repo>)`. Treat memories whose anchor status is not `ACTIVE` as unverified leads.
- Include known symbol names, paths, configuration keys, or exact error text. Treat broad results as leads. If the results are weak or the index is partial, search the repository directly and read the source and tests before drawing conclusions.
- After verified findings or changes, call `record` with the decision, failure prevented, affected files/symbols, invariants, warnings, failed attempts, contracts, and tests. Skip investigation and recording only for purely mechanical actions such as correcting a typo or running an explicitly requested command.
- Checkpoint your own work with `agit(action="commit", message=...)` before risky edits or broad refactors, and roll back with `agit(action="restore", paths=[...])`. It commits to `.agit/`, never the user's `.git`, so it is not a substitute for asking before a real commit.
- If ICN is not loaded, try to reconnect or load the configured `icn` MCP server. If it remains unavailable, explicitly report that fact and continue with the best evidence. Never silently skip ICN or claim it was used when it was not.

For repository-local enforcement, place the same block in that repository's AGENTS.md or CLAUDE.md. Global instructions are preferable when ICN should be used across every repository.

Approve the read-only tools once

An instruction that tells the agent to call ICN constantly only works if calling it is cheap. If the client prompts for approval on every call, the agent waits on a human to answer each question it asks, and it will drift back to grepping instead. Pre-approve the tools that only read:

{
  "permissions": {
    "allow": [
      "mcp__icn__workspace",
      "mcp__icn__investigate",
      "mcp__icn__graph",
      "mcp__icn__memory",
      "mcp__icn__paper",
      "mcp__icn__conversations",
      "mcp__icn__record"
    ]
  }
}

That is .claude/settings.json for Claude Code; Codex, Cursor and Windsurf each expose the same idea in their own MCP settings. record writes only to ICN's knowledge store, so it belongs on the list. So does conversations: it only ever reads the other agents' transcript stores and writes to ICN's own index and archive. agit does not: it commits to .agit/ and should keep prompting. Neither does experiment: it runs shell commands.

Note that an unapproved call is not a slow call, it is a call that has not run yet. If ICN seems to hang, look for a pending approval prompt first.

See Agent setup and required instructions for the full installation, verification, and copy-paste setup process.

One call fuses lexical search, symbol lookup, code-graph traversal, memory-graph traversal, anchor status and git history, and returns compact capsules under a token budget. It searches code and knowledge together, so a warning finds you even when you never named the file it lives in.

Argument

Use it for

intent=

locate, understand, modify, debug, audit — inferred if omitted

budget=

approximate token ceiling (default 9000)

cross_repos=True

follow contracts into other repositories

conversations=False

skip the transcript index; by default the result carries what past sessions from any agent said about the same terms in this repository

find_problems=

targeted diagnostics over the narrowed subgraph

3. Before deleting anything load-bearing, ask why

investigate(action="why", symbol="RefreshCoordinator.acquire")
decision: Use refresh-token rotation
  --was followed by--> bug_history: Parallel refresh requests invalidate each other
  --was followed by--> failed_attempt: Redis mutex could deadlock during a partition
  --was followed by--> * invariant: All refreshes pass through RefreshCoordinator

may reintroduce: Parallel refresh requests invalidate each other
regression tests: test_parallel_refresh_regression

A flat list of five memories makes you reconstruct the story. A chain hands it over.

4. Record what you learned — especially the failures

record(
    kind="bug_fix",
    summary="Serialize refresh requests per session",
    reasoning="Parallel requests rotated the same token.",
    invariants=["All refreshes for one session pass through RefreshCoordinator"],
    warnings=["Do not bypass RefreshCoordinator for new refresh entry points"],
    failed_attempts=["Redis mutex deadlocks during a network partition"],
    symbols=["RefreshCoordinator.acquire"],
    tests=["test_parallel_refresh_regression"],
    caused_by=[previous_memory_id],
)

failed_attempts is the highest-value field in the whole system. Nothing else in your toolchain records what was tried and rejected, and it is what future agents find most expensive to rediscover.

record() returns primary_memory — the id representing this event. Pass it as the next caused_by.

Field

Records

invariants

things that must remain true

warnings

things a future agent must not do

failed_attempts

what was tried and rejected, and why

decisions

choices made, and the alternatives rejected

contracts

assumptions other code relies on

security

security-relevant facts

performance

measured performance facts

bugs

bugs this code has caused before

migrations

migration steps or ordering constraints

conventions

local conventions worth following

rationale

why the code is shaped this way

tests

tests that cover this — creates a GUARDED_BY edge

contracts_with

cross-repository dependencies

caused_by

memory ids this event follows from

5. Trust the labels

Every memory carries an anchor_status. Anything other than ACTIVE has not been verified against the current code — treat it as a lead, not a fact.

memory(action="verify", memory_id=..., reason="confirmed it still applies")
memory(action="guard", memory_id=rule_id, body=test_memory_id)
memory(action="supersede", memory_id=..., body="what is true now")

How it works

Anchors that know when they are stale

A memory is not stored at src/auth/oauth.ts:193. Line numbers are a rendering detail. Each memory attaches to a semantic anchor: the symbol path, an AST path, a content fingerprint (structure + identifiers), a skeleton fingerprint (structure only), and its surrounding context.

When code changes, a cascade relocates the anchor — cheapest test first:

Step

Test

Result

1

Same fingerprint, same place

ACTIVE · 1.0

2

Same fingerprint elsewhere, confirmed by git blame -C -M

ACTIVE · 0.9, moved

3a

Same place, skeleton identical — a rename

ACTIVE · 0.8

3b

Same place, structure changed

NEEDS_REVIEW

4

Symbol gone, strong similarity match

DRIFTED, re-anchored

5

Nothing clears the bar

ORPHANED — kept, never deleted

Two rules make this trustworthy:

  • Verification fires on the edit that caused the drift, not on a timer.

  • The cascade can only lower trust, never raise it. Once DRIFTED or NEEDS_REVIEW, only an explicit memory(action="verify") returns an anchor to ACTIVE — otherwise the next pass would find its freshly re-anchored fingerprint matching, report "unchanged", and quietly re-trust a memory nobody ever confirmed.

Problem detection

investigate() narrows to a subgraph first, then asks targeted questions of it — never a workspace-wide scan. What separates these from a linter is that they are knowledge-aware: a linter sees a function has no test; only this graph knows the function is governed by an invariant recorded after a production incident.

Finding

Question it answers

stale_knowledge

which memories drifted from the code they describe

bypassed_wrapper

is a caller reaching past a coordinator or guard

untested_invariant

is a governed rule reachable by no test

deprecated_with_callers

does a deprecated symbol still have live callers

unguarded_equivalent

does a structurally identical sibling lack the rule

implementation_drifted_from_decision

did the code diverge from what was decided

knowledge_conflict

do two memories contradict each other

historical_implementation

is active knowledge pointing at deleted code

unverifiable_contract

is a cross-repo dependency currently uncheckable

unreviewed_caller

did a caller appear after the memory was verified

migration_candidate

did code plausibly move where the cascade would not follow

A failing detector never breaks the search: a diagnostic enhances an answer, it is not a precondition for one.

No LLM in the loop

record() is fully deterministic — entity resolution, edge derivation and contradiction detection are graph operations, not model calls. No API key, no network, no token cost. Ranking is a static, inspectable formula with per-intent weights, because a fresh local install has no labeled relevance data to train a reranker on.

Search that tolerates how people type

Exact and prefix matching runs first; when it finds nothing, an approximate pass takes over, so subproces still finds the subprocess warning. Hyphenation is bridged in both directions — reanchor finds text saying re-anchor and vice versa — because FTS5's tokenizer splits on hyphens and neither spelling would otherwise reach the other.

The fallback is deliberately a fallback: FTS ranking beats anything computed locally when it has hits at all, so running fuzzy matching by default would let loose matches outrank exact ones.

Ranking learns from use

Every memory tracks how often it was surfaced and how often an agent opened it in full. Opening is weighted far higher — being shown only means the query matched, while being opened means an agent chose it out of everything it saw.

The boost is bounded at 0.5 and decays with a 45-day half-life. Frequency is evidence, not authority: unbounded, it would pin last month's popular memory above a critical warning recorded yesterday.

Storage

%LOCALAPPDATA%\InfiniteCode\               (Windows)
$XDG_DATA_HOME/infinite-code/              (Linux)
~/Library/Application Support/InfiniteCode/ (macOS)

  catalog.db                repositories, aliases, checkouts, cross-repo edges
  data/repos/<id>/repo.db   DURABLE      code graph, memories, anchors, events
  data/transcripts-archive/ DURABLE      raw copies of agent transcripts the vendors delete
  data/transcripts.db       REBUILDABLE  normalised, searchable conversations from every agent
  cache/repos/<id>/         REBUILDABLE  safe to delete at any time

<repo>/.agit/               agent git, gitignored
<repo>/.icn-lab/            experiment lab, gitignored, separate from .agit
<repo>/.icn.toml            optional, committed, tiny

Override the root with INFINITE_CODE_HOME.

Identity is never the path and never the remote URL — both are mutable. It is derived from the root commit, an optional committed project id, and normalised remotes, so moving a clone or running git remote set-url reattaches to existing knowledge. A fork shares upstream's root commit, so it is split explicitly rather than silently inheriting upstream's memories.

Nothing is ever destroyed

  • Deleted symbols become tombstones with their last known path and the commit that removed them.

  • Edges carry valid_from_commit / valid_until_commit and become HISTORICAL rather than disappearing.

  • A vanished checkout is MISSING; an unmounted drive is OFFLINE. Neither deletes anything.

  • Corrections version the previous text; supersession keeps both memories and the link between them.

  • An agent cannot rewrite a human-authored memory — it must supersede it, leaving the disagreement visible.

  • purge is the only destructive operation, and requires confirm=True.

Lookups go through a resolver that never raises: "cannot currently resolve" is returned as data, with whatever was last known.


Brand

The mark is the product's one idea: a piece of knowledge (violet) anchored to code (green) that would otherwise carry no memory of it. The ring is left open — knowledge is never finished being verified.

Stroke weights are set so the shape survives to a 16px favicon: the memory node stays dominant and the three anchors read as a triangle even when the ring blurs away.

Hex

Means

#8b5cf6

memory, anchoring — knowledge

#34d399

symbols, tests — verified code

#4d7cfe

files — structure

#fbbf24

repository, caution

#f4677c

critical, causal chains

#1c2340

card surface

#151a2e

ground

One rule governs the whole UI: structure is quiet, knowledge is loud. CALLS and DEFINES recede into the background so that anchor and causal edges — the thing no other tool can show you — carry the colour.

Assets live in assets/; the explorer's own source is src/icn/web/:

src/icn/web/
  explorer.html    shell and markup
  explorer.css     the design system above, as custom properties
  explorer.js      force layout, canvas rendering, inspector
  mark.svg         logo
  banner.svg       header

Real .html, .css and .js rather than string literals, so an editor treats them as what they are. They are inlined at render time, because the published page must stay a single self-contained file.


Tools

Tool

Actions

workspace

open · status · list · reindex · health · reconcile · archive · detach · forget_checkout · purge

investigate

search · why · expand · verify

record

one event → many anchored facts

graph

impact · trace · cycles · entrypoints · areas · triggers · coupling · hotspots · deadcode · run · run_diff

memory

get · list · verify · guard · correct · supersede · resolve · reanchor

agit

status · diff · commit · log · branches · switch · restore · reset · show

experiment

init · tree · create · checkout · commit · diff · run · status · log · wait · cancel · runs · conclude · promote · apply · set_command

paper

search (arXiv, alphaXiv, OpenAlex, bioRxiv) · fetch · read · grep · render · figures · download · list · forget · remember

preview

local images, document pages, video filmstrips, and paginated text as MCP images

conversations

search · list · get · digest · refresh · status · doctor · schema · purge · restore

A plain record(summary="…") returns a memory ID. When you provide typed claims, such as invariants or warnings, those claims remain separate memories with the summary as context. investigate returns directly matching repository-wide memories in repo_memories, including when no symbol matches. Use memory(action="get", memory_id="…") for the full stored body.

Snapshot a repository store

Run icn backup icn-repo.sqlite --root /path/to/repository to make a checked SQLite snapshot of an existing repository store. It includes events, full memory bodies, versions, anchors, and graph edges, including committed writes still in SQLite's WAL. The destination must be a new file. The central catalog and transcript archive are separate stores. Use the knowledge export workflow for sharing selected memories across installations.

agit keeps agent checkpoints in .agit/, entirely separate from the user's .git. Checkpoint risky work, restore it, never touch their history.

experiment settles questions by measurement, adapted from OpenResearch's experiment tree. The baseline is the current code plus one command that measures it. Each experiment is a child branch in .icn-lab/ that changes code, never the command. A run executes the exact committed snapshot in its own folder, detached, so it survives the session. Programs report results by printing ICN_METRIC name=value. The lab enforces the rules: the command is fixed once anything is measured, an answered experiment is frozen, and two unanswered crashes in a row need force. conclude turns a judged run into a decision, failed attempt or rationale memory that carries the run's commit, command, exit code, metrics and diff against its parent. record(evidence=[run_id]) attaches the same proof to any memory.

conversations searches the transcripts every coding agent on this machine keeps in its own private format: Codex, Claude Code, Copilot (CLI and VS Code), Cursor, Windsurf, Gemini CLI. Each is read through an adapter into one normalised shape and indexed with FTS5, so a question answered in a Cursor session is findable from Claude Code. The vendors treat transcripts as scratch (Claude Code prunes after 30 days by default), so a sync thread inside the server copies new bytes into ICN's own append-only archive on a timer; one lease-holding process does the work however many servers are running. When an adapter parses a file as JSON but finds no conversation, it reports SCHEMA_DRIFT naming itself instead of quietly returning nothing. investigate() already attaches the hits scoped to the repository being investigated; conversations is for reading a whole session, its digest, or searching across every codebase. Vendor stores are only ever read, and the index and archive never leave the machine.

Visual previews

Install the renderers into the environment that launches the MCP server. From this checkout, run python -m pip install -e ".[preview]" and restart the client. For a packaged install, use uvx --from "infinite-code-next[preview]" infinite-code-next as the server command once your installed version includes preview.

Input

Example tool arguments

Output

JPEG, PNG, WebP, GIF, TIFF and other supported images

{"path":"assets/screenshot.png"}

A fitted image. Use page to select a GIF frame or TIFF page.

PDF, SVG, XPS, EPUB and other supported documents

{"path":"report.pdf","page":3,"count":2}

One image per selected page, including scanned pages.

Word, PowerPoint, Excel, OpenDocument and RTF

{"path":"slides.pptx","count":2}

Images of the pages LibreOffice exports. Requires LibreOffice on the server machine.

MP4, MOV, WebM, MKV and other supported videos

{"path":"demo.mp4","start_seconds":10,"end_seconds":20,"count":8}

One filmstrip with the actual timestamps of sampled frames.

Logs, Markdown, code and other plain text

{"path":"build.log","page":4,"count":2}

Paginated, line-numbered images with long lines wrapped.

Paths can be absolute or relative to the ICN root. You can also pass inline text. Use kind to override detection, for example kind="text" to view SVG source markup. The result contains a short summary and native MCP image blocks for an image-capable client. Previews read local files without adding them to the knowledge store.

Use the returned next_page to continue a multi-page preview. Keep max_side fixed across text pages so wrapping stays consistent. A call can return up to 4 pages or sample up to 12 video frames into one filmstrip. max_side ranges from 640 to 2048 pixels and defaults to 1440.

Passing a text file path keeps the source text out of the tool arguments and result metadata. Text previews support UTF-8 and BOM-marked UTF-16/32 files up to 16 MiB. Image inputs still use vision tokens, and exact transcription depends on the model, font coverage, and resolution.

Knowledge that arrives without being asked

Full setup, verification and troubleshooting guide: guides/HOOKS.md.

icn install --codex wires two hooks into Claude Code (.claude/settings.json) and Codex (~/.codex/hooks.json):

  • Session start: the handoff the previous session left (claimed exactly once), the highest-standing rules, and what needs attention.

  • Before a tool reads or edits a file (Read/Edit/Write, Codex apply_patch, shell reads): the invariants, warnings, contracts and rejected attempts anchored to that file. Capped in size, never repeated within a session, silent for files with no knowledge, and fail-open (a broken hook exits 0 with no output). Knowledge on code that changed since it was recorded is labelled unverified rather than hidden.

  • Targeted to the code actually touched. A ranged Read or an Edit gets the knowledge of the symbols in those lines (plus file-level knowledge when the lines include module-level code); rules about other functions in the same file wait until that code is touched. Searching or listing (grep, rg, ls, find, git log) delivers nothing, so a search never uses up the once-per-session delivery before the file is read.

The same session can close the loop:

  • memory(action="feedback", signal="helpful"|"not_helpful"|"stale"|"wrong"). Wrong or repeatedly unhelpful memories stop being volunteered; nothing is deleted, and verify restores them.

  • memory(action="handoff", body=..., next_steps=[...], open_questions=[...]).

  • record() merges a restated claim about the same code into the existing memory (memories_reinforced, evidence_count) and flags close matches with similar_to.

Settled rules can be promoted into this repository's CLAUDE.md and AGENTS.md: icn rules recommend | approve <id> | edit | remove | list, or memory(action="rules_*"). Candidates must be anchored to real code that still matches, undisputed, imperative and one line long; each promoted line names the file and symbol it governs. The managed block is capped (12), an approval past the cap is refused naming the weakest rule, and text outside the markers is never touched.

Experiments are part of the knowledge graph, not beside it:

  • workspace(action="open") reports the lab, including finished runs nobody has judged yet, and measured losses appear under already_rejected.

  • A conclusion is anchored to the symbols its diff touched, so investigate() surfaces it next to the invariants and warnings on the same code.

  • Each conclusion links to its parent's (LED_TO), and conclude(caused_by=[...]) links what motivated it, such as a paper(action="remember") memory. So investigate(action="why") tells how the code got here: prior art, baseline, winner.

  • apply writes a measured experiment's code into the working tree, only if the files still match the baseline. Measured memories are re-verified, because a measurement of a recorded commit stays true; everything else the change put under review is listed for a human look.

Recording what actually ran

Full guide: guides/TRACE.md.

Static analysis says what could happen. icn trace records what did:

icn trace python app.py
icn trace -- pytest -x tests/test_orders.py
icn trace npm test

Any command works. Every Python process it starts records its call flow, arguments, return values, how local variables changed line by line, wall and CPU time per function, library calls and exceptions (Python 3.12+ uses sys.monitoring; older versions fall back to sys.settrace). Every Node.js process writes a sampled CPU profile. Anything else gets time, memory, exit code and output. The result is .icn-trace/<run>/report.md, written to be read top to bottom by a person or an agent, with report-full.md and the raw recordings beside it.

When the repository is indexed, the report also lists calls that ran but are missing from ICN's static call graph. Those are the callers graph(action="impact") cannot see.

To find where a working run and a broken one parted ways:

icn trace python app.py        # works
# ... change something ...
icn trace python app.py        # fails
icn trace diff                 # the two most recent runs

The diff names the first point where the call sequence diverged, the earliest variable whose value differed (with the line that produced it), calls and exceptions present in only one run, and time that moved. Agents get the same through graph(action="run", target="<command>") and graph(action="run_diff").

A recording is evidence, on the same footing as a measured experiment, so it is part of the knowledge graph rather than a side artifact:

  • record(evidence=["<run>"]) writes the run's command, exit code, timing and hottest functions into every memory of that event, with the path of its report, exactly as evidence=["run_..."] does for a lab run.

  • workspace(action="open") lists the most recent recordings.

  • investigate(action="why", symbol=...) reports whether a recorded run actually executed that symbol and which functions called it. That is the evidence graph(action="impact") cannot give: it answers who could call something and labels itself a lower bound. A symbol no run reached is reported as exactly that, never as dead code.


Testing

python -m pytest

596 tests, including a live MCP suite that spawns the real server over stdio and drives a full agent workflow through the wire protocol, and a dirty-worktree harness that asserts cascade behaviour on uncommitted edits — reformat, rename, body change, cross-file move, delete, weak migration.

That regime is unvalidated by the published literature, which only ever measures post-hoc commit-history mining, so it is measured here directly.

The live test earns its keep. It found a bug in-process testing cannot see: subprocess calls inherited the server's stdin, which is the MCP protocol pipe. Git blocked on it for its full 20-second timeout on every tool call and could swallow protocol bytes. Fixing it took tool latency from 20s to 0.2s.

Measured on a real 4,621-file repository

Full index

593s → 34,747 symbols, 58,857 edges, 43,038 call edges

Warm open

0.77s

Query

1.48s


Design

The reasoning behind each decision lives next to the code it governs: every module's docstring states what it does and, more importantly, which failure it exists to prevent. anchors.py explains why the cascade may only lower trust, briefing.py why open volunteers a summary, causal.py why causality is asserted and never inferred.

Planning notes are kept locally and are not part of the shipped artifact.


Built by Ranit Bhowmick

If an agent had to read your codebase to understand it, that knowledge died with the session. This is the fix.

Available Tools

10 tools
agitA

Agent-only git history in .agit/, separate from the user's real repo.

WHEN TO USE: action='commit' before any risky edit or broad refactor, so there is something to roll back to. It writes to .agit/, never the user's .git, so it cannot touch their history, staging or branches. AFTER THIS: make the risky change. If it goes wrong, agit(action='restore', paths=[...]) - which does rewrite real working-tree files, so check agit(action='diff') first.

Checkpoint risky work without touching .git. Auto-initialises on first use and adds itself to .gitignore. Per working tree, never central: a checkpoint only means anything against the tree it snapshotted.

Actions: status, diff, commit, log, branches, switch, restore, reset, show.

Args: action: one of the actions above. message: commit message. paths: file paths, relative to the repository root. branch: branch name for switch. create: create the branch if switching to a new one. target: commit-ish for diff, log, reset, show. source: source ref for restore. cached: diff the staged index. hard: use --hard for reset. allow_empty: allow an empty commit. limit: maximum log entries. root: repository path. Defaults to the server's working directory.

Inputs: hard, root, limit, paths, +8 more. Returns: object

conversationsA

Search past conversations from every coding agent on this machine.

Codex, Claude Code, Copilot (CLI and VS Code), Cursor and the rest each keep transcripts in their own private format, and none can read the others'. This reads all of them, plus our own archive of transcripts the vendors have since deleted, and answers across the lot.

Actions: search full-text across every agent, with the messages around each hit. Filter by codebase (a directory), provider, surface, role, kind, tool_name, origin (live | archive), and a time window. Misspellings and other word forms still match: when the exact query finds little, each word is matched against similar terms that are actually in the index, and the reply says what it expanded to. match="any" ORs the words, match="phrase" requires them adjacent, a trailing * is a prefix, "quoted text" is exact. list browse sessions rather than messages. get one session's messages, paginated from start. digest what a session did: tools used, files touched, user turns, errors. refresh sync the archive and reindex now (the server also does this on a timer; you do not have to call this). status is the background sync running, when did it last tick, what is in the archive. doctor index health and any vendor schema drift. schema the record shapes in one source file, for fixing an adapter. purge delete an archived copy and tombstone it so a later sync does not copy it straight back. mode=archive_only keeps the live file searchable; mode=exclude_all hides it everywhere. restore remove a tombstone so target can be archived and indexed again.

Vendor stores are only ever read. The index and archive stay on this machine and carry whatever went through the agents' tools, so treat them as sensitive.

Inputs: kind, mode, role, sort, +22 more. Returns: object

experimentA

Measure ideas instead of arguing them: a tree of experiments with real runs.

WHEN TO USE: when a question can only be settled by running code - is this faster, more accurate, smaller, more stable - and the answer should outlive the session. Not for ordinary edits; use agit to checkpoint those. AFTER THIS: conclude() every result you judged, so it becomes a memory with its evidence attached.

Think of recipes. The baseline is the recipe you have and the one way you taste it (the command). Each experiment copies a recipe and changes one thing. You always taste the same way, you never scribble on a recipe you already tasted, and the next round starts from the winner.

The lab lives in .icn-lab/ (gitignored), fully separate from agit and from the user's .git. It enforces the rules rather than suggesting them:

  • One command for every experiment, fixed once anything is measured. Vary code and config on a child, never the command or env vars.

  • An experiment freezes once a run answers it. commit then refuses; put the next idea on a child. A crash answered nothing, so the node stays editable, but two unanswered failures in a row need force=True.

  • A run executes the committed snapshot in its own folder, never the editable checkout, and refuses while the checkout has uncommitted edits. Report results by printing lines like ICN_METRIC loss=0.4312.

Grow the tree downward: siblings are the co-equal options of ONE decision; the next decision goes under that round's winner. tree() warns about a flat fan (everything under the root) and a noodle (a chain of one-child links).

Actions: init create the lab. Snapshots the working tree as the baseline. Needs command. title defaults to 'baseline'. tree every experiment with its state, verdict, latest run and metrics, the focal node, and tree-shape warnings. create new experiment. Needs title; hypothesis is what you expect. parent defaults to the focal node (latest winner, else the baseline). checkout a folder with the experiment's code, to edit. Returns path. commit commit that folder onto the experiment. Refused when frozen. diff the experiment's change against its parent, or against. run launch a detached run of the committed code. Survives this server exiting. timeout_seconds bounds it. status one run (run=) or one experiment (exp=) in detail. log a run's output. tail bytes from the end, or from offset. wait block up to wait_seconds (max 600) until a run finishes. Returns on the FIRST finish so you can judge it and refill. cancel stop a run and everything it started. runs recent runs, all or for one experiment. conclude judge a finished run: verdict win | loss | inconclusive | void. win, loss and inconclusive freeze the experiment and write an ICN memory (decision, failed_attempt, rationale) carrying the run's commit, command, exit code, metrics and the change against the parent. win also promotes it. void says the run answered nothing (needs note) and unfreezes. promote make a measured experiment the parent for the next round. apply bring a measured experiment's code into the working tree: the whole lineage from the baseline, applied only if those files still match the baseline. The memories describing that lineage are re-verified against the new code, and any other memory the change put under review is listed. set_command change the command. Only before anything is measured.

It ties into the rest of ICN: a conclusion links to its parent's conclusion (LED_TO), so investigate(action='why') tells the story of how the code got here; caused_by= links it to what motivated it, such as a paper(action='remember') memory; workspace(action='open') lists finished runs still waiting for a verdict.

Read a run's log before concluding: status alone is not evidence.

Args: action: one of the actions above. exp: experiment id or slug. run: run id. title: for init and create. hypothesis: for init and create - the expected effect, in a sentence. parent: for create - experiment id or slug to branch from. command: for init and set_command. message: for commit. against: for diff - compare with this experiment instead of the parent. verdict: for conclude. note: for conclude - what the result means, in your own words. timeout_seconds: for run. 0 means no limit. wait_seconds: for wait. tail: for log - bytes to return. offset: for log - start byte instead of the tail. force: for run - launch past the consecutive-failure cap. limit: for runs. caused_by: for conclude - memory ids that motivated this experiment, e.g. the paper memory that suggested it. Same shape as record(). root: repository path. Defaults to the server's working directory.

Inputs: exp, run, note, root, +15 more. Returns: object

graphA

Structural questions about the code graph: blast radius, paths, cycles.

WHEN TO USE: after investigate() has told you what a symbol is for, and you need to know what changing it costs. investigate() answers "what is this and why"; graph() answers "what else moves if I touch it". AFTER THIS: investigate(action='why', symbol=...) on anything surprising in the blast radius, then record() what you decided.

Actions: impact blast radius of one symbol. direction='upstream' is who depends on it (who breaks if the contract changes); 'downstream' is what it depends on. trace shortest directed call path from target to to. Use it to prove two symbols are actually connected rather than assuming it. cycles directed cycles in the file import graph. Act on component_count, not on the number of cycles: one removed import can dissolve a whole component, so the cycle count swings wildly and the component count is what a fix actually reduces. A deferred import (inside a function, or a TypeScript import type) is excluded: it cannot force an initialisation order, and it is the usual fix for a cycle rather than a cause of one. entrypoints where control enters the program - routes, MCP tool handlers, CLI commands, tests. Pass a kind in target to filter. Start here on an unfamiliar codebase. areas functional areas from the call graph, not the directory layout, so an area can span directories. Each carries test_share and the entry points that reach it; an area nothing reaches is a library or is dead. triggers which entry points can reach target - what a user can actually do that runs this code. The complement of impact: not "what else changes" but "what can set this off". coupling file pairs that keep changing together, from git history. The rows worth reading are the ones with also_imports=false: those are coupled by something no static analysis can see. hotspots where change and structural weight meet. Neither alone is interesting; a file both heavily depended on and constantly rewritten is where a change is most likely to break something far away. deadcode symbols nothing in the graph reaches. CANDIDATES, never a verdict - read confidence on every row and the boundaries before acting on one. memscore measure this repository's own retrieval: accuracy, latency and context cost, reported side by side and deliberately not combined into one number. Ground truth is the store's anchored memories, so it is free and specific to this repository - and only comparable to another run on the SAME repository. Use it before and after touching search weights. window sets the sample size. run the runtime counterpart of all of the above: execute target (any shell command: 'python app.py', 'pytest -x tests/test_a.py', 'npm test') and record what actually happened. Python gets the full call flow, arguments, return values, how local variables changed line by line, time and CPU per function, exceptions and library calls; Node.js gets a sampled CPU profile; anything else gets time, memory, exit code and output. Calls the static graph does not know (dynamic dispatch, callbacks) are listed. Returns the path of report.md: READ THAT FILE, it is written for you. run_diff compare two recorded runs, e.g. before and after a change, or a passing and a failing input: the first point where the call sequence diverges, the first variables whose values differ, calls and exceptions present in only one run, and time that moved. target and to name the two runs (folder or name fragment); omit both to compare the two most recent runs in root.

READ THE ENVELOPE BEFORE THE RESULT. Every answer carries: epistemic 'exact' or 'lower-bound'. 'lower-bound' means callers exist that this result provably does not list. An empty affected with epistemic='lower-bound' is NOT proof that nothing calls the symbol. boundaries one plain sentence per reason, for humans. causes the machine-readable why. Every field counts MISSING or UNPROVEN things, never sentences: ambiguous_call_sites - call sites naming this symbol that could not be attributed to a single definition. These are the callers you are not being shown. inferred_edges_traversed - edges resolved by import scope or by uniqueness of the name, not proven from the syntax. Counts edges walked, so it can exceed counts.inferred, which counts distinct symbols reached. external_call_sites - calls that left the indexed program. Not a defect: no in-graph node could have been reached.

Edges are tiered, and the tier is on every result. receiver_self (1.0) and same_file (0.9) are read off the syntax; imported (0.8) and unique_global (0.6) are judgements. Pass min_confidence=0.9 to walk only what was proven.

The three history actions carry their own envelope. It is always 'lower-bound': history only knows the commits it read, only knows committed work, and knows nothing that a squash or a shallow clone removed. history in the result says how much was actually read.

Args: action: impact (default), trace, cycles, entrypoints, areas, triggers, coupling, hotspots, deadcode, memscore. target: symbol to analyse, the path source for trace, or - for action='entrypoints' - a kind to filter by (route, tool, cli, test). A bare name is fine; if it is ambiguous the candidates come back for you to choose. to: destination symbol, for trace. direction: upstream or downstream, for impact. depth: hops to walk. Clamped to 12. file_hint: path fragment disambiguating target, e.g. 'search.py'. to_file_hint: the same, for to. include_tests: include test files in the blast radius. For action='areas', rank mostly-test areas alongside the rest instead of sorting them last. For action='deadcode', report unreferenced test symbols too. min_confidence: drop edges below this confidence before walking. window: commits to read, for the history actions. Default 500, max 5000. since: a git date ('3 months ago', '2026-01-01') bounding that window. root: repository path. Defaults to the server's working directory. For action='run', the directory the command runs in. timeout_seconds: for action='run', stop the command after this long. run_options: for action='run', any of 'libraries' (also trace the standard library and installed packages; slower), 'memory' (allocation sites; slower), 'no-values' (flow and timing only; fastest).

Inputs: to, root, depth, since, +10 more. Returns: object

investigateA

Find code and project knowledge, with evidence to guide source review.

WHEN TO USE: before investigating, diagnosing, designing or modifying anything. Include a qualified symbol, path, config key, or error text when available. Broad natural-language results are leads. If matches are weak or empty, check index_state and search the repository directly. Read relevant source and tests before making claims or edits. A partial index can omit symbols, and a ready index can still miss relevant results. AFTER THIS: graph(action='impact') if you are about to change a symbol; investigate(action='why', symbol=...) before deleting something load-bearing; record() once you have verified something.

Searches code and knowledge together - lexical, symbol, code graph, memory graph, anchor status and git history - and returns compact capsules under a token budget rather than file dumps. Direct matches without a code anchor can appear in repo_memories. The conversations section is what past sessions from any coding agent (Codex, Claude Code, Copilot, Cursor, ...) said about the same terms while working in this repository: leads to follow with conversations(action='get'), not anchored facts.

Actions: search (default) run an investigation. expand drill into a prior investigation without restarting it. verify re-verify anchors for this repository right now. why reconstruct why one symbol exists, as a causal chain: decision -> bug -> failed fix -> accepted fix -> invariant -> test.

Args: query: task in plain language, with any known symbol, path, or exact term. A standalone path:line or path:line:column locates the indexed symbol at that source location. intent: locate | understand | modify | debug | audit. Inferred if omitted. root: primary repository path. Defaults to the server's working directory. roots: explicit repository paths for one bounded multi-repository search. depth: graph expansion hops from the seed set. budget: approximate token ceiling for the returned capsules. find_problems: run targeted checks over the narrowed subgraph. cross_repos: also follow contract edges into other repositories and report their active warnings. Reads the central catalog only, so it works even when those repositories are missing. conversations: also search past agent transcripts scoped to this repository. Off skips the transcript index entirely. use_concepts: use reviewed phrases from .icn-concepts.json. Grounding lists matched phrases, target status, and terms unmapped by the glossary. action: search, expand, or verify. investigation_id: required for expand. focus: what to drill into, for expand. symbol: the symbol to explain, for action="why".

Inputs: root, depth, focus, query, +10 more. Returns: object

memoryA

Inspect and correct stored knowledge.

WHEN TO USE: when a memory surfaced with anchor_status other than ACTIVE and you have just confirmed whether it still holds, or when something stored is wrong. A memory that is merely out of date should be corrected or superseded, never left to rot - an unverified fact costs the next agent more than no fact at all. AFTER THIS: continue the task. Use action='verify' the moment you have the evidence, while you still have it.

Actions: list browse memories, filterable by kind, status, anchor_status. Bodies are included, so this reads many at once rather than costing one get() per memory. get one memory with its anchors, edges and version history. Re-anchoring logs are summarised; action='history' has them raw. history the full re-anchoring audit trail for one memory. verify confirm a memory still applies. Clears NEEDS_REVIEW/DRIFTED. correct edit a memory in place. Previous text is versioned, not lost. supersede replace a memory, keeping both and the link between them. resolve mark a warning or bug as no longer live. guard record that an existing test covers an existing rule, when the two were written in separate calls. Pass the rule as memory_id and the test_evidence memory id as body. reanchor re-run the anchoring cascade for one memory. feedback vote on a memory you were shown: signal='helpful', 'not_helpful', 'stale' or 'wrong' (stale and wrong need a reason). Wrong or repeatedly unhelpful memories stop being volunteered by hooks; nothing is deleted.

Knowledge ICN derived itself, rather than being told. These are proposals: they are down-ranked in search and never treated as rules until settled. infer look for patterns across stored knowledge and the call graph, and propose what they imply. Writes nothing but unreviewed candidates. Safe to re-run: a proposal already made, or already declined, is not raised again. review_queue the proposals awaiting a decision, best-supported first. review settle one: memory_id plus signal='approve' (promote it to a stated fact), 'decline' (forget it), or 'undo'.

Handoffs, "where I left off" for the next session (claimed exactly once, by its session-start hook or workspace(action='open')): handoff write one before stopping mid-task: body=summary, plus open_questions, next_steps, files. handoff_list recent handoffs and their status, without claiming. handoff_cancel withdraw an open one (memory_id=handoff id).

Rules promoted into this repository's CLAUDE.md and AGENTS.md, a small capped block changed only by these commands: rules_recommend ranked, codebase-specific candidates. Read-only. rules_approve promote memory_id (body= optional wording). Refused at the cap, naming the weakest rule to remove first. rules_edit reword a promoted rule (body=). rules_remove demote; the memory itself is unchanged. rules_list what is promoted, and which rules have gone stale. Promote only on the user's say-so: these edit files they own.

Args: action: one of the actions above. memory_id: target memory. body: new text for correct and supersede. kind: new kind for correct, or a filter for list. severity: new severity for correct. status: filter for list (ACTIVE, SUPERSEDED, RESOLVED). anchor_status: filter for list (ACTIVE, NEEDS_REVIEW, DRIFTED, ORPHANED). reason: why the change is being made. Recorded. actor: 'agent' or 'human'. limit: maximum rows for list. offset: rows to skip for list. With total and next_offset in the reply, this pages through a filter larger than one call can carry. signal: for feedback. open_questions: for handoff. next_steps: for handoff. files: for handoff. root: repository path. Defaults to the server's working directory.

Inputs: body, kind, root, actor, +12 more. Returns: object

paperA

Prior art you can actually read: arXiv search, full papers, page images.

WHEN TO USE: before building a non-trivial mechanism - caching, consensus, retry and idempotency, ranking, scheduling, rate limiting, a wire format. Anything where the naive version breaks at scale and a wrong choice costs a rebuild rather than a typo. AFTER THIS: read the paper rather than its abstract - read() by section, grep() for one question, render() for figures the text layer drops - then paper(action='remember') so the next agent finds the citation instead of re-deriving the decision.

The abstract is not the paper. Everything here is built to get past it: the whole text, cached once and served in slices, plus rendered pages for the figures and tables no text extractor recovers.

Sources are interchangeable. paper_id takes an arXiv id in any form (2401.12345v2, arXiv:2401.12345, an abs or pdf URL); url takes any http(s) PDF or a landing page that names one; path takes a local .pdf.

Actions: search query a literature index. Returns real metadata, abstracts truncated, because a search is for choosing what to read. source='arxiv' (default) is the arXiv API. 'alphaxiv' searches the full text of arXiv papers and returns the matching snippets; 'alphaxiv_semantic' is the same corpus by meaning rather than words. 'openalex' reaches journals and every discipline, and 'biorxiv' is OpenAlex limited to bioRxiv preprints. Each result says how to fetch it, or that no open PDF is known. fetch download, extract, and cache one paper. Returns the outline and page count so you know what to ask for next. Idempotent. read the cached text. mode='outline' (default) lists sections; mode='full' is the entire paper; mode='latex' reads the submission's original TeX, where section boundaries are declared rather than guessed and formulas are intact; mode='html' is arXiv's HTML rendering; mode='abstract' if you only want the pointer. pages='7-12' or section='4'/'method' narrow it. Long reads page via offset. A paper with no text layer (a scan) comes back as page images rather than as an empty string, so a read always answers. grep regex search inside the full text, with page-anchored context. Answers one question without reading the other thirty pages. Says so when the paper has no text layer, because zero hits there means 'not searchable', not 'not present'. render rasterise pages to PNG and return them as images. This is how you see a figure, a table, an architecture diagram, or a scanned PDF whose text layer is empty. Max 8 pages per call. figures extract embedded raster figures at their own resolution. Vector figures are not rasters; use render for those. download copy the PDF into any directory you name. list what is already cached. forget drop one paper from the cache. remember write what a paper settled into this repository's memory graph, anchored to the symbols and files it informed, so the next agent finds the citation instead of rediscovering it.

Args: action: one of the actions above. query: search text. Fielded arXiv syntax (ti:, au:, abs:, AND/OR) is passed through untouched; plain text is wrapped in all:"...". paper_id: an arXiv id, in any of the forms above. url: any http(s) PDF URL, or a landing page that names one. path: a local .pdf file. category: arXiv categories to restrict to, e.g. "cs.DC cs.DB". arXiv only. source: for search - arxiv | alphaxiv | alphaxiv_semantic | openalex | biorxiv. max_results: search hits to return, 1-100. sort: relevance | recent | updated, plus popular | historical for the non-arXiv sources. start: offset into the search results, for paging. mode: for read - outline | full | latex | html | abstract. pages: page selection like "3" or "7-12" or "1,4,9-11". Used by read, render, and figures. section: section number ("4", "4.2") or name ("method") for read. pattern: regex for grep. ignore_case: case-insensitive grep. Default true. context: characters of context around each grep hit. max_chars: cap on returned text per read call. 0 means no cap. offset: character offset into a read, for continuing a long one. dpi: render resolution, 50-400. Higher is sharper and much larger. dest: directory to download the PDF into. filename: override the generated filename for download. save_to: directory for rendered pages or extracted figures. refresh: re-download and re-extract even if cached. with_html: on fetch, also pull arXiv's HTML rendering if it exists. vision: on read, when the paper has no extractable text layer, return the requested pages as images instead of an empty string. On by default - a scanned paper is readable, just not as text. Set false if you want the empty result rather than the pixels. with_latex: on fetch, also pull the original TeX source. Pulled automatically when the PDF extracts poorly, which is the same set of old papers whose metadata the arXiv API tends to refuse. with_text: on download, write the extracted text alongside the PDF. limit: maximum rows for list. note: for remember - what this paper settled, in your own words. This is the memory's substance; without it only the citation is stored. symbols: for remember - symbols this paper informed, so the memory anchors to real code. files: for remember - files this paper informed. kind: for remember - rationale | decision | note | investigation. root: repository path, for remember. Defaults to the working directory.

Inputs: dpi, url, dest, kind, +29 more.

previewA

Preview a local file or inline text as native MCP images.

Args: path: Absolute local path or path relative to root. Supply path or text. text: Inline text to render. Use a path for large text already on disk. kind: auto, image, document (PDF, SVG, XPS, ebook), office, text, or video. page: First page or animated image frame, starting at 1. count: Consecutive pages or frames (1-4, default 1). For video, sample 1-12 frames (default 6) into one annotated filmstrip. max_side: Maximum image dimension in pixels, 640-2048. Keep this the same when using next_page to resume a text preview. start_seconds: Video interval start, default 0. end_seconds: Video interval end, default video duration. root: Base directory for relative paths, default ICN workspace root.

Inputs: kind, page, path, root, +5 more.

recordA

Write what you learned. One call becomes many durable, anchored facts.

WHEN TO USE: after any verified finding or change - not at the end of the session, when the detail has already gone. Skip it only for purely mechanical work such as fixing a typo. AFTER THIS: nothing. This is the call that makes the next session cheaper, and the fields that pay off most are failed_attempts and warnings, because nothing else in the toolchain records what was tried and rejected.

You supply the semantics; the server resolves names to real symbols, anchors each memory to the code, derives the edges you did not mention (callers, tests, blast radius), and flags contradictions with what it already knows. Nothing you write is ever silently overwritten.

Use kind='checkpoint' at the end of a task to distil the session. When index_state is partial, unresolved references may appear in the index later. Check which references resolved before relying on a code link.

WRITE LIKE THE NEXT AGENT HAS NO CONTEXT, because it does not. Every entry should survive being read alone, months later, by someone who was not here.

Thin, nearly useless:  "settle must be idempotent"
Actually useful:       "settle() must be idempotent: a retried webhook
                        must not double-charge. We learned this from
                        the Feb duplicate-charge incident, where the
                        payment provider retried after a 502 that had
                        already succeeded. The guard is the
                        idempotency_key column, unique per invoice."

The second one costs you a few extra seconds now and saves the next agent an afternoon. State the failure it prevents, the evidence it rests on, and the mechanism that enforces it - not just the rule.

Args: summary: what happened, in one full sentence. Required. kind: bug_fix | decision | refactor | investigation | checkpoint | incident | note. reasoning: why this happened and why it was done this way. Two or three sentences. This is attached to every memory the call produces, so it is the cheapest way to make all of them self-contained. files: file paths this touches. symbols: symbol names this touches, e.g. RefreshCoordinator.acquire. changes: what actually changed. invariants: things that must remain true, and what breaks if they are not. "X must hold, because otherwise Y" beats "X must hold". warnings: things a future agent must not do, and the symptom it causes. A warning nobody can recognise in the wild will not be heeded. failed_attempts: what was tried, why it was rejected, and how the failure showed itself. This is the highest-value field in the system - nothing else in your toolchain records it, and it is what stops the next agent spending a day on a dead end you already walked down. decisions: choices made and the alternatives rejected. contracts: assumptions other code or repos rely on. performance: performance-relevant facts. security: security-relevant facts. conventions: local conventions worth following. rationale: why the code is shaped the way it is. bugs: bugs this code has caused before. migrations: migration steps or ordering constraints. tests: tests that cover this. contracts_with: cross-repository dependencies, as [{"repo": "acme/billing", "entity": "charge_customer", "kind": "CONSUMES_CONTRACT"}]. kind is one of PROVIDES_CONTRACT, CONSUMES_CONTRACT, MIRRORS, RELATED_TO. The other repository does not need to be indexed, or even present, for this to be recorded. caused_by: memory ids this event follows from, building the causal chain an agent sees as "why does this code exist": decision -> bug -> failed fix -> accepted fix -> invariant -> test. Pass ids, or [{"memory": "mem_x", "kind": "CAUSED"}] where kind is CAUSED, LED_TO, ESTABLISHED, REFINES or DEPENDS_ON. evidence: proof that what this records actually happened. Either experiment run ids (from experiment()), whose commit, command, exit code and metrics are written into every memory, or recorded runs (from graph(action='run'), named by their folder such as '20260917-160603-perms'), whose command, exit code, timing and hottest functions are written in the same way, with the path of the full report. The claim then carries its proof instead of asking to be believed. authority: 'agent' or 'human'. Human memories cannot be rewritten by an agent. root: repository path. Defaults to the server's working directory.

Inputs: summary (required), bugs, kind, root, +19 more. Returns: object

workspaceA

Open, inspect, and manage repositories known to this server.

WHEN TO USE: first call of any session, and again whenever you switch repository. action='open' returns the briefing - the rules that govern this code, what has already been tried and rejected, and what is unverified. AFTER THIS: investigate() with the task and any known symbols or paths. Check index.index_state on open. A partial index can omit relevant files and symbols. Use source search for immediate answers or retry once ready.

Actions: open resolve this directory to a repository, index what changed, re-verify anchors. Call this first. status current identity, index and anchor health. list every repository known, including ones not on disk. reindex full re-index (force_full is implied). health graph health summary across all repositories. reconcile re-check which checkouts are still reachable. archive stop indexing, keep all knowledge searchable. detach stop watching, keep repository knowledge. forget_checkout this local clone is gone; repository knowledge stays. purge permanently delete stored data. Requires confirm=True.

Args: action: one of the actions above. root: repository path. Defaults to the server's working directory. force_full: re-index everything rather than only what changed. repo_id: target repository for archive/detach/purge. reason: recorded in the lifecycle log for state changes. confirm: required for purge, which is the only destructive action.

Inputs: root, action, reason, confirm, +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool owns a distinct domain (workspace lifecycle, transcript search, code investigation, call-graph analysis, memory writes, memory curation, checkpoints, experiments, rendering, papers), and the WHEN TO USE blocks explicitly sequence them. A few boundaries blur: investigate() has a `conversations` flag that overlaps the standalone conversations tool, and record() vs memory() vs paper(action='remember') all write durable memories through different doors. These are steerable overlaps rather than true ambiguity.

    Naming Consistency4/5

    The set follows one consistent convention throughout: a single domain-named tool with an `action` parameter carrying the verb (graph(action='impact'), memory(action='verify'), paper(action='read')), rather than verb_noun names. That is predictable and uniform, but it means the tool name alone never tells you the action, and 'agit' is idiosyncratic enough that its purpose isn't inferable from the name.

    Tool Count5/5

    Ten tools for a knowledge-graph-plus-code-intelligence server is well scoped, and each multi-action tool consolidates what would otherwise be dozens of separate endpoints. No tool looks vestigial: preview and paper are the loosest fit but are explicitly wired into the memory/experiment workflow.

    Completeness4/5

    Coverage of the stated domain is strong: repository lifecycle (open through purge), search, graph analysis, memory CRUD and curation, handoffs, rules promotion, agit checkpoints, full experiment lifecycle, and paper retrieval all have real entry points. Minor gaps remain: memory has no hard-delete path (only supersede/resolve), and there is no consolidated read/export of a memory's provenance beyond memory(action='history') and investigation(action='why').

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      B
      quality
      Not graded
      maintenance
      A memory system for AI coding tools that stores and retrieves codebase context with project isolation. Enables coding assistants to maintain searchable memory of code snippets, comments, and runtime traces with full source traceability.
      27
      26 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query project memory by linking code changes to the conversations that produced them, allowing retrieval of past decisions and constraints directly from the codebase.
      7 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides persistent, anchored memory for AI coding agents, binding every decision to specific lines of code and delivering relevant context just-in-time via the Model Context Protocol.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides persistent memory for coding agents and grounds their claims by verifying against the actual codebase, preventing hallucinated responses.
      Apache 2.0