Quickstart
pip install selvedgecd your-projectselvedge setupThat’s it. selvedge setup is an interactive wizard: it detects which AI tools you have
(Claude Code, Cursor, Copilot), writes the MCP entry into each one’s config, drops the
canonical agent-instructions block into your project’s prompt file (CLAUDE.md /
.cursorrules / copilot-instructions.md), runs selvedge init, and installs the
post-commit hook. Every modified file gets a .bak written next to it before any change
reaches disk. Re-running is a no-op.
For CI bootstrap or devcontainer.json postCreateCommand:
selvedge setup --non-interactive --yesVerify the wiring
Section titled “Verify the wiring”Open a second terminal in the same project:
selvedge watchMake any change in your AI tool — add a column, rename a function, add an env var.
selvedge watch should print the new event within a second of the agent calling
log_change. If nothing arrives, run selvedge doctor for a single-command health
check that tells you which step is silently broken.
Query your history
Section titled “Query your history”selvedge status # recent activity + missing-commit countselvedge diff users # all changes to the users tableselvedge diff users.email # changes to a specific columnselvedge blame payments.amount # what changed last and whyselvedge history --since 30d # last 30 days of changesselvedge history --since 15m # last 15 minutes ('m' = minutes)selvedge changeset add-stripe-billing # all events for a feature/taskselvedge search "stripe" # full-text searchselvedge stats # log_change coverage report (per-agent)selvedge import migrations/ # backfill from migration filesselvedge export --format csv # dump history to CSVAll read commands support --json for machine-readable output.
Manual install (if you’d rather wire it up yourself)
Section titled “Manual install (if you’d rather wire it up yourself)”If you don’t want to run the wizard, the four manual steps it automates:
1. Initialize in your project
Section titled “1. Initialize in your project”cd your-projectselvedge init2. Add to your AI tool’s config
Section titled “2. Add to your AI tool’s config”For Claude Code (~/.claude/config.json):
{ "mcpServers": { "selvedge": { "command": "selvedge-server" } }}For Cursor: ~/.cursor/mcp.json (same shape). For Copilot:
.github/copilot-instructions.md (different format — see selvedge prompt --help).
3. Tell your agent to use it
Section titled “3. Tell your agent to use it”selvedge prompt --install CLAUDE.mdThis installs the canonical agent-instructions block, sentinel-bracketed
(<!-- selvedge:start --> / <!-- selvedge:end -->) so future --install calls update
the bracketed region without disturbing anything else in the file. Or pipe it:
selvedge prompt | tee -a CLAUDE.md4. Install the post-commit hook
Section titled “4. Install the post-commit hook”selvedge install-hookThat’s the same four steps the wizard runs.
Coverage checking
Section titled “Coverage checking”Wondering how often your agent actually calls log_change? selvedge stats (above)
gives the per-agent breakdown, low-quality-reasoning count, and last call timestamp. To
cross-reference against git commits, run python scripts/coverage_check.py --since 30d
(in the source repo). Low coverage usually means the system prompt needs strengthening.
CLI reference → — every flag, every subcommand. MCP tools → — the eight tools agents call. FAQ → — common questions, gotchas, and limits.