Redthread
Portable, git-backed memory for AI agents and multi-phase workflows.
Your coding agent's memory lives in a local folder (.claude/, .agent/)
on one machine. Redthread replaces it with a git-backed memory store
served over MCP: the same memory is visible to your agent on every machine
that clones the store. The same store carries cross-phase pipeline context
(e.g. train → eval → present, or build → test → present) as an
append-only, content-addressed memory whose source of truth is a
git remote — any node can clone the store and continue a run, and each
phase publishes a curated handoff to the next.
Phase names are data, not code: every project declares its own pipeline in
project.yaml. Nothing domain-specific lives below the adapter layer.
Features
- Agent memory over MCP — point a coding agent's MCP config (Claude
Code, Cursor, Windsurf, VS Code, ...) at a Redthread store instead of a
local
.claude/.agentfolder. - Portable by construction — every entry is keyed by
project_id/run_id/phase/entry_id, never by hostname or absolute path. Swap the machine running a phase mid-run withredthread resume. - Domain-neutral phase adapters — the same core drives an ML pipeline (train/eval) and an app pipeline (build/test) with zero special-casing.
- Content-addressed artifacts — small files commit inline; large ones go through a pluggable blob backend, referenced by sha256.
- Curated handoffs — each phase publishes one small, validated contract for the next phase to consume, never the raw entry log.
- Report, deck, and docs from handoffs —
redthread presentrenders a markdown report, a slide deck, and a docs-site tree from any run. - Worktree mode — run the store as an orphan-branch
git worktreeof your existing code repo, so its active branch is never touched. - Auto-attach on a fresh machine — a committed
.redthread.yamlmarker letsredthread mcp-serve/redthread attachfind and attach the store automatically, so a new clone just needsgit clone+ the same MCP command — no flags to remember.
Install
pip install redthread # or: uv tool install redthread
Three ways to use it
Option 1 — Paste-and-go: let the agent set itself up (recommended)
Copy the AGENTS.md example into your project and your agent installs Redthread, creates the store, and registers the MCP server itself the next time it opens this project — no manual steps at all. By default the store is an orphan-branch git worktree of this same repo, so there's no second remote to provision and this repo's active branch is never touched.
Option 2 — Register the MCP server yourself
Prefer to do it by hand instead of pasting a file? Create a store, then register it with your agent — pick your client:
redthread init my-project --phases build,test,present --store ./my-store
🟠 Claude Code
claude mcp add redthread -- uvx redthread mcp-serve --store ./my-store
Already have redthread installed? Drop uvx:
claude mcp add redthread -- redthread mcp-serve --store ./my-store
Verify with /mcp inside Claude Code — redthread should show as connected
with 18 tools.
⚫ Cursor
Cursor installs MCP servers via a one-click deeplink rather than a CLI command. This generates one and opens it, using only Python (already a Redthread dependency):
python -c "
import base64, json, webbrowser
config = {'command': 'uvx', 'args': ['redthread', 'mcp-serve', '--store', './my-store']}
encoded = base64.b64encode(json.dumps(config).encode()).decode()
webbrowser.open(f'cursor://anysphere.cursor-deeplink/mcp/install?name=redthread&config={encoded}')
"
Accept the install confirmation Cursor opens with to finish.
🔵 VS Code (Copilot)
code --add-mcp '{"name":"redthread","command":"uvx","args":["redthread","mcp-serve","--store","./my-store"]}'
Use code-insiders instead of code if you're on the Insiders build.
Windsurf, Claude Desktop, Codex CLI, Gemini CLI, and the Claude Agent SDK connect just as easily — see MCP client setup for each.
Once connected, ask the agent to call agents_md_bootstrap — it writes the
same usage policy as Option 1 above into this project's
AGENTS.md/CLAUDE.md itself, so future sessions use this memory
automatically without being told.
Option 3 — Drive it from the CLI (no agent required)
redthread run start --store ./my-store
redthread log <run_id> build note '{"msg": "hello"}' --store ./my-store
redthread read <run_id> --store ./my-store
Working from a source checkout instead: uv sync, then prefix each command
with uv run.
Docs
Full docs (usage, architecture, store format) are published at
sina5.github.io/redthread and live in
docs/, built with MkDocs Material:
uv run --group docs mkdocs serve
Changelog
See CHANGELOG.md for release notes.
Development
uv sync
uv run pytest
uv run ruff check .
Metadata
Release files for redthread 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redthread-0.9.0.tar.gz | 364.1 kB | Without provenance | Details for redthread-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redthread-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for redthread-0.9.0-py3-none-any.whl |
Total release size: 424.4 kB
Release files / redthread-0.9.0.tar.gz
| Download URL | redthread-0.9.0.tar.gz |
|---|---|
| Size | 364.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fab86de3aaef9ae6e4ce92abda16062b65774810a32efbd00b6dc3bd687c9fe
|
|
BLAKE2b-256 checksum How to use checksums |
223250c75c463d4fde7a8be162dfaf037eab4e61465b9bd253f1d1618bb5ced4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / redthread-0.9.0-py3-none-any.whl
| Download URL | redthread-0.9.0-py3-none-any.whl |
|---|---|
| Size | 60.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e83e0f9f1ec8c0d7765ee75f058085d80ab4bba6aa05baabd75b54c5ba04912
|
|
BLAKE2b-256 checksum How to use checksums |
a9f521ebb6c11db5f3f297420114f2fdfeb80e7ced1f4e6e219936b896ad315a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for redthread 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.