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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.