Multi-agent shared brain across Claude Code/Desktop, Codex, Gemini, Copilot, VS Code. Cross-session memory, self-improving skill loops, inter-agent signaling — one local MCP server.
claude mcp add thread-keeper -- python -m --upgrade{
"mcpServers": {
"thread-keeper": {
"command": "python",
"args": ["-m", "threadkeeper.server"]
}
}
}MCP Servers overview
# thread-keeper [](https://github.com/po4erk91/thread-keeper/actions/workflows/test.yml) [](https://www.python.org/downloads/) [](LICENSE) [](https://pypi.org/project/threadkeeper/) [](#multi-cli-integration) **Multi-agent shared brain across Claude Code/Desktop, Codex, Antigravity CLI (`agy`), Gemini legacy, Copilot, and VS Code.** Cross-session memory, self-improving skill loops, and inter-agent signaling — one local MCP server turns parallel agent instances into a coordinated multi-agent system instead of N isolated chats. Every connected client (Claude Code, Claude Desktop, Codex CLI + desktop, Antigravity CLI, Gemini legacy, Copilot, every MCP-aware VS Code extension) shares one SQLite store, one set of threads, one user model, and one learning loop that improves the skill library autonomously over time. The brief format is dense — structural tags, opaque IDs, ~6 KB per session-start injection. Optimized for agent consumption, not human reading. --- ## Why Every agent CLI starts cold. Context dies at session boundaries. Skills you taught Claude don't transfer to Codex. Threads you closed in yesterday's Antigravity chat are invisible to today's Copilot. Parallel agent instances running the same task don't know about each other and duplicate work or step on each other's writes. thread-keeper is the substrate underneath. Three things that together make it more than a memory store: - **Collective memory** — threads, notes, verbatim quotes, dialectic claims about you. Survives session, restart, CLI swap. One agent records, every other agent (any CLI) reads. The brief injected at session start gives a new agent everything the previous one knew. - **Multi-agent coordination** — `spawn` primitive launches child agents in parallel, each gets a self_cid + sees the same memory. `broadcast` / `whisper` / `inbox` / `wait` / `ask` / `respond` let concurrent sessions signal each other across CLIs. Parent / children / sibling agents become a coordinated swarm, not isolated chats. - **Self-improving skill library** — autonomous background loops (auto-review on thread close, shadow-review daemon, extract harvester, candidate-reviewer, weekly Curator, and a thread-janitor that auto-closes idle threads so abandoned work reaches the harvest path — closing is reversible, a note reopens a closed thread) materialize class-level skills as the agents work. Adapted to multi-CLI: SKILL.md is the primary write target and gets mirrored to every known/configured skills root simultaneously (`~/.claude/skills/`, `~/.codex/skills/`, `~/.gemini/config/skills/` for Antigravity, existing `~/.agents/skills/`, extra roots from `THREADKEEPER_EXTRA_SKILLS_DIRS`, and `~/.threadkeeper/skills/`), with lessons.md as a fallback for CLIs without a native skills loader. Foreground MCP servers also run a daily self-update check by default. Source checkouts fast-forward their tracked git branch and reinstall the editable package; PyPI/pipx/venv installs run `pip install --upgrade` in the current interpreter environment. Dirty or diverged git checkouts are skipped rather than overwritten. --- ## Quickstart The shortest path — **PyPI + pipx** (recommended): ```bash pipx install 'threadkeeper[semantic]' && thread-keeper-setup ``` `thread-keeper-setup` detects every CLI you have installed (Claude Code / Claude Desktop / Codex CLI + desktop / Antigravity CLI `agy` / Gemini legacy / Copilot / VS Code), registers the MCP server in each one's config, copies hooks to `~/.threadkeeper/hooks/`, and writes a managed instructions block into each CLI's per-user instructions file (`CLAUDE.md` / `AGENTS.md` / `GEMINI.md` / `copilot-instructions.md` — Claude Desktop and VS Code have no global instructions file, so that step is skipped for them). Restart your CLI of choice. Hook-capable clients inject a brief on the first message; hookless clients such as Codex and Antigravity CLI follow the managed instructions block and call `brief()` / `context()` manually before answering. ### Alternative installs If you don't have `pipx` and don't want to install it: ```bash # uv (Rust-fast Python tool runner) — no clone, single binary on PATH uv tool install 'threadkeeper[semantic]' && thread-keeper-setup # Plain pip into a venv python3 -m venv ~/.threadkeeper-venv ~/.threadkeeper-venv/bin/pip install 'threadkeeper[semantic]' ~/.threadkeeper-venv/bin/thread-keeper-setup ``` For development (editable install from a git checkout) or to track the bleeding edge: ```bash # One-liner installer — clones to ~/thread-keeper, makes a venv, # editable-installs, wires every detected CLI. Idempotent — re-run to # update (it git-pulls + reinstalls). curl -fsSL https://raw.githubusercontent.com/po4erk91/thread-keeper/main/install.sh | bash -s -- --semantic # Or fully manual git clone https://github.com/po4erk91/thread-keeper ~/thread-keeper cd ~/thread-keeper && python3 -m venv .venv .venv/bin/pip install -e '.[semantic]' .venv/bin/thread-keeper-setup ``` To preview without writing anything: ```bash thread-keeper-setup --dry-run ``` --- ## Multi-CLI integration | CLI | MCP config | Instructions file | Hooks | Transcripts ingested | |---|---|---|---|---| | Claude Code | `~/.claude.json` `mcpServers` | `~/.claude/CLAUDE.md` | `~/.claude/settings.json` `hooks` | `~/.claude/projects/**/*.jsonl` | | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` `mcpServers` (macOS); `%APPDATA%\Claude\…` (Win); `~/.config/Claude/…` (Linux) | none (GUI-only) | not supported by the app | none — chats live in Electron IndexedDB | | Codex (CLI + desktop) | `~/.codex/config.toml` `[mcp_servers]` (shared between CLI and `Codex.app`) | `~/.codex/AGENTS.md` | not supported | `~/.codex/sessions/**/rollout-*.jsonl` | | Antigravity CLI (`agy`) | `~/.gemini/config/mcp_config.json` `mcpServers` | `~/.gemini/config/AGENTS.md` | not wired yet | not yet parsed — sqlite/protobuf under `~/.gemini/antigravity-cli/conversations/*.db` | | Gemini legacy | `~/.gemini/settings.json` `mcpServers` | `~/.gemini/GEMINI.md` | `~/.gemini/settings.json` `hooks` | `~/.gemini/tmp/<user>/chats/session-*.jsonl` | | Copilot | `~/.copilot/mcp-config.json` `mcpServers` | `~/.copilot/copilot-instructions.md` | `~/.copilot/hooks.json` | `~/.copilot/session-store.db` (sqlite) | | VS Code | `~/Library/Application Support/Code/User/mcp.json` `servers` (macOS); `%APPDATA%\Code\User\mcp.json` (Win); `~/.config/Code/User/mcp.json` (Linux) | none (per-workspace only) | not supported | none — extensions own their history | Every CLI that produces parseable transcripts feeds the same `dialog_messages` table with a `source` tag, so `dialog_search()` finds matches regardless of where the conversation happened. Claude Desktop, Antigravity CLI, and the VS Code adapter are the exceptions — MCP registration only; their chats don't reach the table for now (Electron IndexedDB on the Claude Desktop side; sqlite/protobuf on the Antigravity side; per-extension stores on the VS Code side). VS Code's user-level `mcp.json` is the central host that **every MCP-aware VS Code extension** consumes — GitHub Copilot Chat, the Anthropic Claude IDE plugin, the OpenAI Codex IDE plugin, Continue, Cline, … — so a single registration there reaches all of them at once. Adding a new CLI = one file under `threadkeeper/adapters/` implementing the `CLIAdapter` contract. See [CONTRIBUTING.md](CONTRIBUTING.md). --- ## Core systems ### Spawn — primary parallelism primitive `spawn(prompt, slim=True, role=..., visible=False, ...)` launches a child Claude session via a `claude -p` subprocess. By default `slim=True`: the child loads only the thread-keeper MCP, no embeddings, no third-party servers. ~500 MB RSS versus ~1.3 GB for a full child. Heuristic for the parent: N≥2 modular independent units of ≥5 min each = spawn signal. Spawn also marks children with `THREADKEEPER_SPAWNED_CHILD=1`, so autonomous learning daemons cannot recursively start inside review forks. A daemon measures combined child RSS every 10 s; admission control refuses a new spawn that would exceed `THREADKEEPER_SPAWN_BUDGET_MB` (3 GB default). Slim children that need semantic search delegate to the parent via `search_via_parent` — no per-child copy of the embedding model. `tk-agent-status` exposes autonomous learning loop status as structured JSON or compact text for external monitors: ```sh tk-agent-status tk-agent-status --json tk-agent-status --cleanup-memory ``` `apps/macos-agent-status/` contains a small macOS menu-bar app that polls this command every 15 seconds and shows every autonomous learning loop: enabled/off, running/idle/ready, last pass, backlog, and active child RSS when that loop has spawned a worker. PyPI wheels and sdists also bundle the same Swift source under `threadkeeper/assets/macos-agent-status/`, so a normal `pipx`/`uv tool` install does not need a git checkout for the widget to build. Active loops are sorted first (`running`, then `ready`), so background work stays at the top of the panel. `tk-agent-status --cleanup-memory` runs the safe cleanup path used by the widget: request server cache trims, apply the RSS guard, and remove orphan MCP server processes without killing active spawned child agents. The menu-bar status item is backed by AppKit `NSStatusItem`: it shows the black `memorychip` icon while idle, then swaps fixed-center, synchronized gear frames whenever `running_loop_count` reports at least one active autonomous loop. The status item is icon-only; loop counts live in the po
What people ask about thread-keeper
What is po4erk91/thread-keeper?
+
po4erk91/thread-keeper is mcp servers for the Claude AI ecosystem. Multi-agent shared brain across Claude Code/Desktop, Codex, Gemini, Copilot, VS Code. Cross-session memory, self-improving skill loops, inter-agent signaling — one local MCP server. It has 6 GitHub stars and was last updated today.
How do I install thread-keeper?
+
You can install thread-keeper by cloning the repository (https://github.com/po4erk91/thread-keeper) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is po4erk91/thread-keeper safe to use?
+
po4erk91/thread-keeper has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains po4erk91/thread-keeper?
+
po4erk91/thread-keeper is maintained by po4erk91. The last recorded GitHub activity is from today, with 15 open issues.
Are there alternatives to thread-keeper?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy thread-keeper to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/po4erk91-thread-keeper)<a href="https://claudewave.com/repo/po4erk91-thread-keeper"><img src="https://claudewave.com/api/badge/po4erk91-thread-keeper" alt="Featured on ClaudeWave: po4erk91/thread-keeper" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。