ctxfile
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
One context, every agent, all local.
Website ·
Docs ·
Quickstart ·
Clients ·
The .ctxfile convention ·
Security
---
You work with more than one AI agent. Claude Code in the terminal, Cursor in the editor, a chat tab for thinking. Each one starts cold, because your working state (the plan, the key files, the git state, what you decided an hour ago) lives in your head and in scrollback.
**ctxfile** is a local-first MCP server that snapshots your project's working state into one structured context object, and hands it to any MCP agent in a single call. Save a session in one agent, continue it in another. Nothing leaves your machine.
30-second quickstart
**Claude Code**
**Cursor** (.cursor/mcp.json in your project, or ~/.cursor/mcp.json globally)
**Codex CLI**
**Claude Desktop** (no terminal needed): download ctxfile-macos-arm64.mcpb and drag it into Settings → Extensions. The bundle carries a compiled native module, so it is macOS (Apple Silicon) only for now; on Windows or an Intel Mac, add the stdio JSON above to claude_desktop_config.json instead.
**Every other client**: ctxfile is a standard stdio server, so npx -y ctxfile is the whole command. Copy-paste setup for **OpenCode, Gemini CLI, OpenClaw, Hermes, Aider**, and more is on the per-client tabs at ctxfile.dev/docs/clients.
Then, in your agent: *"load my context"* (or call get_context). Requires Node ≥ 20 (≥ 22 on Windows).
Make it automatic
You stop typing "save this." One command installs a **skill** that teaches any agent, while doing its normal work, *when* to checkpoint context and to announce every save (never silent, paused any time, reviewable always):
It renders from one canonical spec into whatever each harness reads: an Agent SKILL.md for **Claude Code, OpenCode, OpenClaw, and Hermes** (one portable file across all four skill systems), a **Cursor** rule, and managed **GEMINI.md** / **AGENTS.md** blocks. Details at ctxfile.dev/docs/automatic.
It follows you into the chat tabs, too
The same context your CLI and editor agents load over MCP can travel to web chatbots. Connect **Grok, ChatGPT, Claude web, or Perplexity** to your encrypted Sync vault as a custom MCP connector, or ctxfile export and paste the envelope into any prompt box (Gemini, and anything else). Walkthrough: ctxfile.dev/docs/webchat.
Private by default
This is the part we care about most, so it goes first:
- The default path makes **zero network calls**. Files and git only.
- Secret-looking content (cloud keys, tokens, private keys, JWTs, password= assignments) is **redacted before it enters the snapshot**. .env*, key files, and credential files are never read at all.
- Core is **read-only** over your project. It never writes to your repo, your git state, or anything else.
- **No telemetry by default.** An anonymous weekly install ping exists, and it is opt-in only.
- Network connectors (Notion, local Ollama summarization, Sync) activate only when you explicitly configure them.
The full model, including what Pro and Sync add and what they can never see, is documented at ctxfile.dev/security.
What it does
| | |
|---|---|
| **Snapshot** | get_context returns one structured ContextObject: plan docs, ranked key files fitted to a token budget, git state, optional Notion pages and local-LLM summary. |