The knowledge base your coding agent keeps in order
dig keeps a knowledge base organized to your rules — deduped, versioned, every change reversible — and retrieves it fast over MCP for Claude Code, Codex, Cursor, any agent. A KB kept this clean is one your agent recalls across sessions. Runs fully on your machine.
98% hit@5 retrieval on LongMemEval — fully localWorks with your agent
dig is harness-agnostic — one MCP server and a portable skill plug it into every coding agent. Pick yours for the exact install.
Two CLI commands add the dig plugin to Claude Code — bundling the dig skill, the `dig mcp` server, and a SessionEnd hook that captures finished sessions into memory.
Ships with: Claude Code · Codex · Cursor · Any MCP client · Gemini CLI · Vercel AI SDK · Pi · opencode
Every knowledge base rots
Files land in the wrong place. Names drift from convention. Duplicates pile up. Keeping a library tidy is real, recurring work — and the tools that could automate it are either single-purpose or too dangerous to let loose on real files.
Movers move, organizers rename, linters flag. None of them manage the structure of a living library and keep it converged on your rules.
Declare the policy. dig does the librarian's job.
Find, organize, dedupe, label, version, reconcile — driven by one policy file, never ad hoc.
Declare your policy
Rules, invariants, and workflows in one TOML file: where files belong, what they're named, which labels they get.
Let dig reconcile
dig compares the library against policy, reports drift, and brings it back — automatically where safe, by proposal where not.
Undo anything
Every change is journaled as a reversible changeset. Preview with dry-run, browse with log, step back with undo.
One content-addressed core. Six jobs.
Dedupe, versioning, isolation, and merge fall out of one store design — not six bolted-on features.
Retrieve fast
Indexed, ranked find across the whole library — built for humans and for other harnesses via --json output.
Organize by policy
Declarative rules make the tree match your conventions — readable, like a librarian shelving books.
No duplicates
Identical content hashes identically. Duplicates are detected by construction and collapsed per policy.
Version everything
Full history of every move, rename, and label. Any change is reversible with dig undo.
Detect and fix drift
Policy is desired state. dig reports what is misfiled, misnamed, duplicated, or unlabeled — then reconciles.
Parallel-safe
Many agents, one library: isolated work views, automatic merge of disjoint changes, human escalation only on real conflicts.
Built like infrastructure, not an app
- Local-first
- Runs fully on your machine. No telemetry, no cloud requirement.
- AI-optional
- The deterministic core works with no model at all. Opt in with any OpenAI-compatible endpoint — a small local model is enough.
- CLI-only
- The command line is the whole interface. Any agent harness drives dig by running commands.
- Single binary
- Pure Go, cgo-free, cross-compiles everywhere. No runtime to install.
- Coexists with humans
- Keep editing with Obsidian, Finder, or your editor. dig reconciles around you — it never locks you out.
- Extensible
- Eight typed seams for storage, events, extraction, commands, and more. Small core, rich edges.
Questions you would ask
- Is dig a RAG or Q&A assistant?
- No. dig governs where files live and what they are called — it manages structure. Retrieval serves management, not chat. That lane is deliberate.
- Does it need an LLM?
- No. With AI mode off, the core is fully deterministic and offline. AI is opt-in and only makes small, bounded judgments while dig's tools do the structural work.
- Will it overwrite my edits?
- Never silently. dig observes direct edits, folds them into history, and reconciles them against policy. A deliberate human change is escalated, not overridden.
- Can I use it today?
- Yes. The CLI ships the full lifecycle — scan, find, organize, dedupe, drift, reconcile, watch, export, undo — plus opt-in semantic search that beats the published retrieval benchmarks (98.0% hit@5 on LongMemEval, fully local). It's pre-1.0 and moving fast; install it and follow what lands next.
- What is the license?
- MIT. Open source, no strings.
- Does dig work with Claude Code, Codex, or other agents?
- Yes. dig ships a Claude Code plugin (/plugin marketplace add vllnt/dig), a dig mcp server for any MCP client (Cursor, Codex, opencode, …), entry docs for Codex and Gemini, and TypeScript/Python SDKs. The integrations page has the exact 10-second install per agent.
Follow the build
dig is being built in the open, phase by phase — the safety spine first, destructive features only on top of it. Star the repo to watch it land.