cd /news/ai-tools/show-hn-selvedge-long-term-memory-fo… · home topics ai-tools article
[ARTICLE · art-53533] src=selvedge.sh ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Show HN: Selvedge – long-term memory for AI-coded codebases

Selvedge, a new open-source tool, provides long-term memory for AI-coded codebases by capturing the reasoning behind code changes made by AI agents like Claude Code, Cursor, and Copilot. It stores the 'why' in a local SQLite file, enabling developers to query past decisions and avoid repeated mistakes. The tool addresses the problem of lost context when AI agents generate code without preserving their rationale.

read3 min views1 publishedJul 10, 2026
Show HN: Selvedge – long-term memory for AI-coded codebases
Image: source

Captures the why, live

AI agents call Selvedge’s MCP tools while they work — log_change

records what they changed and why, in the same context window that produced the change.

Long-term memory for AI-coded codebases.

A local MCP server. AI coding agents (Claude Code, Cursor, Copilot) call it as they work to log the why behind every change — captured live, in the same context that produced it. Stays in a SQLite file under .selvedge/

next to your code.

pip install selvedge

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:

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.

It also reads back out: Selvedge exports its history as Agent Trace records, so the why travels into whatever observability or audit tooling already speaks that format.

Captures the why, live

AI agents call Selvedge’s MCP tools while they work — log_change

records what they changed and why, in the same context window that produced the change.

Tracks entities, not lines

Attribution is at the thing you actually search for: users.email

, env/STRIPE_SECRET_KEY

, api/v1/checkout

, deps/stripe

. Prefix queries work everywhere.

Stays local, stays simple

Zero deps beyond MCP + Click + Rich. SQLite under .selvedge/

next to your code. No accounts, no servers, no telemetry.

And it reads back: before editing an entity, your agent calls prior_attempts to see what was already tried and reverted — active memory, so it doesn’t repeat a mistake the team already undid.

Three commands. The third one is interactive — it detects which AI tools are on your machine (Claude Code, Cursor, Copilot) and wires Selvedge into each one’s config. Every modified file gets a .bak

written before any change reaches disk.

That’s it. Open a second terminal and run selvedge watch

to live-tail events as your agent makes them. Then start asking your codebase questions:

Full quickstart → · CLI reference → · MCP tool reference →

selvedge setup

already wires the editors it finds. To add the selvedge-server

MCP server to one yourself, every editor below has a step-by-step page:

Each page’s config runs the server with uvx, so it works without a global install — just have uv on your machine. Prefer pip? pip install selvedge and point your editor at the selvedge-server command.

Teams running long-term, AI-coded codebases. When the project is big enough that someone will touch it again in 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, the developer who asked for it, and the model version are all long gone.

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.

If you’ve ever come back to your own AI-built project and thought “what was this for again?”, Selvedge is the missing piece.

AI agents call Selvedge as they work. Selvedge captures the why into a durable, queryable store and emits it back out as Agent Trace records, observability metadata, and compliance artifacts.

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.

Selvedge is open source (MIT) and lives in four directories beyond GitHub.

PyPI

pypi.org/project/selvedgepip install selvedge

Smithery

smithery.ai/server/masondelan/selvedge — MCP catalog

Glama

glama.ai/mcp/servers/masondelan/selvedge — MCP directory

mcpservers.org

mcpservers.org/servers/masondelan/selvedge — MCP directory

GitHub

github.com/masondelan/selvedge — source, issues, releases

── more in #ai-tools 4 stories · sorted by recency
── more on @selvedge 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-selvedge-lon…] indexed:0 read:3min 2026-07-10 ·