Waymark
Shared memory and handoff hub for AI agents, enabling seamless context transfer between sessions with token-budgeted resumes and automatic handoffs.
README
Waymark
Shared memory and handoff hub for AI agents. A waymark is a trail sign left for whoever walks the path next — Waymark does the same for agent sessions: Claude Code finishes work, and the next session of Codex, Claude Desktop, or any other MCP client starts already knowing what was done, what was decided, and what to do next.
No retelling. No re-reading the repo. One token-budgeted call.
Why
Every new agent session starts cold: it re-reads files, re-asks questions, and burns tokens rediscovering context that another agent had five minutes ago. Waymark replaces that with a local MCP server over a single SQLite database shared by all your agents:
workspace_resume— one call returns a compact packet (project metadata, open tasks, ranked memory, recent sessions, active handoff) within a token budget you set (default 1,200 tokens).- Automatic handoffs —
session_log(outcome: "partial", next_steps: [...])writes a handoff memory that tops the next agent's resume. Loggingcompletedretires it. No discipline required. - Task queue with atomic claims —
task_claimguarantees only one agent takes a task, with capability and dependency checks. - Memory lifecycle — supersede instead of accumulate; feedback ratings demote stale records in ranking.
- Provider-neutral — agents register with provider/model/client identity; nothing in the core is tied to one vendor.
Measured savings
Continuation scenario (fresh session must orient in a project and name the next
step), estimated cohort, reproducible via node scripts/benchmark-orientation.cjs:
| median tokens | |
|---|---|
| Cold orientation (reading README, docs, sources, git log) | 13,540 |
| Waymark resume (packet + core tool schemas + follow-up reads) | 3,392 |
| Net saving | 74.9% |
The orientation context itself shrinks from ~13.1k tokens of raw files to a 1.1k-token ranked packet (−91.5%) — and unlike cold reading, the packet contains what files can't: what the previous agent actually did and decided. The exact-token A/B protocol with live clients is in docs/BENCHMARK_RUN.md.
Quick start
Requires Node.js 22+.
git clone <this-repo> waymark && cd waymark
npm install
npm run build
npm test # 19 integration tests
Connect Claude Code (stdio)
claude mcp add --scope user waymark node "<path-to>/waymark/dist/server.js"
Optional but recommended — auto-inject the resume packet into every new session
via a SessionStart hook (zero tool calls spent on orientation), see
scripts/hooks/session-start-resume.cjs.
Connect Codex
# ~/.codex/config.toml
[mcp_servers.waymark]
command = "node"
args = ["<path-to>/waymark/dist/server.js"]
Connect Claude Desktop / web (HTTP)
node dist/server.js --http # listens on 127.0.0.1:3747
Add a custom connector: http://localhost:3747/mcp. Also available via
docker compose up -d / podman compose up -d.
The protocol
Session start — one call, not three:
workspace_resume(project_id, task?, agent_id?, max_tokens=1200)
Session end:
session_log(started_at, summary, outcome, next_steps?) # partial/blocked → auto-handoff
memory_write(...) # only durable decisions/facts
Cross-agent handoff happens automatically: agent A logs a partial session
with next_steps; agent B's workspace_resume surfaces that handoff first,
with the session trail and files touched. When someone logs completed, the
handoff retires itself.
Tool profiles
Greedy MCP clients inject every tool schema into context each turn. Waymark
defaults to a core profile of 10 tools (~1.8k tokens instead of ~4.7k for
all 28). Set HUB_TOOLS=full where you need the admin surface (projects,
agents, experiments, telemetry).
Tools (28)
| Group | Tools |
|---|---|
| Context | workspace_resume, context_get |
| Memory | memory_write/read/list/search/set_status/feedback |
| Tasks | task_create/list/update/claim/release/add_dependency |
| Projects | project_list/get/upsert/set_status |
| Agents | agent_register/get/list/set_status |
| Sessions & telemetry | session_log, usage_report, experiment_create/list/update/summary |
Deep dives: docs/CONTEXT.md, docs/MEMORY_LIFECYCLE.md, docs/TASK_COORDINATION.md, docs/BENCHMARKING.md.
Dashboard
npm run dashboard → read-only web panel on http://localhost:4747: projects,
tasks, memory (FTS search), sessions, agents, benchmark results. Opens the DB
in read-only mode — it physically cannot mutate hub state.
Architecture
src/server.ts entry point: stdio / HTTP (--http), tool profiles
src/db/client.ts SQLite singleton (WAL) + idempotent migrations 001..005
src/tools/ projects · memory · tasks · sessions · agents · context · telemetry
src/context/builder.ts deterministic ranking + token budget (no LLM calls)
src/cli/benchmark.ts A/B experiment CLI
dashboard/ read-only Express panel
Storage: SQLite + FTS5. The core never calls an LLM or any external service.
Principles
- Context on demand — summaries + ids by default; bodies only when asked.
- Budget first — every aggregated response fits a token budget.
- Evidence over retelling — link files/commits/tasks instead of copying text.
- Replace, don't accumulate — supersede outdated memory, no duplicates.
- Provider-agnostic — any MCP client is a first-class citizen.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。