The agent workflow tool that scales from small, simple projects to large, complex codebases.
Pure C11. One binary. One SQLite database. Nothing leaves your machine.
English · 简体中文 · Español · हिन्दी · العربية · Français · Português (BR)
Codify (invoked as cg) is an agent workflow engine in a single binary. It maintains the three things a project needs beyond the code itself — what the code is, how it got here, and what happens next — and serves all three to humans and AI agents alike.
What the code is. Codify indexes 19 languages into a queryable graph: symbols, call edges, framework-aware routes, and instant full-text search, all stored locally in SQLite. cg context <query> answers "catch me up on this area" in one call: entry points, matching symbols with snippets, callers, callees, and related routes.
How it got here. A built-in content-addressed snapshot system gives you commits, history, diffs, and restore with no external VCS required. Because snapshots share a database with the graph, cg changes reports the blast radius of your uncommitted edits, and cg changelog writes symbol-level release notes by itself.
What happens next. A spec engine turns plain-text kvx spec files into a working plan: a task board with dependency waves, one-task-in-progress discipline, acceptance criteria attached to every task — and a done that is verified, not asserted. A task's checks must pass, and the symbols and files it claims to deliver must actually exist in the graph and the history, before Codify will mark it complete.
The three layers reinforce each other: commits are auto-tagged with the task they implement, cg spec trace walks any task to its symbols and commits, and a built-in MCP server exposes all of it — 15 tools — to Claude Code, Cursor, and every other MCP-capable agent.
There are no API keys, no background services, and no telemetry. Everything runs on your machine and stays there.
It closes the loop from plan to proof. Most tooling either plans work (task lists) or describes code (search, indexes). Codify does both against the same database, so the plan can be checked against reality: when a task declares it introduces checkMode and touches src/*.ts, cg spec done refuses to mark it complete until the graph and the history agree.
Agents work like engineers, not tourists. Instead of wandering a repository file by file, an agent asks cg spec next for what to do, cg context for everything about the area, and cg impact for who breaks — then commits with automatic task attribution. The entire loop is available over MCP, so it never has to leave the protocol.
Context arrives in one call, not twenty. cg context <query> is designed around how agents actually consume code. One request returns everything needed to start working: where execution enters, what matched, who calls it, what it calls, and which routes touch it.
Impact analysis is a first-class command. cg impact <name> -d 3 walks caller and callee edges transitively and answers the two questions that matter before any change: who breaks if this moves, and what does it depend on.
Search is instant and layered. An FTS5 trigram index over symbol names gives case-insensitive substring matching with no warm-up, backed by a word index over full file bodies for everything else.
The index never goes stale. cg watch listens for native OS events (inotify on Linux, FSEvents on macOS, ReadDirectoryChangesW on Windows, all behind one platform layer) and auto-syncs with debouncing. MCP tool calls also sync before reading, so a connected agent always queries fresh data.
It adapts to the hardware it runs on. At startup, cg sizes its worker pool and SQLite caches from what the system actually provides: container-aware core counts (the intersection of cgroup v1/v2 CPU quota, the affinity mask, and online CPUs), honest available RAM (MemAvailable intersected with cgroup memory limits), and measured per-project cost. A 16-core workstation gets the full parallel pipeline. A 2-core VPS gets one tuned to finish reliably. Run cg info to see exactly how the pipeline was sized.
Everything stays local. The graph lives in a SQLite database under .codegraph/, and snapshots are content-addressed objects under .codegraph/objects/. Delete the directory and every trace is gone.
cg spec next # the next eligible task, with acceptance criteria
cg spec start 16.7 # claim it — one task in progress at a time
cg context "password auth" # entry points, symbols, callers, routes in one call
cg impact verifyLogin -d 2 # who breaks if this changes
# ...implement...
cg commit -m "add password auth" # snapshot, auto-tagged [spec:ion_spec/16.7]
cg spec done 16.7 # runs the task's verify_cmd + graph checks
cg spec trace 16.7 # proof: task -> symbols -> files -> commitsEvery command in that loop is also an MCP tool, so a connected agent can run it end to end — and every step works just as well in a ten-file project as in a monorepo.
Languages: TypeScript, JavaScript, Python, Go, Rust, Java, C#, VB.NET, PHP, Ruby, C, C++, Swift, Kotlin, Erlang, Solidity, Svelte, Vue, Astro.
Framework-aware routing: cg links URL patterns to their handlers across Express, Koa, Fastify, Hapi, NestJS, Next.js, SvelteKit, Flask, FastAPI, Django, Rails, Sinatra, Laravel, Spring, ASP.NET, Gin, Echo, Fiber, Chi, Actix, and Axum.
Linux x86_64 — one command installs (or updates) a checksum-verified static binary:
curl -fsSL https://codify.centra.ag/install | bashUninstall the same way: curl -fsSL https://codify.centra.ag/uninstall | bash. Per-project .codegraph/ data is never touched.
Anywhere else, build from source (dependencies: a C compiler and libsqlite3-dev):
make && sudo make installThen, in any project:
cd your-project
cg init| Command | Description |
|---|---|
cg init |
Create .codegraph/ and build the initial index |
cg sync / cg index [--full] |
Incremental or full reindex |
cg search <q> [-n N] |
Symbol and full-text search |
cg symbol <name> |
Definition, snippet, and reference count |
cg impact <name> [-d N] |
Transitive callers and callees |
cg context <q> |
One-call context bundle for agents |
cg routes [filter] |
URL pattern to handler table |
cg watch [--debounce MS] |
Auto-sync on native filesystem events |
cg info |
Machine profile and pipeline sizing report |
Snapshots are content-addressed with SHA-256 and blobs are deduplicated.
| Command | Description |
|---|---|
cg commit -m <msg> |
Snapshot the working tree |
cg log / cg status |
History, and worktree versus HEAD |
cg diff [A] [B] |
LCS line diff between snapshots or the worktree |
cg checkout <id> [--force] |
Restore a snapshot |
cg changes |
Impact radius of uncommitted edits: the symbols you touched plus their external callers |
| Command | Description |
|---|---|
cg mcp |
Run as an MCP stdio server with 15 tools: search, context, symbol, impact, routes, status, change-impact, log, commit, and the spec tools (status, next, start, done, render, trace) |
cg mcp-install |
Auto-connect to Claude Code (.mcp.json), Cursor, VS Code, Windsurf, Gemini CLI, and Codex CLI, merging into existing configs |
cg changelog [-n N] [-o FILE] |
Changelog from snapshots with symbol-level diffs: added and removed functions, new routes |
cg agentmd [--write] |
Generate AGENTS.md and CLAUDE.md: languages, directory map, build tooling, entry points, routes, and the most-referenced symbols |
All query commands accept --json. That flag plus the MCP server is the agent-native interface.
The spec workflow is how Codify turns a feature plan into tracked, verified work. Specs live as plain-text kvx files — readable by humans, diffable, and owned by your repository — and Codify renders them into IDE rule files and markdown mirrors while driving the task loop on top. It works in any repository containing spec/workflow.kvx, is fully independent of .codegraph/, and is a drop-in C replacement for Ion's spec/specgen with byte-identical output.
| Command | Description |
|---|---|
cg spec render [--check] |
Regenerate IDE pointer files (Cursor, Devin, Claude, Codex, Copilot, Kiro) and the markdown mirror (requirements.md, design.md, tasks.md); --check exits 2 if anything is stale |
cg spec / cg spec status |
Task board: counts, progress, the current in-progress task, and the next eligible one |
cg spec next |
The lowest-wave pending task whose requires are all done, with its do-bullets and expanded acceptance criteria |
cg spec start <id> |
Mark a task in_progress; enforces one at a time and met requires, with --force to override |
cg spec done <id> |
Run the task's verify_cmd and graph checks (refuses on failure, --force to override), mark it done, and suggest the next task |
cg spec trace [<id>] |
Trace tasks to code: declared symbols resolved in the graph (location, kind, refs), touched paths matched against actual changes, and the commits tagged with the task |
start and done rewrite only the single status = "..." line in the kvx file. Every other byte, comment, and blank line survives. The command then quietly re-renders so the checkboxes in tasks.md stay current. The kvx files remain the single source of truth, and -f <feature> overrides [meta] active_feature.
cg commit automatically tags its message with the in-progress task, for example ... [spec:ion_spec/16.7], so cg log and cg changelog trace every snapshot back to the spec. The six spec commands are also exposed as MCP tools, letting a connected agent drive the full loop (next, start, implement, done) without leaving the protocol.
When the project also has a .codegraph/ index, tasks can declare what their implementation looks like, and cg spec done verifies it against reality:
[task.2.1]
title = "Check mode"
symbols = ["checkMode"] # must exist in the code graph
touches = ["src/*.ts"] # a matching path must actually have changedsymbols are looked up in the indexed graph; touches patterns (exact paths or globs) are matched against the union of worktree changes and the files changed by commits tagged with the task — so verification still passes after the work has been committed. Failing checks refuse the completion (--force overrides). cg spec trace [<id>] shows the full task→code→commit chain for one task or the whole feature, in text or --json.
editors/vscode/ ships the Codify extension: syntax highlighting for .kvx spec files, plus a live task board in the Explorer — tasks grouped by dependency wave with status icons, the graph-verification data behind each task (symbols with locations, touched paths, tagged commits), start/complete actions that run the real cg spec commands (including the refusal when checks fail), and a status bar progress item. It shells out to cg and needs no build step:
cd editors/vscode
npx @vscode/vsce package # produces codify-0.1.0.vsix
code --install-extension codify-0.1.0.vsixmake # build ./cg (deps: C compiler, libsqlite3-dev)
make unit # C unit tests (tests/unit/*.c against build/libcg.a)
make integration # end-to-end CLI tests (tests/integration/*.sh in sandboxes)
make test # both
make release # static release binary -> tested -> published to the web rootRepository layout:
src/ one .c file per module; src/cg.h is the only header
tests/unit/ kvx grammar, SHA-256 vectors, JSON scanner, StrBuf/IO
tests/integration/ graph, vcs, agentic, MCP protocol, spec engine, watcher
tests/fixtures/ sample polyglot project and a spec repo with golden outputs
editors/vscode/ VS Code extension: kvx language + task board (plain JS)
scripts/ install/uninstall scripts served at codify.centra.ag + release publisher
docs/ARCHITECTURE.md how the pieces fit together
The spec-render goldens were generated by the original Go specgen, so rendering parity is locked in by make test. CI builds and runs the full suite on every push via .github/workflows/ci.yml.
- Ignore rules combine sensible defaults (VCS directories,
node_modules, build output, binaries) with a.cgignorefile using one glob per line. - Symbol extraction is heuristic. A comment-aware and string-aware pattern engine per language is tuned for recall on definitions and call sites. It is not a full type-checked resolver.
- Snapshots store every non-ignored file up to 32 MB, including binaries. The graph indexes text files up to 8 MB.
MIT © Sidiora Labs