Where the code goes, the context follows.
Git-native shared memory for coding agents.
Warning
CXTHub is alpha software. Back up important data, review captured context before sharing it, and never rely on automatic secret scrubbing as your only security control.
Git preserves outcomes with extraordinary discipline: commits, diffs, branches, authors, and dates. The investigation and judgment that made those outcomes necessary still disappear inside temporary agent conversations.
CXTHub captures and versions the missing context alongside the code. A developer or agent can return to a branch, hand work to a teammate, or continue in another supported agent without reconstructing the reasoning from scratch.
It is not a chat archive, a project wiki, or a second workflow beside Git. It is a context layer that follows the lifecycle of the code.
CXTHub follows Git actions developers already use:
| Git action | CXTHub behavior |
|---|---|
git commit |
Capture eligible active agent sessions and link them to the commit, independently of the manual CXT index |
git switch / git checkout |
Restore the destination branch context |
git switch -c / git checkout -b |
Record the branch birth at its actual Git start point and prepare the selected context and memory |
git branch |
Create the corresponding context branch from the current context |
git rebase / git commit --amend |
Track rewritten commit links |
git stash / git stash pop |
Preserve or restore unfinished agent work |
git push / git pull |
Synchronize context with the configured remote |
Install the hooks once with cxt init. After that, the code and the context
move together.
- Sessions — capture Claude Code and Codex work through official provider lifecycle hooks, from their CLIs and supported desktop/IDE surfaces.
- Snapshots — store normalized context as immutable, content-addressed states.
- Commit links — connect the session state to the code change it shaped.
- Branches and stashes — reorient or resume when repository work moves.
- Agent transfer — materialize supported context for Claude Code or Codex, regardless of which one created it.
- Team history — push and pull shared context through a self-hostable
cxtdremote. - Retrieval — let Codex, Claude, and compatible agents inspect server-side repository context through the OAuth-protected remote MCP server.
- Review — inspect history, comparisons, pending sessions, and repository state in the web interface.
The underlying model is deliberately Git-like:
agent session → cxt snapshot → Git commit → cxtd remote → person or agent
Natural snapshot parents are immutable. Repairs and session placement use versioned overlay edges, so synchronization can preserve reachability without rewriting a snapshot's content identity.
Release binaries support macOS and Linux on arm64 and amd64:
curl -fsSL https://raw.githubusercontent.com/wnsdy95/cxthub/main/distrib/install | shPin a version by passing the variable to the installer shell:
curl -fsSL https://raw.githubusercontent.com/wnsdy95/cxthub/main/distrib/install |
CXT_VERSION=v0.1.0 shTo build the Go binaries from source, install Go 1.26.9+ and Git 2.28+:
git clone https://github.com/wnsdy95/cxthub.git
cd cxthub
make buildThe binaries are written to bin/cxt and bin/cxtd.
See the installation guide for manual archive
verification, custom install directories, upgrades, removal, source builds,
and the separate cxtd server.
Run these commands inside an existing Git repository:
cxt setup https://<host>/<owner>/<repository>
cxt remote -vcxt setup initializes the local store, authenticates and verifies the repository
connection, then resolves a pristine clone's Git upstream and code-aligned
context before installing Git and provider hooks. It also pulls team settings.
Rerunning it preserves existing context and local work. Automatic attachment
does not launch an agent or inject a conversation. See the
setup contract for evidence requirements and recovery.
Use cxt init instead for local-only operation.
Useful manual commands:
cxt save -m "investigated the failing sync path"
cxt list
cxt load <snapshot>
cxt push
cxt fsck
cxt --helpUse cxt init --no-hooks to opt out of automatic Git integration, or
cxt hooks uninstall to remove the managed hooks.
The complete command and option reference is in docs/CLI.md.
integrations/claude-code/contains the Claude Code plugin, command, MCP, and hook assets.integrations/codex/contains the Codex MCP, prompt, and hook configuration.
cxt setup registers lifecycle hooks once. The same hooks capture Codex app
sessions and Claude Desktop's Code tab; no desktop process wrapper is
needed. Linked app worktrees share the primary repository's .cxt store while
keeping their Git branch identity separate.
On branch switches, desktop apps keep their vendor-owned live session. CXTHub selects or creates the destination context and injects at most 16 KiB of structured project memory once on the next app prompt. It does not replay the archived transcript into the active context window. The optional CLI wrappers below add one capability apps do not expose to an external tool: terminating and natively resuming the provider process on the new session file.
The CLI can also start either provider with repository context:
cxt claude
cxt codexClaude Desktop's general Chat tab is not a Claude Code session and does not emit the coding lifecycle hooks CXTHub relies on. It is therefore not passively captured; use the Code tab or an explicit export/import path.
CXTHub processes coding-agent conversations, which may contain source code, credentials, customer data, or internal decisions.
Place exact secret values, one per line, in .cxtsecrets. The CLI masks those
values before writing a capture. The file is ignored by Git and is not uploaded
in plaintext. Shared secret-mask lists are end-to-end encrypted.
Pattern-based scrubbing and .cxtsecrets are defense in depth. If a credential
may have entered an agent session or Git history, revoke it immediately. See
SECURITY.md for the disclosure process and security boundaries.
| Path | Purpose |
|---|---|
cli/ |
Go cxt CLI, capture adapters, codecs, local working replica, and explicit offline stdio MCP helper |
backend/ |
Independent Go cxtd API and cxt-mcp remote MCP servers; shared PostgreSQL in production |
frontend/web/ |
Sole web runtime: React and TypeScript application, tests, and deployment config |
schemas/ |
OpenAPI, JSON Schema, and ordered PostgreSQL migrations |
integrations/ |
Claude Code and Codex integration assets |
deploy/ |
Optional self-hosting infrastructure |
For local development:
bin/cxtd serve --addr 127.0.0.1:8907 --data ./cxt-dataThe filesystem store and development authentication mode are for trusted local use. Internet-facing installations must configure TLS, production authentication, PostgreSQL, backups, rate limits, and secret management.
The REST API contract is schemas/openapi.yaml.
make build
make test
make typecheck
make lint
make e2e
CXT_E2E_DSN="${DISPOSABLE_POSTGRES_DSN:?set a disposable PostgreSQL 16 DSN}" make e2e-sync
make public-checkConditional automatic-merge append requires PostgreSQL; FS rejects it and leaves
delivery pending. Running sync E2E without CXT_E2E_DSN covers legacy FS behavior,
not this transactional feature. See storage requirements.
PostgreSQL changes should also run make test-postgres against PostgreSQL 16.
See CONTRIBUTING.md before opening an issue or pull request.
Licensed under the Apache License 2.0. See NOTICE, THIRD_PARTY_NOTICES.md, and TRADEMARKS.md.