Decision provenance for AI-coded codebases: the why, and what was already tried and rejected.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add selvedge -- uvx selvedge{
"mcpServers": {
"selvedge": {
"command": "uvx",
"args": ["selvedge"]
}
}
}Resumen de MCP Servers
<p align="center">
<img src="docs/wordmark.svg" alt="selvedge" width="480">
</p>
<p align="center">
<a href="https://selvedge.sh"><strong>selvedge.sh</strong></a>
·
<a href="https://pypi.org/project/selvedge/"><strong>PyPI</strong></a>
·
<a href="https://github.com/masondelan/selvedge"><strong>GitHub</strong></a>
</p>
<p align="center">
<a href="https://github.com/masondelan/selvedge/actions/workflows/test.yml"><img src="https://github.com/masondelan/selvedge/actions/workflows/test.yml/badge.svg" alt="Tests"></a>
<a href="https://pypi.org/project/selvedge/"><img src="https://img.shields.io/pypi/v/selvedge?cacheSeconds=3600" alt="PyPI"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
</p>
<!-- mcp-name: io.github.masondelan/selvedge -->
**Long-term memory for AI-coded codebases — including what was already
tried and rejected.**
Line attribution tells you who wrote something. Selvedge tells your agent
what *not* to write next: the approaches this codebase already tried,
reverted, and why. It's a `git blame` for AI agents, for the *why* rather
than which model touched which line — captured live, by the agent, as the
change happens, so nothing downstream has to guess at it.
Selvedge is a local MCP server. AI coding agents (Claude Code, Codex, Copilot, Cursor,
Gemini CLI and Windsurf) call it as they work to log structured change events with
reasoning. Your data stays in a SQLite file under `.selvedge/` next to
your code.
**Local-first by default, team-server by choice, zero-LLM always.**
---
Six months ago, your AI agent added a column called `user_tier_v2`. You don't
know why. `git blame` points to a commit from `claude-code` with a generated
message that says "Update schema." The session that made the change is long
gone — and so is the prompt that produced it.
With Selvedge, you run this instead:
```bash
$ selvedge blame user_tier_v2
user_tier_v2
Changed 2025-10-14 09:31:02
Agent claude-code
Commit 3e7a991
Reasoning User asked to add a grandfathering flag for legacy free-tier
users during the pricing migration. Stores the original tier
so we can backfill discounts without touching billing history.
```
That reasoning was **captured by the agent in the moment** — written into
Selvedge from the same context that produced the change. Not inferred from
the diff afterward by a second LLM. Not a hand-typed commit message.
---
<!-- DEMO GIF
Record a 30–45 second terminal session showing:
1. `selvedge status` → shows N total events
2. `selvedge blame payments.amount` → full output with reasoning
3. `selvedge diff users --since 30d` → table of recent changes
4. `selvedge search "stripe"` → filtered results
Use `vhs` (https://github.com/charmbracelet/vhs) or Asciinema.
Replace this comment block with: 
-->
---
## Who Selvedge is for
Selvedge has two audiences. Same tool, same `pip install`, same SQLite
file under `.selvedge/`. Different scale of pain.
**Teams running long-term, AI-coded codebases.**
When the project is big enough that you (or someone else) will touch it
again in six months, twelve months, three years — but most of it was written
by an agent whose context evaporated the day each PR shipped. `git blame`
tells you what changed. Selvedge tells you *why* — even after the agent
session, the prompt template, the developer who asked for it, and the model
version are all long gone. This is the original use case: production
codebases, schema decisions, migrations, dependency changes that need an
audit trail that survives turnover.
**Solo developers using Claude Code on everyday projects.**
Side projects, weekend builds, the small internal tool you keep poking at.
You don't need enterprise governance — you just need to remember why you (or
your agent) did the thing you did yesterday, last week, last sprint. Run
`selvedge init` once. Add four lines to your `CLAUDE.md`. From then on,
`selvedge blame` is muscle memory — a way to talk to your past self when
your past self was an LLM.
If you've ever come back to your own AI-built project and thought "what was
this *for* again?", Selvedge is the missing piece.
---
## The problem
Human-written code leaks intent everywhere — commit messages, PR descriptions,
inline comments, the Slack thread that preceded it. AI-written code doesn't.
The agent has perfect clarity about why it made each decision, but that
context lives in the prompt and evaporates when the conversation ends.
Six months later, your team is debugging a schema decision with no trail.
`git blame` tells you *what* changed and *when*. It can't tell you *why*.
**Selvedge captures the why — live, by the agent itself, as the change is
made.** The diff is git's job. The why is Selvedge's.
---
## What's new in v0.3.14
**Explicit seven-day lookups work as documented.**
The MCP `prior_attempts` tool now accepts `window_minutes=10080`, matching its
seven-day default. Previously, sending that value explicitly failed validation
because the time window incorrectly shared the 1,000-result pagination cap.
The allowed window is 1–10,080 minutes; result limits remain capped at 1,000.
No new dependencies, migrations or MCP tools.
---
## What's new in v0.3.13
**Keep the review context with a recorded rejection.**
- Session-start summaries show when a decision has expired or needs manual review, including in the rejection section.
- Superseded decisions leave the revisit list without hiding unrelated decisions on the same path. History stays intact; reopening remains explicit.
- [Feedback and correction guide](docs/community-feedback.md): how reports become product decisions, and how to reopen a mistaken rejection using `supersede`.
---
## Where Selvedge fits
<p align="center">
<img src="docs/ecosystem.svg" alt="Where Selvedge fits in the broader AI-coded-codebase tooling stack" width="720">
</p>
AI agents call Selvedge as they work. Selvedge captures the *why*
into a durable, queryable store and emits it back out — as
[Agent Trace](https://agent-trace.dev/) records for
cross-tool readers, as observability metadata that links into
Sentry/Datadog stack traces, and as compliance artifacts for SOC 2
and EU AI Act audits.
Selvedge does **not** replace `git` (line-level what/when), PR review
tools (review-time quality), agent observability (LLM call traces),
or general-purpose code-host AI features. It sits between them — the
provenance-as-first-class-citizen layer that everything else
references.
---
## How Selvedge compares
There's a fast-growing "git blame for AI agents" category. Here's where
Selvedge fits — and where it deliberately doesn't.
| | Rejected paths | Reasoning source | Granularity | Mechanism | Grouping | Storage |
|---|---|---|---|---|---|---|
| **Selvedge** | **Queryable** — `prior_attempts` returns tried → reverted → re-opened | **Captured live**, by the agent in the same context that produced the change | **Entity** — DB column, table, env var, dep, API route, function | **MCP server** — agent calls it as work happens | **Changesets** — named feature/task slugs across many entities | SQLite, zero deps |
| [OpenLore](https://github.com/clay-good/OpenLore) | Purged — `rejected` is an inactive status, dropped from the queryable store after each decision sync (the annotation survives in the synced spec markdown) | **Derived** — tree-sitter static analysis of code state, plus commit-gated decision notes | AST node (18 languages + 12 IaC) | MCP server — one-time index + commit-time certificates | Call-graph edges | SQLite graph in `.openlore/` |
| [AgentDiff (sunilmallya)](https://github.com/sunilmallya/agentdiff) | None | **Inferred post-hoc** by Claude Haiku from the diff at session end | Line | Claude Code lifecycle hooks → local daemon | Session/task | JSONL on disk |
| [AgentDiff (codeprakhar25)](https://github.com/codeprakhar25/agentdiff) | None | ed25519-signed cross-agent provenance | Line | Per-agent editor hooks + git hooks (sign at commit) | None | Signed traces in git refs |
| [Origin](https://github.com/opsworks-co/origin-cli) | None — `rework` flags reverted AI code post-hoc, without rationale | Prompt receipts, captured live per turn | Line | Agent lifecycle hooks + git post-commit hook | None | Git notes + sessions branch |
| [Git AI](https://github.com/git-ai-project/git-ai) | None | Attribution metadata | Line | **Agent-invoked checkpoint** → Git notes at commit | None | Git notes |
| [BlamePrompt](https://github.com/Ekaanth/blameprompt) | None | Prompt receipts — prompt, cost, tools; no stated rationale | Line | Agent-lifecycle hooks + post-commit hook | None | Git notes |
**Why "rejected paths" matter — the one that isn't copyable.** The expensive
failure isn't forgetting why a column exists. It's an agent confidently
re-implementing something the team already killed for a good reason, six
months after everyone who knew that left the context window. None of the
line-attribution tools above surface rejected paths at all, and it isn't a
feature gap they can close in a release — a line-oriented store has no notion
of an entity that persisted across a try → revert → retry cycle. See
[`docs/demos/prior-attempts.md`](docs/demos/prior-attempts.md).
**Why determinism matters.** Selvedge's reasoning is the agent's own intent,
written from the same context window that produced the change. There is no
model anywhere in the storage or retrieval path, so the same query returns the
same answer today and in two years, across model versions. Tools that infer
reasoning post-hoc are running a second LLM that never saw the original
prompt: what it produces is paraphrase, and re-running it can produce
different categories for the same change. As a Hacker News commenter put it
about a competing approach, *"grep won't find your commit because you rLo que la gente pregunta sobre selvedge
¿Qué es masondelan/selvedge?
+
masondelan/selvedge es mcp servers para el ecosistema de Claude AI. Decision provenance for AI-coded codebases: the why, and what was already tried and rejected. Tiene 23 estrellas en GitHub y su última actualización registrada es del 2026-09-13.
¿Cómo se instala selvedge?
+
Puedes instalar selvedge clonando el repositorio (https://github.com/masondelan/selvedge) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar masondelan/selvedge?
+
Nuestro agente de seguridad ha analizado masondelan/selvedge y le ha asignado un Trust Score de 95/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.
¿Quién mantiene masondelan/selvedge?
+
masondelan/selvedge es mantenido por masondelan. La última actividad registrada en GitHub es del 2026-09-13, con 8 issues abiertos.
¿Hay alternativas a selvedge?
+
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega selvedge en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/masondelan-selvedge)<a href="https://claudewave.com/repo/masondelan-selvedge"><img src="https://claudewave.com/api/badge/masondelan-selvedge" alt="Featured on ClaudeWave: masondelan/selvedge" width="320" height="64" /></a>Más MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
The fastest path to AI-powered full stack observability, even for lean teams.