AMLink
Allows AI agents to find and resume sessions from Google Antigravity by indexing its local summaries and transcripts, returning a condensed resume payload.
Allows AI agents to find and resume sessions from OpenAI Codex by indexing its local state database and rollout logs, returning a condensed resume payload.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AMLink resume the Codex session about the paywalls audit"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AMLink — Agent Memory Link
A local MCP server that lets any AI coding agent instantly find and resume a session created in another agent.
You work across several coding harnesses — Google Antigravity, OpenCode, ZCode, OpenAI Codex — and when you hit a rate limit on one, you switch to another and keep going. The catch: every harness stores its sessions in its own corner of the disk (SQLite, JSONL, protobuf…), so the new agent starts blindly running find / grep / recursive scans just to locate the session file — burning time and tokens before any real work happens.
AMLink kills that step. A local MCP server indexes all your harnesses' sessions read-only, with zero LLM tokens, and injects a compact, ready-to-resume payload straight into the new agent's context.
┌─────────────┐ "resume the Codex session 'audit paywalls'"
│ Receiving │ ─────────────┐
│ agent │ ▼
│ (ZCode, …) │ locate_and_load_session() ┌────────────────────────────┐
└─────────────┘ 100% local search │ Read-only index │
▲ SQLite / JSONL / protobuf │ ~/.codex (state db) │
│ │ ~/.local/... opencode.db │
└──────────── compact Markdown/YAML ◀──────────│ ~/.zcode (db.sqlite) │
payload (objective, files, │ ~/.gemini (brain/) │
recent turns, next step) └────────────────────────────┘Highlights
🔌 One server, four harnesses — Codex, OpenCode, ZCode, Antigravity adapters out of the box
🪙 0-token search — everything is indexed locally (native SQLite/JSONL parsing, no LLM calls, no
find/grep)🎯 Find sessions any way you remember them — session ID (partial works), exact/fuzzy title, project, or
latest📦 Compact resume payload — objective, last exchanges, files touched, todos, and the last agent message — with hard size caps per section
🧹 Noise-filtered — injected
AGENTS.mdblocks,<environment_context>, system reminders and sub-agent chatter are stripped out🔒 Strictly read-only — harness databases are opened with SQLite
mode=ro(with a temp-copy fallback for orphaned WALs); nothing is ever written back🛠 Self-installing — one idempotent command wires the MCP server + anti-waste directives into all four harnesses, with
.bakbackups⚡ Fast — ~0.1 s per harness to index, stdio transport (no ports, no daemon)
Related MCP server: voyager-mcp
Quick start (uv, not pip)
git clone <your-repo-url> AMLink && cd AMLink
uv sync # creates .venv, installs fastmcp
uv run server.py --selftest # validates all 4 adapters against your real data
uv run install.py # wires MCP configs + skills + directives (backups .bak)Then restart each harness so it picks up the server, and just ask:
"reprends la session latest" / "resume the Codex session about the paywalls audit"
uv run install.py --detect # preview targets, change nothing
uv run install.py --uninstall # cleanly remove everything it addedMCP tools
Tool | Description |
| The main tool. |
| Quick index listing (id, title, project, last activity) to disambiguate a vague reference. |
| Unified checkpoint written to |
| Force an index rebuild (normal cache expires after 60 s or as soon as a source's mtime changes). |
What gets injected — and what doesn't
Each session is condensed into a small Markdown/YAML payload — typically 4.5–8.5 KB on real data (versus a 13,500-character raw prompt or a megabyte-scale SQLite database). It contains: metadata (harness, session id, project, dates, model, git branch), the objective (the real first user message), the last exchanges, the last executed commands, files touched with per-file operation counts, remaining todos, and the last agent message as the resume point.
Deliberately excluded (this is where the token savings come from): harness-injected blocks (# AGENTS.md instructions, <environment_context>, <app-context>, system reminders), raw tool outputs and diffs (only paths + counters survive), the full message history beyond the last N exchanges, and sub-agent sessions.
Detail levels
|
|
| |
Initial prompt | 600 chars | 1,500 | 4,000 |
Recent exchanges | 3 × 300 chars | 6 × 600 | 12 × 1,200 |
Files listed | 15 | 40 | 100 |
Recent actions | — | 5 | 10 |
All caps are editable in config.json → payload_limits.
Where AMLink reads (read-only)
Harness | Index (titles, projects, dates) | Detail (messages, files) |
Codex |
| rollouts |
OpenCode |
|
|
ZCode |
|
|
Antigravity |
|
|
Notes: Antigravity's conversation .db files are opaque protobuf blobs, so AMLink never parses them — titles come from the summaries protobuf and content from the readable transcripts. Antigravity "files touched" are files mentioned in the transcript (labeled as such in the payload). Codex reasoning is encrypted by OpenAI and is not (and cannot be) injected.
What install.py wires up
Every entry points to the uv-managed venv Python via absolute path, so launching works from any working directory.
Harness | File | Entry |
Codex |
|
|
OpenCode |
|
|
ZCode |
|
|
Antigravity |
|
|
Transport is stdio: each harness spawns its own instance — no ports, no shared state. Alternative launch: uv run --project /path/to/AMLink server.py.
Anti-waste directives
The installer also injects strict rules so agents use the bridge instead of crawling the disk:
ZCode: skill at
~/.agents/skills/session-bridge/SKILL.mdCodex / OpenCode / Antigravity: a marked section in each
AGENTS.md(~/.codex/,~/.config/opencode/,~/.gemini/); per-workspace alternative: copy it into.agentrules
The rules: (1) never search for a session with find/grep/recursive ls/disk scans; (2) call locate_and_load_session as soon as a previous session/ID/title from another agent is mentioned; (3) resume work immediately upon receiving the payload; (4) offer a save_active_session checkpoint before an interruption.
OS-specific default paths
Everything can be overridden in config.json (~ is supported). Defaults:
Source | Linux / macOS | Windows |
Codex |
|
|
OpenCode DB |
|
|
ZCode DB |
|
|
Antigravity |
|
|
Checkpoints / cache |
| same |
On Windows use forward slashes in config.json (C:/Users/name/…); the venv Python is .venv/Scripts/python.exe (handled automatically by install.py).
CLI (debug, outside MCP)
uv run server.py --search "impression ticket"
uv run server.py --search latest --harness codex --detail minimal
uv run server.py --list --harness zcode --limit 10
uv run server.py --selftest
uv run server.py --detectSecurity notes
Harness databases are opened strictly read-only (
file:…?mode=ro, temp-copy fallback for orphaned WALs) — AMLink never writes to them.~/.zcode/cli/config.jsoncontains an API key: the installer preserves it without ever displaying it, and the MCP server never returns config file contents.Payloads contain your own session content; nothing leaves your machine.
Troubleshooting
A harness doesn't see the server — restart it after
install.py; checkuv run server.py --detectand that.venv/bin/pythonexists (uv sync).Session not found — refine the title, or call
list_sessions; a partial ID (8 chars) is enough; callrefresh_index()if the session just ended.Odd Codex title — raw titles come from Codex's own database; the generated title (
session_index.jsonl) is preferred for display, and both are searched.Antigravity — conversation
.dbfiles are opaque protobuf; the bridge uses readablebrain/transcripts + summaries.pb. "Files touched" are transcript mentions, not a guaranteed exhaustive list.
Project structure
AMLink/
├── server.py # FastMCP server (stdio) + debug CLI
├── config.json # paths + payload limits (overridable)
├── adapters/ # one adapter per harness + checkpoints
│ ├── base.py # SessionRecord, read-only SQLite helpers
│ ├── codex.py # state db + rollout JSONL
│ ├── aifamily.py # shared OpenCode/ZCode schema
│ ├── opencode.py / zcode.py
│ ├── antigravity.py # transcripts + protobuf wire walker
│ └── checkpoint.py # save_active_session
├── formatter.py # compact Markdown/YAML payload
├── indexer.py # fuzzy search (accent/case-insensitive) + mtime cache
├── install.py # integration install/uninstall (with .bak backups)
├── ROADMAP.md # improvement axes & final verdicts (decision log)
└── skills/session-bridge/SKILL.mdRoadmap
Planned and rejected axes live in ROADMAP.md with their verdicts — top candidates: full-text search across session content, and cross-harness session lineage.
Available Tools
4 toolslist_sessionsList SessionsA
List indexed sessions (id, title, project, last activity). Useful to pick a session before calling locate_and_load_session.
Inputs: limit, harness, project. Returns: result
locate_and_load_sessionLocate And Load SessionA
Locate a session from another harness and return a condensed, ready-to-resume payload (objective, recent exchanges, files touched, next step). 100% local search, zero LLM tokens.
Inputs: query (required), detail, harness. Returns: result
refresh_indexRefresh IndexA
Force a rebuild of the session index (e.g. right after a large session has just finished).
Inputs: no named parameters. Returns: result
save_active_sessionSave Active SessionA
Save a checkpoint of the current session (unified checkpoint) so another harness can retrieve it via locate_and_load_session.
Call it before stopping (rate limit reached, end of session).
Inputs: title (required), summary (required), project, next_steps, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: saving, listing, loading, and refreshing index. No overlap or ambiguity exists, making tool selection straightforward for an agent.
All tool names follow a consistent verb_noun snake_case pattern (locate_and_load, list, save_active, refresh). This predictable naming reduces cognitive load and improves discoverability.
With only 4 tools, the server is tightly scoped to session management. Each tool addresses a necessary step in the workflow, and none are redundant or trivial.
The set covers the full lifecycle of session persistence: save, locate, list, and maintain index. There are no obvious gaps that would prevent an agent from completing the core task of transferring sessions between harnesses.
Maintenance
Related MCP Connectors
Sync coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
One shared project memory for your AI coding tools: recall, save and brief decisions anywhere.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to collaborate on the same project by sharing session briefs and reading each other's native transcripts, memories, and instructions in place, with zero-copy, across different agent tools.22 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to query a unified local index of all their sessions through native tools, supporting session summaries, full-text search, listing, message timelines, and handoff context packages for another agent.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to keep sessions short by compacting early, saving a handoff and restoring it afterwards, while automatically recalling relevant project knowledge on every request. It exposes a code map ranked with PageRank and a temporal knowledge graph of decisions, bugs, gotchas and concepts, searched with hybrid BM25, Personalized PageRank and Reciprocal Rank Fusion within a token budget.14MIT
- AlicenseAqualityBmaintenanceEnables MCP-capable coding agents to semantically search, store, and inspect a single local, cross-tool index of session histories and project docs. Agents can retrieve what other tools and prior sessions already discovered.31MIT