/graft:memory-auditfrom graft
Runs graft maintain loop to clean up memory graph: resolves near-duplicates, supersessions, contradictions, stale notes, and keyword variants against current code without user intervention. Ends with a report.
Ships in graft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The graph rots like any knowledge base: the code moves on and a note goes stale, the same fact gets saved twice, a newer decision replaces an older one. Graft finds these cases and hands them to you as candidates with their evidence; you decide each one against the repository as it is now, and apply the decision with one narrow command. The user installed Graft so they would not have to curate memories by hand: resolve on your own, and only surface what is irreversible or genuinely ambiguous.
Every action below is recorded in graft maintain log and is reversible with restore until the retention window ends (retire purges after maintenance.retention_days, default 30). Never use graft delete in this skill: it is immediate and permanent.
graft maintain status
Cheap (no embedding). Read recommended:
apply-safe → step 2.scan or resolve → step 3.When the user explicitly asked for an audit, run steps 2-3 anyway.
graft maintain apply-safe
Safe by construction: expired nodes, orphan rows, ANALYZE, retired nodes past retention, and exact duplicates (same title and body) collapsed onto the oldest copy. Nothing to decide; note the counts for the report.
Run it from the repository the memories describe, so changed / removed file sources are detected (or pass --root <repo>):
graft maintain scan --limit 20
Candidates come most urgent first. For each one:
graft get <id_hex> (the candidate already shows titles, states and dates).signals.sources[].locator, the code or docs the note talks about, the other note of the pair.graft maintain resolve <candidate-id> --action <action> [--by <id>] [--node <id>] --note "<one line: why>"
Always pass --note: it is the audit trail's only record of your reasoning.
| Kind | Check | Usual decision |
|---|---|---|
source_changed | Does the note still hold for the file as it is now? | Still true → refresh. Outdated → graft insert the corrected note (with --source file:<path>), then supersede --by <new-id>. Not worth rewriting → stale. |
source_removed | Was the file moved or deleted, and is the knowledge still true elsewhere? | Moved → insert with the new source, supersede --by <new-id>. Knowledge gone → retire. |
possible_supersession | Does the newer note (b) replace the older one (a)? | Yes → supersede_a. They say different things → keep_both. |
near_duplicate | Same fact twice? | One says it all → supersede_a / supersede_b (supersede the weaker). Both add something → insert one merged note, then merge --by <new-id>. Different facts → keep_both. |
contradiction | Which side matches the code? | Wrong side → supersede_a / supersede_b so the right one replaces it, or stale --node <wrong-id>. |
possible_contradiction | Do they really disagree (see signals.divergence: negation, opposite terms, numbers)? Which side matches the current code / docs? | Wrong side → supersede_a / supersede_b. Unsure which is outdated → stale --node <doubtful-id>. A real conflict you cannot settle now → contradicts (kept on record, comes back as a contradiction). Not a conflict (different contexts, both true) → keep_both. |
keyword_fragmentation | Does the variant spelling hurt findability? | Usually keep. If it matters → re-insert the note with the established keyword, supersede --by <new-id>. |
isolated_low_value | Is the note still useful to anyone? | No → retire. Yes → keep. |
contradicts (on a pair candidate, or --node <a> --by <b> on any two notes) only records a CONTRADICTS edge and changes no state. keep / keep_both dismisses the candidate until its evidence changes (new content, new file version), so it will not come back on the next scan. For pairs, a is always the older node.
Process the batch, then scan again: resolved and dismissed candidates do not reappear, so the loop converges. Stop after two or three batches in one turn; the rest can wait for the next session.
Only these go to the user, with the candidate and your evidence in two lines:
possible_contradiction, record it with contradicts first so it is not lost);Everything else you resolve yourself. If you are unsure between stale and retire, choose stale: the note stays searchable and the next pass can retire it.
graft maintain log --limit 20 # what was done, by whom, why
graft maintain resolve --node <id> --action restore # back to ACTIVE
graft stats
graft analytics --since 7d
graft analytics
analytics.cache.hit_rate): >= 0.30 healthy on a mature graph; < 0.10 with more than 50 events means unfindable titles or an agent that does not search first.analytics.insert_to_query_ratio): > 1.5 means saving more than searching, which breeds the near duplicates you just resolved.analytics.top_reused_nodes, hits >= 5): load-bearing knowledge; suggest promoting it to the repository's docs.If the user said "audit profile X" or "all profiles", repeat steps 1-4 with GRAFT_PROFILE=X.
A short, readable summary, not a JSON dump:
graft maintenance — profile=<name>
Mechanical: <n> retired purged, <n> exact duplicates collapsed, <n> expired removed
Resolved: <n> candidates (<n> superseded, <n> refreshed, <n> retired, <n> stale, <n> kept)
Pending: <n> (next pass)
Needs you: <only the irreversible / ambiguous cases, one line each, or "nothing">
Hit rate: <pct>% lifetime / <pct>% last 7d [ok | warn | bad]
Hoarding: <ratio>x [ok | warn | bad]
Champions: <id_short> "<title>" (hits=<n>), ...
Keep it under 20 lines. Every resolution is in graft maintain log if the user wants the detail.
graft delete: retirement is the reversible path, and apply-safe does the physical deletion after retention.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aendrix03/graft --plugin graft6 skills in this plugin
/graftPersistent graph memory shared across conversations and agents. Graft is a prompter, not a cache: it hands you notes that may be close to the problem in front of you, and a close note is already a win - it gives you a starting point and reminds you what was decided before. Search it before non-trivial work, and write to it whenever the answer you just produced was not already there. Companion skills: `/recall` (search), `/memoryze` (save), `/learn` (bulk ingest; `/learn docs` for a repository's documentation; `/learn bootstrap` for the unattended cold start of a project), `/memory-audit` (maintenance pass + health check). After `/graft-init` the agent runs the whole lifecycle itself (bootstrap, recall, repair, writeback, bounded maintenance) from one cheap `graft status` call, without asking the user. The daemon auto-starts on the first command./graft-initOne-shot wiring of graft into this agent. Installs the graft CLI first if it is missing (after asking), then asks a single question - global or project - then writes the graft usage rule into the right instruction file (CLAUDE.md or AGENTS.md) and, on Claude Code, a rule file under .claude/rules/graft.md that the instruction file imports. Triggered by `/graft-init`, "configura graft", "set up graft here", "enable graft globally". Idempotent: re-running replaces the previous block in place, it never duplicates or strips anything else./learnBatch knowledge ingestion from external sources (a folder, a codebase, a docs tree). Plans well-shaped nodes with reconciled keywords, shows the plan for approval, then executes idempotently. Triggered by `/learn`, "ingest this folder into memory", "porta questo codice nella memoria", "memorize this codebase". Docs mode (`/learn docs [path]`): all of a repository's documentation and nothing else, incremental on re-runs; "ingest the docs of this repo", "impara la documentazione del repo". Bootstrap mode (`/learn bootstrap [path]`): unattended, progressive cold start of a whole project's memory (topic map, bounded runs by importance, task area first, resumed via `graft project status`); "bootstrap graft for this project", "this project was never bootstrapped", "inizializza la memoria del progetto". Differs from `/memoryze` (1-5 nodes from conversation): `/learn` produces 10-200 nodes from external corpora./memoryzeDistill the current conversation (or a specified excerpt) into N high-quality graft nodes and save them. Triggered by `/memoryze`, "save this to memory", "ricorda questo", "memorize this", or whenever the user explicitly wants the agent to commit knowledge to the persistent graph. The user can hint at granularity ("split into 3 atomic nodes", "one comprehensive node"), focus ("save the WHY, not the diff"), and target profile. Auto-classifies keywords. Prefer this over a raw `graft insert` whenever you're saving more than a one-liner./recallSmart graft search that picks the right tool (query → retrieve → explore) based on the question's shape, escalates when results are weak, and presents findings ranked by confidence with the originating evidence. Triggered by `/recall`, "do we have something about X", "have we seen this before", "ricordi se", "search the graph". Prefer this over a raw `graft query` whenever the user is exploring rather than confirming a known answer.Other plugins' skills for the same job