Selvedge
Selvedge describes itself as “persistent decision memory for AI agents”. Git records what changed. Selvedge records why: the reason behind a change, the approaches that were tried and rejected, and what would make you revisit the decision. A later session, in the same coding agent or a different one, can query that history before touching the same code.
How it works
- Decisions are keyed to entities, not files or chat logs. An entity can be a database column (
users.email), a function (src/auth.py::login), an API route, an environment variable or a dependency (deps/stripe), so the history still applies after code moves. - Agents connect over local MCP (stdio) or use the CLI if they have shell access. The MCP server exposes eight tools, including
log_change,prior_attempts,blame,searchandstale_decisions. - Storage is a local SQLite file in
.selvedge/inside your project. There’s no hosted account, and storing or retrieving decisions makes no LLM calls. selvedge setupwires up common agents: Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI and Windsurf. It asks before changing files, backs up what it touches, adds agent instructions, and offers a Git post-commit hook that stamps each decision with its commit.- Extras: an optional Claude Code plugin with slash commands and a hook that blocks schema and migration edits until the agent has checked prior attempts, a reviewable Markdown digest of decisions for pull requests, and GitHub Actions for review context and coverage checks.
What to know before installing
- It only remembers what gets saved. The README is upfront that Selvedge can’t recall decisions nobody recorded, doesn’t verify that a saved reason is true, and can’t guarantee an agent will consult it. How useful it is depends on your agent following the installed instructions.
- Telemetry is off by default. We read
telemetry.py: nothing is sent unless you opt in, andSELVEDGE_NO_TELEMETRYoverrides consent. In interactive terminals, the CLI checks PyPI for a newer version and prints a notice.SELVEDGE_QUIET=1turns that off. - The database can hold sensitive text. Saved reasoning and diffs live in
.selvedge/selvedge.db. If you commit it or the Markdown digest, review them for secrets first. - Python 3.10 or later. Its CI runs on Linux only, so macOS and Windows aren’t covered by its own tests.
- Small, young project. The repo was created in April 2026 and has one main maintainer. Releases are frequent: v0.3.19 came out on 19 Nov 2026. Stars and dates checked 26 Nov 2026.
Get started
uv tool install --upgrade selvedge
selvedge demo # try it on a throwaway database
cd your-project
selvedge setup # connect your coding agent
Prefer pip? Run python -m pip install --upgrade selvedge in a virtual environment. Then ask your agent to record one real approach you considered and rejected, start a new session, and check that it can look the decision up again.
Using Claude Code? Selvedge plugs into it through MCP. Our Claude Code review covers the agent itself, and Cursor and Windsurf are supported too.