Context Weaver is a repo-native FileBlock context compiler for coding agents. It
turns rules, skills, Handbook meaning, source/AST evidence, cache state, and
runtime audit evidence into bounded SQLite projections exposed through ctx.
Use it when raw rg or find hits are not enough. A string match can tell an
agent where text appears, but it cannot tell which owner, rule, cache partition,
or proof gate applies. Context Weaver gives the agent a project coordinate
system before it edits code or makes architecture claims.
The product surface is one Unix-like target.method(payload) CLI. The seven
first-level targets are help, sql, cache, rule, skill, handbook, and
codebase; the four semantic targets remain independent and cross-module
composition is performed by a caller through four separate calls.
Relation-facing results preserve the same object contract used by parsers,
owners, cache, and SQL: projected nodes are {name,structure,behavior} and
projected relations are {frompath,topath}. They are derived from FileBlock
JSONB; ctx codebase slice source reads are explicit FileExcerpt observations.
The product usage guide is the main entry for users:
docs/user-guide.md
Typical first commands:
ctx help --full
ctx cache status
ctx codebase search context
ctx sql "SELECT json_extract(structure, '$.kind') AS kind, COUNT(*) AS c FROM nodes GROUP BY kind ORDER BY c DESC" --json
ctx skill listAdd --json when a caller needs machine-readable output.
Context Weaver currently ships these user-facing surfaces:
ctx helpfor the public target.method catalogctx sqlfor direct read-only queries over FileBlock projections andtoken_weightctx cache status/build/clearfor persistent cache managementctx rule,ctx skill,ctx handbook, andctx codebase <operation>for four independent services
Architecture truth lives in handbook/README.md and the Obsidian Markdown notes under handbook/. Usage guidance lives in docs/user-guide.md; the public change projection is CHANGELOG.md. Execution plans live in docs/plan/*.md.