ltm
Portable memory protocol for AI coding sessions. Push the state of a session (goal, decisions, attempts, next step) from one MCP-capable agent and pull it back from another.
README
ltm
Git captures what a project is. ltm captures what it ran into: the dead ends, the arguments you had with the model and lost, the constraints that shaped the current code without ever appearing in it.

That second layer is the part agents can't reconstruct from a repo. A fresh session on a different harness, a different machine, or just Monday morning starts from the diff and re-learns the rest by making the same mistakes. ltm is the smallest useful thing that stops that: a small JSON protocol (the Core Memory Packet) plus a CLI and server to move packets between sessions.
A packet is a short dossier on one obstacle. Goal, decisions you've locked in, what you've already tried, what the next step is. Five required fields. Typical size: 2 to 5 KB. Forward-compatible. The 90% of work that went smoothly never needs a packet, because the commit log already carries that.
The common path
# End of a session, agent emits a packet, redaction-checked, pushed.
ltm save
# Start of the next session, on any machine, in any harness.
ltm resume
# ✓ resume block copied to clipboard. Paste into your agent session.
MCP-aware agents call save and resume as tools directly; see Wire it into your agent below.
Install
# macOS, Linux. amd64 and arm64.
curl -fsSL https://ltm-cli.dev/install | sh
Or from a checkout: go build -o ltm ./cmd/ltm.
See what a resume looks like
No server, no account, no auth. One command runs the whole flow against an embedded sample packet and drops a resume block on your clipboard.
ltm example --resume
This is the same flow the demo above is showing. It's the fastest way to decide whether ltm is worth the next five minutes.
Use it
# Sign in. Three supported forms.
ltm auth # managed hub (OAuth device flow)
ltm auth https://your-server.example # self-hosted, if the server speaks RFC 8628 device flow
ltm auth https://your-server.example <token> # paste a pre-issued bearer token (what the reference ltm server wants)
# Daily driver.
ltm save # session to packet to push, in one step
ltm resume # interactive picker, copies to clipboard
ltm resume <id> # skip the picker, print to stdout
# The usual CRUD when you need it.
ltm ls
ltm show <id>
ltm pull <id>
ltm rm <id>
# Handy.
ltm example # print a valid packet, no server required
ltm update # upgrade in place
Teams
Share packets with a fixed set of people on the same server. Membership is granted through a single-use invite URL that expires in 7 days.
ltm teams create alpha
ltm invite -t alpha # prints a URL to share
ltm push packet.json -t alpha # push into the team, not personal
ltm ls -t alpha
On the invitee's machine: ltm join <url>.
Wire it into your agent (MCP)
ltm mcp speaks the Model Context Protocol over stdio. It exposes the client verbs (save, resume, ls, show, pull, push, rm, example, whoami) as tools, and it reuses whatever ltm auth already stored. No second credential surface.
# Claude Code.
claude mcp add ltm -- ltm mcp
# Cursor, Zed, Claude Desktop, Continue. Paste into the client's MCP config:
# { "ltm": { "command": "ltm", "args": ["mcp"] } }
Once registered, the agent saves at the end of a session and resumes at the start of the next. You never type an ID.
Run your own server
One Go binary, SQLite on disk, bearer-token auth. HTTPS is your job: Caddy, nginx, a reverse proxy of your choosing.
ltm server init --db ~/.local/share/ltm/ltm.db # prints the root token, once
ltm server --addr :8080
ltm server issue-token laptop # name one token per machine (laptop, ci, ...)
The reference server is bearer-token only. It does not implement OAuth device flow (RFC 8628) today, so clients pointed at it should use ltm auth <host> <token>. The managed hub implements device flow through Doorkeeper; a second implementation of the ltm protocol is free to do the same, and ltm auth <host> will then work against it.
Packets travel. Secrets don't.
The core promise is that packets move between machines, teams, and agents, which means what travels with them has to be something you actually meant to send. Every packet is scanned before it leaves your machine. Any hit blocks the push unless you opt in with --allow-unredacted.
The pre-flight refuses absolute paths (POSIX and Windows), AWS access keys and ARNs, GitHub tokens, JWTs, private-key headers, Google API keys, Slack tokens, Stripe keys and webhook secrets, and SSH public keys. It inspects only the spec's travelable text fields (goal, next_step, constraints, decisions.*, methods.*, attempts.*, open_questions). Structure carries no content; content is where the leaks are.
This is load-bearing, not cosmetic. The person writing the packet is not always the person reading it. Full pattern list and rationale in SPEC.md.
Principles
- Intent is portable; configuration isn't. Packets never carry your CLAUDE.md, skills, prompts, or tool setup.
- Self-host or nothing. If it doesn't run on a $5 VPS, it's not done.
- Model-agnostic. A packet written by Claude is readable by GPT, Gemini, or whatever comes next.
- Spec first, code second. The protocol is the product; the CLI and server are reference implementations.
- Redact aggressively. Secrets and local state never ride along.
What's not here yet
Direct share-by-username between users (targeted peer-to-peer hand-off, distinct from the public-link sharing ltm publish already provides), federation. Windows binaries (Linux and macOS only, amd64 and arm64). A portable conformance suite for second implementations; the Go reference tests stand in for one today. A fuzz and end-to-end harness on top of the existing unit and integration tests. Chaining is defined in the v0.2 schema (parent_id) but the server doesn't surface it yet.
How this is built
ltm is written with LLM assistance, and says so out loud. A human drives the design, writes the prose, reviews every line, and is accountable for what lands; a coding agent helps with implementation. Commits touched by an agent carry an Assisted-by: trailer naming the tool — the same convention as the Linux kernel's AI Coding Assistants policy. Disclosure, not disguise.
If you send a PR that an LLM helped write, do the same: add an Assisted-by: trailer, read the diff as if you'd written it yourself, and own it. Details in CONTRIBUTING.md.
Further reading
SPEC.md for the wire format and packet schema. RESEARCH.md for the literature review that shaped v0.2 (agent memory, prompt compression, case-based reasoning, ADRs). CONTRIBUTING.md for how to propose changes and how to port a second implementation. SECURITY.md for reporting issues.
Status
Pre-alpha. The spec is a draft; breaking changes are on the table before v1.0. Pin against ltm_version when you write a packet.
License
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。