selvedge — Claude Code skill: what it does, how to install
A local change memory for functions and database schemas. It stops your agent from repeating previously reverted approaches without any LLM calls.
npx skills add masondelan/selvedge --skill selvedge -a claude-codeWhat selvedge does
This skill connects an agent to a local Selvedge store using an MCP connection or shell commands. Before modifying an API route, function, or environment variable, the assistant inspects prior_attempts. If someone already tried and discarded the approach, Selvedge presents the past reasoning so the agent picks a different path.
After finishing an edit, the agent runs log_change to record what changed. The server insists on a full sentence for the reasoning field, flagging one-word entries like "done". When building a feature across multiple files, assigning a single changeset_id groups the edits together. Discarded approaches get marked with reject, while revived plans require an explicit supersede status.
Everything remains on the local disk. You do not need a running MCP server to query records, because the selvedge binary runs directly from your shell path.
What it helps with
- inspect previous attempts on an entity before editing it
- record modifications to database columns and API endpoints
- track discarded and reverted architectural decisions
- reopen obsolete decisions with an explicit supersede status
Example prompts for the agent
- Run
selvedge prior-attemptson theauth_tokenstable before changing the schema. - Record the new environment variable in
selvedge logwith full reasoning. - Search for previously rejected approaches using
selvedge search "session caching".
How to install selvedge
1Skills CLI (Vercel)
npx skills add masondelan/selvedge --skill selvedge -a claude-code2Manually: put the files in place
~/.claude/skills/selvedge/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/selvedge/
1Skills CLI (Vercel)
npx skills add masondelan/selvedge --skill selvedge -a codex2Manually: put the files in place
.agents/skills/selvedge/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add masondelan/selvedge --skill selvedge -a cursor2Manually: put the files in place
.cursor/skills/selvedge/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install masondelan/selvedge selvedge2Manually: put the files in place
.github/skills/selvedge/SKILL.md1Skills CLI (Vercel)
npx skills add masondelan/selvedge --skill selvedge -a gemini-cli2Platform CLI
gemini skills install https://github.com/masondelan/selvedge --path skills/selvedgeManually: put the files in place
.devin/skills/selvedge/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add masondelan/selvedge --skill selvedge -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about selvedge
How to install selvedge in Claude Code?
Run npx skills add masondelan/selvedge --skill selvedge -a claude-code. The skill configures itself under ~/.claude/skills/selvedge/SKILL.md.
What does selvedge do?
It acts as an offline record of modifications made to your code, dependencies, and database schemas. It helps AI agents track why changes occurred and avoids repeating rejected work.
Does selvedge require an active MCP server?
No, the selvedge CLI shares the same local storage and functions independently on your path. You can inspect history or log changes from your shell without running background MCP processes.
Source text
SKILL.md · MIT
--- name: selvedge description: Use before editing a tracked entity (a DB column, table, function, API endpoint, dependency, or env var) and after any substantive change. Call prior_attempts first to learn whether the change was tried and reverted before, then log_change to record what changed and why. Selvedge is this project's change memory — a local MCP server and CLI, no LLM calls. --- ## Selvedge — change tracking Use Selvedge for change tracking through its CLI or optional MCP connection (MCP server: `selvedge`). Both use the same local store. Use whichever route is available in the current workflow. **Rules:** - Call `selvedge.log_change` immediately after adding, modifying, or removing any DB column, table, function, API endpoint, dependency, or env variable. - Set `reasoning` to the user's original request or the problem being solved. Write at least one full sentence — the server will warn on empty, very short, or generic values like "user request" or "done". Good example: "User asked to add 2FA — needs phone number to send SMS verification codes." - Set `agent` to a stable name for the agent or tool making the change. - Set `session_id` if you have access to the current session/conversation ID. - Set `git_commit` to the commit hash once you know it. - For multi-entity changes (e.g. adding a whole feature), set a shared `changeset_id` on all related `log_change` calls — use a short slug like `add-stripe-billing`. This lets anyone query the full scope of the change with `selvedge.changeset()`. - Before editing an entity, call `selvedge.prior_attempts` on it — if the same change was tried before and reverted, you'll see the prior reasoning and why it was rejected, and can change your plan instead of repeating a rejected approach. Where a compatible edit-gate hook is installed and active, watched edits require this lookup. Hook capabilities and activation depend on the client. - A reverted decision is not a permanent ban. If the constraint that killed it no longer holds, re-open it explicitly with `change_type="supersede"` (never re-apply a reverted change without superseding it first). - Log abandoned paths too: use `change_type="reject"` when you considered an approach and decided against it without writing it, and `change_type="revert"` when you rolled a change back — ideally with `stale_when` or `expires_when` naming the condition that would invalidate the verdict, so `stale_decisions` can surface it later. - Then call `selvedge.diff` or `selvedge.blame` for the entity's broader history before conflicting with past decisions. **The same operations are on your shell.** The CLI and MCP interface use the same local store (`selvedge` is on your PATH after install). The CLI does not require a running MCP server. Use the route that fits the current workflow and keeps context light: - Check an entity first: `selvedge prior-attempts <entity>` (was it tried and reverted before?), then `selvedge blame <entity>` / `selvedge diff <entity>` for its broader history. - Log a change: `selvedge log <entity> <change_type> --reasoning "<why>"` (change_type: add, remove, modify, rename, retype, create, delete, index_add, index_remove, migrate, revert, reject, supersede; for a rename add `--rename-from <old>`). - Re-open a reverted decision: `selvedge supersede <entity> --reasoning "<why>"`. - Find things: `selvedge search "<query>"`, `selvedge history --since 7d`, `selvedge stale` (decisions now due for a revisit). Add `--json` to any read command; `selvedge <command> --help` gives detail on demand.
© masondelan · MIT · masondelan/selvedge