Skip to content
Tech News
← Back to articles

Show HN: ContextCodeCache in Rust

read original more articles

ContextCodeCache ( ccc )

Tool that scans a project and generates a ContextCodeCache - a .ccc directory holding a compact, machine-readable map of every source file: its constants, functions (with return types and doc summaries), intra-file call graph, and marker notes (TODO/FIXME/...). It is designed to give agents a cheap, always-fresh index of a project.

Please ⭐ if you find this useful 💚

Install / build

Requires Rust ≥ 1.77 (the tree-sitter 0.25 stack; some transitive deps use edition 2024) also needs a recent cargo.

cargo build --release # binary @ target/release/ccc ./target/release/ccc install # copy it onto your PATH (Linux)

ccc install copies the running binary into ~/.local/bin (the user-local bin dir on Linux — no sudo needed) and marks it executable. Pass --dir <DIR> to choose a different directory, or --force to overwrite an existing ccc . If the target directory isn't on your $PATH , it prints the line to add to your shell profile.

Usage

ccc scan [PATH] # regen PATH/.ccc (PATH defaults to ".") ccc scan [PATH] --tokens # also pre-encode the cache into a token stream ccc check [PATH] # exit non-zero if .ccc is stale - for CI ccc check [PATH] --format json # same, but print changed cache files as JSON ccc tokenize [PATH] # pre-encode an existing .ccc into tokens.bin + tokens.json ccc install [--dir DIR] # install the ccc binary onto your PATH (Linux)

ccc check --format json prints one line — { root, up_to_date, files[], changes[] } — where files is the repo-relative paths of the out-of-date cache entries. It's meant to be consumed by other tooling; the bundled GitHub Action feeds that array to downstream jobs via fromJSON(...) :

... continue reading