Skip to main content

Versioned local code context for humans and coding agents

Project description

Thread Keep

Thread Keep is a local-first version control system for the knowledge behind your code. It attaches durable notes such as intent, decisions, constraints, examples, and warnings to functions, methods, and types—without adding annotations to source files.

Git continues to version the code. Thread Keep versions the context that explains why the code is shaped that way.

Is Thread Keep for you?

Use Thread Keep when you want developers and coding agents to:

  • find the reason behind an implementation without searching old chats;
  • keep decisions and warnings attached to the code entity they describe;
  • notice when a code change may have made saved context stale;
  • review AI-drafted context before it becomes part of shared history; or
  • share code context without transferring source files.

Thread Keep is not a call graph, a general code-search platform, or an autonomous agent. It does not edit source files, call an AI model, or commit context automatically.

Install

Published releases support Python 3.9 or newer on Linux glibc x64/arm64, macOS Apple Silicon, and Windows x64:

python3 -m pip install thread-keep
thread-keep --help

Go is indexed by the core package. Install only the language packs your repository needs:

python3 -m pip install "thread-keep[typescript,python]"
# or install all official packs
python3 -m pip install "thread-keep[all]"

The supported optional packs are TypeScript/TSX, JavaScript/JSX, Python, Java, Kotlin, and Rust. You can see what the current repository needs with:

thread-keep indexers list

macOS Intel, Windows arm64, and Linux musl are not release targets. See the Quickstart for source builds and manual pack setup.

Save your first context note

Run these commands inside a Git repository. update requires a clean, committed worktree so the index always describes an exact Git revision.

# 1. Create local Thread Keep storage and index the current commit.
thread-keep init
thread-keep update

# 2. Find the exact key of the function, method, or type you want to document.
thread-keep search "Run"

# 3. Add a pending note using a key returned by search.
thread-keep note add example.Run \
  --kind intent \
  --body "Runs the example workflow through one audited entry point (see PR #12)."

# 4. Review the pending change, then commit it explicitly.
thread-keep status
thread-keep diff
thread-keep commit -m "Document the example workflow"

# 5. Confirm that the note is searchable and present in history.
thread-keep context get example.Run
thread-keep log

Nothing is promoted automatically. note add and agent write tools create pending drafts; only thread-keep commit creates an immutable context snapshot. The current CLI commits the complete pending set and does not yet provide selective draft edit or discard.

For expected output, note-writing examples, stale-context review, and common errors, follow the 15-minute Quickstart.

Verify what was saved

Use the CLI first:

  • thread-keep status shows the indexed source revision, coverage, current context snapshot, and pending-note count.
  • thread-keep diff shows every pending note or binding change that has not been committed.
  • thread-keep search <query> and thread-keep context get <entity-key> show active committed context.
  • thread-keep log shows immutable context history.

Thread Keep stores local data outside the source tree, under the repository's Git common directory:

git rev-parse --git-common-dir

Inside that directory:

thread-keep/
├── index.sqlite                       # rebuildable local projection and working state
└── objects/
    └── <context-snapshot-id>.json     # immutable committed context object

Do not edit index.sqlite directly. If the projection is lost but the immutable objects remain, use thread-keep rebuild <context-snapshot-id> with an ID from thread-keep log.

What is implemented?

Area Current capability Read more
Local context Initialize, index, add/revise/review notes, inspect pending changes, commit, search, read, and rebuild Quickstart
Languages Built-in Go plus six optional Tree-sitter-based language packs Multi-language indexing
Retrieval Lexical evidence, entity context, bounded same-file/owner relationships, and filtered context assembly Architecture
Coding agents Local stdio MCP with eight read tools and two pending-draft tools; no commit or remote-write tool Codex, Claude Code
Sharing Explicit filesystem or HTTP(S) remotes, fast-forward pull, and explicit semantic merge Quickstart: sharing
Hosted remote GitHub-authorized object/ref server, PostgreSQL option, clustering, and storage maintenance Team server
PR context planning Opt-in durable GitHub webhook intake, isolated planning runners, Checks, automatic landing, and manual recovery PR context planning
Distribution Platform wheels, raw release binaries, checksums, and three production container images Release operations

Important limits are explicit: structural context is not a call graph; local MCP is the only MCP endpoint; coordinator mode is durable single-coordinator rather than HA; and live Kubernetes runner validation remains opt-in for the target cluster.

Connect a coding agent

The core wheel includes thread-keep-mcp. Initialize and update the repository before registering it with your agent.

Both integrations enforce the same boundary: agents may read committed context and draft pending notes, while a human reviews thread-keep diff and runs thread-keep commit.

Share context with a team

A Thread Keep remote transfers immutable context objects and versioned context references. It never transfers source files, the local SQLite projection, pending notes, or credentials.

thread-keep remote add origin /absolute/path/to/context-remote
# or use a hosted context remote
thread-keep remote add origin https://context.example.com/v1/repositories/my-repo

thread-keep remote push origin
thread-keep remote fetch origin
thread-keep remote pull origin

pull is fast-forward only. Divergence is reported instead of being overwritten; resolve same-source snapshot divergence explicitly with thread-keep context merge. For hosted setup, authentication, backups, clustering, and maintenance, use the Team server guide.

Build from source

The SQLite search projection uses CGO and FTS5, so a source build needs Go and a C compiler:

make test
make vet
make build

make build creates five runtime binaries in bin/: thread-keep, thread-keep-mcp, thread-keep-server, thread-keep-coordinator, and thread-keep-runner. Build the six optional language-pack binaries separately:

make build-pack

Run the complete local black-box workflow in a disposable Linux container with make e2e. Build the three production process-boundary images with make docker-build.

Documentation

Start here Purpose
Quickstart Installation, first note, verification, sharing, and troubleshooting
Codex setup MCP registration and project instructions
Claude Code setup MCP registration, draft skill, and optional hooks
Team server Self-hosted remote operations and team onboarding
PR context planning GitHub App, coordinator, runner, landing, and recovery
Release operations Supported targets and release verification
Architecture Current implementation contract, module boundaries, and deferred work
Evaluation plan Planned agent-effectiveness measurements; not current product telemetry

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

thread_keep-0.1.2-py3-none-win_amd64.whl (7.9 MB view details)

Uploaded Python 3Windows x86-64

thread_keep-0.1.2-py3-none-manylinux_2_39_x86_64.whl (7.7 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

thread_keep-0.1.2-py3-none-manylinux_2_39_aarch64.whl (7.1 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ ARM64

thread_keep-0.1.2-py3-none-macosx_15_0_arm64.whl (7.3 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file thread_keep-0.1.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: thread_keep-0.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thread_keep-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1892a1a15184b92f8fb7617a8c9fdb76aa098996c41c418be26d4c04cddfaefb
MD5 2b619851b37e33588aceff06355f7cb0
BLAKE2b-256 b2b7a37f596c6d56ec5af49165ffdb2cbb54c9ee2a83ee5d332582dcb5d28bb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_keep-0.1.2-py3-none-win_amd64.whl:

Publisher: release.yml on tae2089/thread-keep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thread_keep-0.1.2-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for thread_keep-0.1.2-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8ae55358c832aafb30b602e3abe220153f6cd9c76943b9b9d02c6ac5c62722c3
MD5 e044b5b46a6e5a27e048eb2335f5191a
BLAKE2b-256 c28565501ebc497c54cff465067cec346f198c7358bae8a71ce519c312c0214c

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_keep-0.1.2-py3-none-manylinux_2_39_x86_64.whl:

Publisher: release.yml on tae2089/thread-keep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thread_keep-0.1.2-py3-none-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for thread_keep-0.1.2-py3-none-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 fb3a70ab3ca04c24333649126380e5527a59bf25da0c14ea992505f67c90839f
MD5 4b3a5e1df570fe5c1b07a0895cf680eb
BLAKE2b-256 eb88ea38fde04bab3959bfb8104fe87e93ac468a349e36a3a5caff8efb0bdb54

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_keep-0.1.2-py3-none-manylinux_2_39_aarch64.whl:

Publisher: release.yml on tae2089/thread-keep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thread_keep-0.1.2-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for thread_keep-0.1.2-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 651adc304141ff91b5b0ab7bb2a1ab15f16527da25bf477794cb5a5cda959d3c
MD5 4ea06608be801c2971ce00b2dd11a396
BLAKE2b-256 c4ac0c0c16b876f378d507625623bfb3f4871e9cba88a1569ab81186f295973f

See more details on using hashes here.

Provenance

The following attestation bundles were made for thread_keep-0.1.2-py3-none-macosx_15_0_arm64.whl:

Publisher: release.yml on tae2089/thread-keep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page