handoff-mcp
Provides persistent memory for AI coding agents across sessions by saving and loading session context like tasks, decisions, and blockers.
README
handoff-mcp
An MCP server that gives AI coding agents persistent memory across sessions.
When you close a Claude Code session and start a new one, the new session has no idea what the previous one was doing. handoff-mcp solves this by saving session context — tasks, decisions, blockers, and file pointers — to a local .handoff/ directory that the next session can load automatically.
The Problem
AI coding sessions are stateless. Every new session starts from zero:
- "What was I working on?" — the agent doesn't know
- "What decisions were made?" — lost with the previous context window
- "What's left to do?" — you have to re-explain everything
This gets painful fast on multi-session projects.
How It Works
Session 1 Session 2
┌──────────────┐ ┌──────────────┐
│ Working... │ .handoff/ │ Loading... │
│ │──────────────────>│ │
│ save_context │ tasks/ │ load_context │
│ - summary │ sessions/ │ - tasks │
│ - decisions │ config.toml │ - decisions │
│ - blockers │ │ - blockers │
│ - tasks │ │ - git state │
└──────────────┘ └──────────────┘
At session end, the agent calls handoff_save_context to persist what matters. At session start, it calls handoff_load_context to pick up where things left off.
Installation
npm (recommended)
npm install -g handoff-mcp-server
Build from source
git clone https://github.com/alphaelements/handoff-mcp.git
cd handoff-mcp
cargo build --release
Setup
Add to your Claude Code MCP configuration:
Global (~/.claude/.mcp.json) — available in all projects:
{
"mcpServers": {
"handoff": {
"type": "stdio",
"command": "handoff-mcp",
"args": []
}
}
}
Per-project (.mcp.json in project root):
{
"mcpServers": {
"handoff": {
"type": "stdio",
"command": "handoff-mcp",
"args": []
}
}
}
Quick Start
-
Initialize a project:
The agent calls
handoff_initwith your project name. This creates a.handoff/directory:.handoff/ ├── config.toml # Project settings ├── sessions/ # Session history (TOML files) └── tasks/ # Task tree (directories + TOML files) -
Work normally — create tasks, track progress, make decisions.
-
Save context at session end — the agent captures a summary, decisions, blockers, and references.
-
Load context at next session start — the agent reads back everything and resumes.
Add
.handoff/to your.gitignore— it contains local working state, not code.
Tools
| Tool | Purpose |
|---|---|
handoff_init |
Initialize .handoff/ directory for a project |
handoff_load_context |
Load session context, tasks, and git state at session start |
handoff_save_context |
Save session summary, decisions, blockers, and references |
handoff_list_tasks |
List tasks with optional status filter |
handoff_update_task |
Create, update, or move tasks in a hierarchical tree |
handoff_get_config |
Read project configuration |
handoff_update_config |
Update project configuration |
handoff_dashboard |
Overview of all handoff-enabled projects |
Task Management
Tasks are stored as a directory tree, supporting hierarchical structures:
tasks/
├── 01-todo--implement-auth/
│ ├── task.toml
│ ├── 01.1-done--design-schema/
│ │ └── task.toml
│ └── 01.2-in_progress--write-handlers/
│ └── task.toml
└── 02-blocked--deploy-staging/
└── task.toml
Statuses: todo | in_progress | review | done | blocked | skipped
Each task can have:
- Priority (
low/medium/high) - Labels
- Done criteria (checklist items)
- Links to issues, MRs, or docs
- Notes
Session Context
When saving context, the agent can record:
- Summary — one-line description of what happened
- Decisions — what was decided and why, with confidence levels (
confirmed/estimated/unverified) - Blockers — what's preventing progress
- Checklist — items for the next session
- Handoff notes — categorized as
caution,context, orsuggestion - References — links to files, issues, MRs, wiki pages, or URLs
- Context pointers — specific files and line ranges the next session should look at
- Git state — current branch, recent commits, and dirty files (captured automatically)
Dashboard
handoff_dashboard scans directories for projects with .handoff/ and shows a summary:
## my-project (3 tasks)
- [in_progress] Implement auth (high)
- [todo] Add tests (medium)
- [blocked] Deploy staging (medium)
## other-project (1 task)
- [review] Update README (low)
Configuration
.handoff/config.toml:
[project]
name = "my-project"
description = "Project description"
[settings]
history_limit = 20 # Max closed sessions to keep
done_task_limit = 10 # Max completed tasks to show
auto_git_summary = true # Capture git state automatically
[dashboard]
scan_dirs = ["~/pro/"] # Directories to scan for dashboard
MCP Resources
| URI | Description |
|---|---|
handoff://sessions |
Active session data (JSON) |
handoff://config |
Project configuration (TOML) |
Recommended CLAUDE.md Setup
Add the following to your project's CLAUDE.md so the agent uses handoff consistently:
## Session Handoff
This project uses handoff-mcp for session continuity.
- **Session start**: Call `handoff_load_context` to load previous session state.
If not initialized, call `handoff_init` with the project name.
- **Session end**: Call `handoff_save_context` with a summary, decisions, and blockers.
- **During work**: Use `handoff_update_task` to track progress.
Mark tasks `in_progress` when starting, `done` when complete.
- **Decisions**: Record decisions with confidence levels as they are made,
not just at session end. Use `confirmed` for verified facts, `estimated`
for reasonable assumptions, `unverified` for unknowns.
Skill File (Optional)
This repository includes a skill file at skills/handoff/SKILL.md that makes handoff behavior automatic in Claude Code. Copy it to your user skills directory:
cp -r skills/handoff ~/.claude/skills/
This teaches the agent to automatically load context at session start, track tasks during work, and save context at session end.
Compatibility
- Claude Code — fully supported (stdio transport)
- Other MCP clients — any client supporting the MCP stdio transport
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。