Skip to main content
ClaudeWave

Decision provenance for AI-coded codebases: the why, and what was already tried and rejected.

MCP ServersOfficial Registry23 stars0 forksPythonMITUpdated today
ClaudeWave Trust Score
95/100
Verified
Passed
  • Open-source license (MIT)
  • Actively maintained (<30d)
  • Clear description
  • Topics declared
  • Documented (README)
Last scanned: 9/13/2026
Install in Claude Code / Claude Desktop
Method: UVX (Python) · selvedge
Claude Code CLI
claude mcp add selvedge -- uvx selvedge
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "selvedge": {
      "command": "uvx",
      "args": ["selvedge"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Package name inferred from the repository name. Verify it exists on PyPI, or clone https://github.com/masondelan/selvedge and follow its README.
Use cases

MCP Servers overview

<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>
  &nbsp;·&nbsp;
  <a href="https://pypi.org/project/selvedge/"><strong>PyPI</strong></a>
  &nbsp;·&nbsp;
  <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: ![Selvedge demo](docs/demo.gif)
-->

---

## 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 r
agent-traceai-agent-reasoningai-agentsai-code-provenanceai-codebase-memoryai-codingclaude-codecodebase-change-trackingcursordeveloper-toolsdevtoolsgit-blamegit-blame-for-ailong-term-memorymcpmcp-servermodel-context-protocolpythonschema-change-historysqlite

What people ask about selvedge

What is masondelan/selvedge?

+

masondelan/selvedge is mcp servers for the Claude AI ecosystem. Decision provenance for AI-coded codebases: the why, and what was already tried and rejected. It has 23 GitHub stars and its last recorded update is dated 2026-09-13.

How do I install selvedge?

+

You can install selvedge by cloning the repository (https://github.com/masondelan/selvedge) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is masondelan/selvedge safe to use?

+

Our security agent has analyzed masondelan/selvedge and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.

Who maintains masondelan/selvedge?

+

masondelan/selvedge is maintained by masondelan. The last recorded GitHub activity is dated 2026-09-13, with 8 open issues.

Are there alternatives to selvedge?

+

Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.

Deploy selvedge to your cloud

Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.

Maintain this repo? Add a badge to your README

Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.

Featured on ClaudeWave: masondelan/selvedge
[![Featured on ClaudeWave](https://claudewave.com/api/badge/masondelan-selvedge)](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>

More MCP Servers

selvedge alternatives