Selvedge logo

Selvedge

by masondelan

Stores structured code-change decisions in local SQLite and lets agents query history, prior attempts, stale decisions, and rationale over MCP.

Install Selvedge

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "masondelan-selvedge": {
      "command": "uvx",
      "args": [
        "--from",
        "selvedge",
        "selvedge-server"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio masondelan-selvedge -- uvx --from selvedge selvedge-server

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

masondelan/selvedge records codebase changes, rejected approaches, reversions, and the reasoning behind them in a project-local SQLite store. Agents can retrieve entity history, semantic blame, changesets, full-text matches, prior attempts, and decisions that may need review through a local stdio MCP server. Use it when coding sessions need durable decision context across restarts, agents, or tools, especially before editing an entity with a history of failed approaches. The deterministic retrieval and stale-decision checks run without hosted services or LLM calls.

Use cases

  • Record why an agent selected an implementation approach
  • Review prior rejected or reverted attempts before editing an entity
  • Trace all decisions associated with a feature changeset
  • Find decisions whose constraints may no longer apply

Key features

  • Local SQLite decision history
  • Semantic entity blame and prefix history
  • Deterministic prior-attempt inference
  • Rejection, revert, rename, and supersede events
  • Full-text search across reasoning and changes
  • Stale-decision and revisit detection

Tools8

What Selvedge lets your agent do. Expand a tool for its parameters.

Verified live~4.5k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

28/28 checks healthy over the last 117d

What it can do

From the 8 tools this server returned when we ran it; 8 declare their own safety hints.

Can delete or modify data · 1Makes changes · 1Handles credentials · 1Read-only tools · 7
Network at startup2 connections
Files written at startup12

Observed 2026-12-02 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · selvedge (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars27Stargazers on the source repository.
Last commit5d agoMost recent push to the default branch.
Tools exposed8Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Selvedge works

What masondelan/selvedge does

masondelan/selvedge gives AI coding agents a persistent record of why a change was made, what alternative was rejected, and which condition could make the decision obsolete. Records are associated with semantic codebase entities such as functions, database columns, API routes, environment variables, and dependencies. The project stores data locally in SQLite under .selvedge/, allowing separate agent sessions and compatible clients to use the same decision history.

The system complements Git rather than replacing it: Git tracks code history, while Selvedge records the reasoning and abandoned paths that a diff may not preserve.

How it works

Agents write events with log_change, ideally immediately after a meaningful change and before a session ends. Events include an entity path, entity type, change type, diff-related information, and reasoning. Renames preserve continuity by recording the old and new paths. Rejections, reverts, and supersedes distinguish an abandoned idea from a change that was written and later rolled back, or a previously reverted decision that has become valid again.

Before editing, an agent can call prior_attempts to find earlier approaches and inferred outcomes. Its matching is deterministic and conservative: exact rejected or reverted records are preferred, while lower-confidence proximity matches can be requested explicitly. stale_decisions identifies records that are past a revisit date, have a fired expiration condition, or have later activity whose terms resemble a stated invalidation condition. These tools surface candidates for review; they do not automatically retire decisions.

Setup and configuration

Install the package with uv and run selvedge setup inside a project:

bash
uv tool install --upgrade selvedge
cd your-project
selvedge setup

The setup command can configure supported agent presets, including claude-code, codex, cursor, gemini, and windsurf. Selvedge also provides a local stdio MCP mode through selvedge demo --mcp. Python 3.11 through 3.14 is recommended; Python 3.10 remains compatible.

No hosted account is required. The core local storage and retrieval path uses SQLite and makes no LLM calls. A CLI is also available for agents with shell access.

Tools and capabilities

  • log_change writes validated events and returns an assigned ID and timestamp. It supports rename, reject, revert, and supersede workflows, with warnings for weak reasoning or unusual entity paths.
  • diff returns newest-first history for an entity, including prefix matches and supersession state.
  • blame reports the latest semantic change, its authoring context, reason, status, and superseding event.
  • history filters events by time, entity, project, or changeset.
  • changeset reconstructs all events belonging to a shared task or feature.
  • search performs full-text matching across paths, diffs, reasoning, and agents.
  • prior_attempts finds earlier attempts and reports outcomes, confidence, similarity, and decision trails.
  • stale_decisions reports deterministic revisit and expiration signals using dates, entity changes, dependency metadata, or later matching activity.

Limitations and notes

Only explicitly recorded decisions can be retrieved, and their reasoning is supplied by a person or agent rather than independently verified. Retrieval does not guarantee that an agent will consult or correctly apply a record. Expiration checks use locally observable state; manual conditions and unobservable dependency conditions require review. Read-only storage access is available from Python, but it is not a filesystem write boundary or authorization mechanism.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Selvedge

masondelan/selvedge is an MCP server that connects AI coding agents to a local SQLite decision store. Its main tools record changes and reasoning with log_change, then retrieve context through diff, blame, history, changeset, search, prior_attempts, and stale_decisions across coding sessions.

Install it with uv using `uv tool install --upgrade selvedge`, then run `selvedge setup` in the project directory. Setup can configure supported agent presets, and `selvedge demo --mcp` starts a local stdio MCP demonstration.

Yes, Cursor is one of the supported setup presets. Run `selvedge setup` in the project and select the Cursor preset with `--agent cursor` when choosing the configuration explicitly.

Selvedge stores decisions in a local SQLite database under the project’s `.selvedge/` directory. The same store can be used across compatible tools and separate local MCP server processes, without a hosted account.

Call `prior_attempts` before editing the entity. It returns earlier attempts, inferred outcomes, confidence, similarity, reasoning, and any supersede trail; exact rejected or reverted records are treated as strong evidence not to repeat the approach without superseding it.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSelvedge AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/masondelan-selvedge?style=directory)](https://allmcps.com/mcp/masondelan-selvedge)
HTML Embed
<a href="https://allmcps.com/mcp/masondelan-selvedge"><img src="https://allmcps.com/api/badge/masondelan-selvedge?style=directory" alt="Selvedge on AllMCPs" /></a>