Skip to content
context Artifact [c0741a8dc0]
Login

Artifact [c0741a8dc0]

Artifact c0741a8dc0c4249642f0c05d8ed6552ddb28b31b26664a5d0868a44b2325913c:


ctx

ctx keeps the work you do with coding agents. It archives every Claude Code session, with secrets redacted, into a private Fossil repository on your machine and makes it searchable, so an agent can find why something was decided or what already failed. Per project it keeps tickets, version-pinned sources and a wiki whose every claim quotes an exact source version. Repositories sync between machines and people.

It is one C binary built from SQLite and libfossil, with everything in one SQLite file per machine.

What it does

Install

From a release archive, which is a Claude Code plugin with the binary, the skills and the hooks:

tar xzf ctx-0.0.1-darwin-arm64.tar.gz
claude plugin marketplace add ./ctx-0.0.1-darwin-arm64
claude plugin install ctx@ctx
ln -s "$PWD/ctx-0.0.1-darwin-arm64/bin/ctx" ~/.local/bin/ctx
ctx init
ctx scan

Or build from source with a C compiler and zlib: make, then see docs/howto.md for the hooks.

Start

ctx search sync test hangs        # past sessions, this project first
ctx turn 1182 2 5                 # a turn with 2 before and 5 after
ctx audit                         # secret-shaped strings left in the archive
ctx project add myproj --clone ~/fossils/myproj.fossil   # this directory's project
ctx ticket new "Fix the importer"

docs/howto.md covers every task: projects, tickets, sources, the wiki, syncing machines, rebuilding and measuring the skill.

docs/benchmarks.md lists what ctx has been measured to do, with the command behind each figure and the experiments that failed. bench/head-to-head.md is the plan, written before any run, for comparing ctx with other tools.

How it is stored

Everything lives in ~/.ctx/ctx.sqlite (or $CTX_DB), as SQLite tables and as Fossil repositories held inside it:

The schema is in schema/: state.sql holds what is kept, index.sql what is derived, ticket-table.sql the ticket fields and check.sql checks for both.

Building and checks

make builds ./ctx from the SQLite and libfossil sources in vendor/, and make test runs the suite. make check runs everything CI runs, and needs python3 and sqlite3 as well:

Releases

make dist builds a release archive for this machine in build/dist/. tools/dist-linux.sh [amd64|arm64] builds a Linux one inside Ubuntu 22.04 under docker, so it runs on glibc 2.34 or later; docker on an Apple Silicon Mac builds both. plugin/INSTALL.md becomes the archive's README.

Measuring

License

BSD 2-Clause; see LICENSE. The libfossil code in vendor/libfossil is under its own BSD license, in vendor/libfossil/LICENSE. SQLite is in the public domain.