Long-term memory for AI-coded codebases — a git blame for AI agents, but for the why, captured live as each change is made in a local SQLite file.
Selvedge is a local MCP server that gives AI coding agents (Claude Code, Cursor, Copilot, Cline, Windsurf, Continue) long-term memory. As an agent works, it calls Selvedge's log_change tool to record what it changed and why — captured live, in the same context window that produced the change, not inferred afterward from a diff by a second LLM. Everything is stored in a plain SQLite file under .selvedge/ next to your code, with zero external dependencies beyond MCP, Click, and Rich — no accounts, no servers, no telemetry.
git blame tells you what changed and when, but human-written intent — commit messages, PR descriptions, Slack threads — simply doesn't exist for most AI-generated changes. Six months later, a column like user_tier_v2 shows up in git blame with a generic message like “Update schema,” and the reasoning is gone. Selvedge closes that gap by capturing the agent's own reasoning at the moment of the change.
users.email, env/STRIPE_SECRET_KEY, api/v1/checkout, deps/stripe — not just line ranges.prior_attempts tool lets an agent check what was already tried and reverted before editing an entity again, and stale_decisions surfaces dated decisions (via revisit_after) that have come due — but only for entities still in active use.selvedge export --format agent-trace emits Agent Trace v0.1.0 records, the open AI code-attribution wire format from Cursor and Cognition AI, so captured history can travel into other tools that read the standard.selvedge blame, selvedge diff, selvedge history --since 30d, selvedge changeset, and selvedge search.Teams running long-term, AI-coded codebases that need an audit trail for schema decisions, migrations, and dependency changes that survives after the original agent session and prompt are gone.
Solo developers using Claude Code on side projects and internal tools who just want to remember why they (or their agent) made a change last week, without any enterprise governance overhead.
Install with pip install selvedge, then run selvedge setup inside your project. The interactive wizard detects which AI tools are installed, wires the MCP server into each one's config, adds the agent-instructions block to your project's prompt file, and installs a post-commit hook — re-running it is a no-op.