Infinite Code Next
AIコーディングエージェントにコードベースの永続的で検証可能な記憶を与える、ゼロ設定のMCPサーバー。コードの背後にある決定、すでに試されて却下されたこと、決して壊してはならないこと——それらをコードに固定し、コードが移動するにつれて一緒に運ぶ。
クイックスタート · エクスプローラー · 共有 · エージェント向け · 仕組み · ブランド
git blame は、行を変更したのが誰かを教えてくれる。 これはエージェントにコードがなぜ存在するのか、何がすでに試されて 却下されたのか、何が真実であり続けなければならないのかを伝える——そして 自身の知識が古くなったことを自覚している。
問題
毎セッション、AIエージェントは記憶なしでやってくる。ファイルを読んで、前のエージェントがすでに知っていたことを再導出する。そして3ヶ月前に却下された修正を再提案する。なぜなら、それが試されたという記録がリポジトリのどこにもないからだ。
高価な知識は決してコードの中にはない:
コードが示すこと | 決して示さないこと |
| なぜか——gitがMCPパイプを継承し、すべての呼び出しを20秒間停止させること |
| ここでの |
コーディネータークラス | Redisミューテックスが最初に試され、パーティションでデッドロックすること |
このサーバーはその層を保存し、コードに結びつけたままにし、もはや保証できないときにそれを伝える。
Related MCP server: lore
クイックスタート
pip install -e .MCPクライアントに一度登録するだけ——2番目のステップはない。管理パネルも、ポートも、デーモンも、リポジトリごとの設定もない。
claude mcp add icn -- infinite-code-next[mcp_servers.icn]
command = 'infinite-code-next'
args = []{ "mcpServers": { "icn": { "command": "infinite-code-next" } } }サーバーは作業ディレクトリから自分がどのリポジトリにいるかを判断し、すべての応答は解決したルートをエコーするので、間違ったワークスペースはすぐに明らかになる。
ループ
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=[...])生産的になるための2回の呼び出し。次のエージェントを賢くするための1回。
ナレッジエクスプローラー
サーバーが知っているすべて——リポジトリ、ファイル、シンボル、メモリ、そしてそれらの間のすべてのエッジ——を1つのインタラクティブなグラフとして。
./explore.sh # macOS / Linux
explore.bat # Windows
icn-explore # if the package is on your PATH上:全グラフ上にエクスポートメニューが開いている状態。
フィルター | ノードタイプ、メモリの重大度、アンカーステータス、またはエッジの種類で——カウントはライブ更新される |
検索 | 名前、パス、または本文のテキストで任意のノードを検索 |
検査 | ノードをクリックすると、完全な本文、メタデータ、およびすべての型付き接続が表示される |
ナビゲート | 任意の接続をクリックしてそこへジャンプ——警告から、それが守るコードへ、それをカバーするテストへ歩いていく |
ズーム&パン | スクロールとドラッグ;ノードサイズは呼び出し次数なので、負荷のかかるコードは負荷がかかっているように見える |
エクスポート | マークダウン、グラフJSON、ページ自体、PNG、または現在画面に表示されているものだけ |
自己完結型:データがインライン化された1つのHTMLファイル。CDNなし、ビルドステップなし、npmなし。保存しても、メールしても、コミットしても——それでも動作する。
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知識の共有
別のコードベースの苦労して得た知識を他の誰かに——または別のエージェントに——渡す。
エクスプローラーから
エクスポートボタンは、ページを離れることなく以下のすべてを提供する。すべてブラウザ内で埋め込まれたグラフに対してオフラインで実行される——サーバー呼び出しはないので、保存されたページでもエクスポートできる。
マークダウン | どこでも読める、そして再インポート可能 |
グラフJSON | ノードとエッジ、生のまま |
このページ | 自己完結型エクスプローラー、誰かに送る用 |
画像 | 現在のビューのPNG |
表示中のコピー | 画面に表示されているものだけ——最初にフィルターと検索を行い、フィルターされたビューが共有可能なサブセットになる |
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マークダウンが正規の共有形式であり、単独で読める——エディタでも、diffでも、wikiでも、プルリクエストでも。ツールなしでは誰も読めないナレッジベースは、誰もチェックしないナレッジベースだ。最後のJSONブロックがインポートをロスレスにする。
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インポートは決して上書きしない。 外部からのすべてはauthority='imported'として、その出所を添えて保存され、ここに一致するシンボルが実際に存在する場所にのみ固定される。あなたが持っていないコードについてのメモリも保存する価値はある——しかし、それが見たこともないスパンを記述していると主張してはならない。
AIエージェント向けガイド
最初の呼び出しの前にこのセクションを読むこと。
1. まずオープン——方向確認のためにファイルを読まない
workspace(action="open")ブリーフィングを返す:このコードを支配するルール、すでに試されて却下されたもの、現在未検証のもの、知識が集中している場所。見出しとIDのみ——本文は含まれず、investigate()は1回の呼び出しで実行できる。
これは測定された失敗が存在するからだ。このサーバーを構築するすべてのセッションは、すでに存在する知識を再導出するためにファイルを読むことから始まった。openはかつてシンボル数を報告していたが、それはあなたが何に足を踏み入れようとしているかを何も教えてくれない。棚に何があるかを知る前に、正しい質問はできない。
2. プレーンな言葉で調査——grepではなく
investigate("I need to change refresh token rotation. What will I break?")1回の呼び出しで、語彙検索、シンボルルックアップ、コードグラフ走査、メモリグラフ走査、アンカーステータス、git履歴を融合し、トークン予算の下でコンパクトなカプセルを返す。コードと知識を一緒に検索するので、警告が存在するファイルに名前を付けなくても、警告があなたを見つける。
引数 | 使用目的 |
|
|
| おおよそのトークン上限(デフォルト9000) |
| コントラクトを他のリポジトリへ追跡する |
| 絞り込まれたサブグラフに対するターゲット診断 |
3. 荷重のかかるものを削除する前に、なぜかを尋ねる
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_regression5つのメモリのフラットなリストでは、ストーリーを再構築しなければならない。チェーンはそれを手渡す。
4. 学んだことを記録する——特に失敗を
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はシステム全体で最も価値の高いフィールドだ。 あなたのツールチェーンの他の何も、試されて却下されたものを記録しない。そしてそれは、将来のエージェントが再発見するのに最もコストがかかるものだ。
record()はprimary_memory——このイベントを表すID——を返す。それを次のcaused_byとして渡す。
フィールド | 記録するもの |
| 真であり続けなければならないこと |
| 将来のエージェントがしてはならないこと |
| 試されて却下されたもの、そしてその理由 |
| 下された選択、そして却下された代替案 |
| 他のコードが依存している前提 |
| セキュリティ関連の事実 |
| 測定されたパフォーマンスの事実 |
| このコードが以前に引き起こしたバグ |
| マイグレーション手順または順序の制約 |
| 従う価値のあるローカルな慣習 |
| コードがこのように形作られている理由 |
| これをカバーするテスト—— |
| クロスリポジトリの依存関係 |
| このイベントが続くメモリID |
5. ラベルを信頼する
すべてのメモリはanchor_statusを持つ。ACTIVE以外のものは、現在のコードに対して検証されていない——それを事実ではなく手がかりとして扱う。
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")仕組み
自分が古くなったことを知るアンカー
メモリはsrc/auth/oauth.ts:193に保存されるわけではない。行番号はレンダリングの詳細だ。各メモリはセマンティックアンカーに付着する:シンボルパス、ASTパス、コンテンツフィンガープリント(構造+識別子)、スケルトンフィンガープリント(構造のみ)、そしてその周囲のコンテキスト。
コードが変更されると、カスケードがアンカーを再配置する——最も安価なテストから最初に:
ステップ | テスト | 結果 |
1 | 同じフィンガープリント、同じ場所 |
|
2 | 同じフィンガープリントが別の場所、 |
|
3a | 同じ場所、スケルトンが同一 — 名前変更 |
|
3b | 同じ場所、構造が変更 |
|
4 | シンボルが消えた、強い類似性マッチ |
|
5 | 基準を満たすものがない |
|
この仕組みを信頼できるものにしているのは、次の2つのルールです。
検証はタイマーではなく、ドリフトを引き起こした編集に対して発火します。
カスケードは信頼を下げることしかできず、上げることは決してありません。 一度
DRIFTEDまたはNEEDS_REVIEWになると、明示的なmemory(action="verify")だけがアンカーをACTIVEに戻します。そうでなければ、次のパスで再アンカーされたばかりのフィンガープリントが一致し、「変更なし」と報告され、誰も確認したことのないメモリが静かに再信頼されてしまいます。
問題検出
investigate() はまずサブグラフに絞り込み、そのサブグラフに対して意図を絞った質問を行います。ワークスペース全体のスキャンは決して行いません。これらがリンターと異なるのは、知識を認識することです。リンターは関数にテストがないことを見ますが、このグラフだけが、その関数が本番インシデント後に記録された不変条件によって管理されていることを知っています。
検出項目 | それが答える質問 |
| どのメモリが、それらが記述するコードからドリフトしたか |
| 呼び出し元がコーディネーターやガードを迂回して到達しているか |
| 管理されたルールがどのテストからも到達可能でないか |
| 非推奨のシンボルにまだアクティブな呼び出し元がいるか |
| 構造的に同一の兄弟がルールを欠いているか |
| コードが決定事項から逸脱したか |
| 2つのメモリが互いに矛盾しているか |
| アクティブな知識が削除されたコードを指しているか |
| クロスリポジトリの依存関係が現在チェック不能か |
| メモリが検証された後に呼び出し元が現れたか |
| コードがカスケードが追従しない場所に移動した可能性があるか |
検出器が失敗しても検索は壊れません。診断は回答を強化するものであり、回答の前提条件ではありません。
ループ内にLLMなし
record() は完全に決定論的です。エンティティ解決、エッジ導出、矛盾検出はグラフ操作であり、モデル呼び出しではありません。APIキーもネットワークもトークンコストもありません。 ランキングは意図ごとの重みを持つ静的で検査可能な式です。新しいローカルインストールには、リランカーを訓練するためのラベル付き関連性データがないからです。
人間の入力方法を許容する検索
完全一致とプレフィックス一致が最初に実行され、何も見つからない場合に近似パスが引き継ぎます。そのため、subproces でも subprocess 警告を見つけられます。ハイフンは両方向で橋渡しされます。reanchor は re-anchor と書かれたテキストを見つけ、その逆も同様です。FTS5 のトークナイザーがハイフンで分割するため、どちらの表記も他方に到達できないからです。
フォールバックは意図的にフォールバックです。FTS ランキングは、ヒットがある場合、ローカルで計算されたものより優れています。そのため、デフォルトでファジーマッチングを実行すると、緩い一致が正確な一致を上回ってしまいます。
ランキングは使用から学習する
すべてのメモリは、表示された回数と、エージェントが完全に開いた回数を追跡します。開くことははるかに重みを持ちます。表示されることはクエリが一致したことを意味するだけですが、開くことはエージェントが見たすべての中からそれを選んだことを意味します。
ブーストは0.5で制限され、45日の半減期で減衰します。頻度は証拠であり、権威ではありません。無制限であれば、先月の人気メモリが昨日記録された重大な警告の上に固定されてしまいます。
ストレージ
%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
cache/repos/<id>/ REBUILDABLE safe to delete at any time
<repo>/.agit/ agent git, gitignored
<repo>/.icn.toml optional, committed, tinyルートを INFINITE_CODE_HOME で上書きします。
アイデンティティはパスでもリモートURLでもありません。両方とも可変だからです。ルートコミット、オプションのコミットされたプロジェクトID、正規化されたリモートから導出されるため、クローンを移動したり git remote set-url を実行したりしても、既存の知識に再アタッチされます。フォークはアップストリームのルートコミットを共有するため、アップストリームのメモリを黙って継承するのではなく、明示的に分割されます。
何も破壊されない
削除されたシンボルは、最後に知られていたパスと、それらを削除したコミットとともにトゥームストーンになります。
エッジは
valid_from_commit/valid_until_commitを持ち、消えるのではなくHISTORICALになります。消えたチェックアウトは
MISSING、マウントされていないドライブはOFFLINEです。どちらも何も削除しません。修正は以前のテキストをバージョン管理します。置き換えは両方のメモリとそれらの間のリンクを保持します。
エージェントは人間が作成したメモリを書き換えることはできません。置き換える必要があり、不一致を可視化したままにします。
purgeは唯一の破壊的操作であり、confirm=Trueが必要です。
ルックアップは、例外を決して発生させないリゾルバーを通過します。「現在解決できません」は、最後に知られていた情報とともにデータで返されます。
ブランド
マークは製品の唯一のアイデアです。知識(バイオレット)がコード(グリーン)にアンカーされており、コードはそれについての記憶を持ちません。リングは開いたままです。知識の検証が完了することは決してないからです。
ストロークの太さは、16px のファビコンでも形状が保たれるように設定されています。メモリノードが支配的なままで、リングがぼやけても3つのアンカーが三角形として読めることができます。
Hex | 意味 | |
| メモリ、アンカリング — 知識 | |
| シンボル、テスト — 検証済みコード | |
| ファイル — 構造 | |
| リポジトリ、注意 | |
| クリティカル、因果チェーン | |
| カード表面 | |
| グラウンド |
UI全体を支配するルールは一つです。構造は静かに、知識は目立つ。 CALLS と DEFINES は背景に退き、アンカーと因果エッジ — 他のツールが表示できないもの — が色を担います。
アセットは assets/ にあります。エクスプローラーのソースは 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文字列リテラルではなく実際の .html、.css、.js を使用するため、エディターはそれらを本来のものとして扱います。公開されたページが単一の自己完結型ファイルである必要があるため、レンダリング時にインライン化されます。
ツール
ツール | アクション |
|
|
| search · |
| 1つのイベント → 多くのアンカーされた事実 |
|
|
|
|
agit はエージェントのチェックポイントを .agit/ に保持し、ユーザーの .git とは完全に分離されています。リスクのある作業をチェックポイントし、復元し、ユーザーの履歴には決して触れません。
テスト
python -m pytest172のテスト、stdio で実際のサーバーを起動し、ワイヤープロトコルを通じて完全なエージェントワークフローを駆動するライブ MCP スイートと、未コミットの編集でカスケード動作を検証するダーティワークツリーハーネスを含みます — 再フォーマット、名前変更、本文の変更、ファイル間移動、削除、弱いマイグレーション。
この手法は公開された文献では検証されておらず、文献は事後的なコミット履歴マイニングのみを測定するため、ここで直接測定されます。
ライブテストはその価値を証明します。プロセス内テストでは見えないバグを発見しました。サブプロセス呼び出しがサーバーの stdin を継承しており、これは まさに MCP プロトコルパイプです。Git は、すべてのツール呼び出しで20秒のタイムアウト全体にわたってそれでブロックされ、プロトコルバイトを飲み込む可能性がありました。修正により、ツールのレイテンシは 20秒から0.2秒 に短縮されました。
実際の4,621ファイルのリポジトリで測定
フルインデックス | 593秒 → 34,747シンボル、58,857エッジ、43,038コールエッジ |
ウォームオープン | 0.77秒 |
クエリ | 1.48秒 |
デザイン
各決定の背後にある理由は、それが管理するコードの隣にあります。すべてのモジュールの docstring は、それが何をするか、そしてより重要なことに、どの失敗を防ぐために存在するかを述べています。anchors.py はカスケードが信頼を下げることしかできない理由を説明し、briefing.py は open が要約を提供する理由を、causal.py は因果関係が推論ではなく断言される理由を説明します。
計画ノートはローカルに保持され、出荷される成果物には含まれません。
作者: Ranit Bhowmick
エージェントがコードベースを理解するために読まなければならなかったなら、その知識はセッションとともに失われます。これがその修正です。
Available Tools
10 toolsagitA
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
Scored across 10 tools
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.
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.
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.
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
Related MCP Connectors
Evidence-backed project memory and checkpoints for AI coding agents.
Persistent memory, inline redaction, per-agent access, and code localization for AI agents.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared, scoped, reviewable team memory for AI coding agents.
Related MCP Servers
- -licenseBqualityNot gradedmaintenanceA 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.2726 npm-
- AlicenseNot gradedqualityDmaintenanceEnables 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 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides 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.1MIT
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for coding agents and grounds their claims by verifying against the actual codebase, preventing hallucinated responses.Apache 2.0