No slash command · from cc-tools
Curate the session's per-branch agent-memory inbox in one acting pass. Grades every captured entry transfer-or-delete, writes the durable ones into the repo's own documentation as present-tense constraints, commits and pushes them on the given branch, and empties the inbox. Takes the branch name.
Ships in cc-tools. 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.
You are running the /cc-tools:agent-memory-inbox-cleanup skill. Turn
this run's captured memory entries into durable repo documentation, and
throw away the rest.
The entries were written by agents in throwaway worktrees and copied
into the inbox by /cc-tools:agent-memory-inbox-capture. Nothing reads
the inbox back. You are the only reader it will ever have, so an entry
you neither transfer nor delete is simply lost — grade every one.
Read skills/lib/agent-memory-inbox.md for the inbox path and its
<plugin>-<agent>/ layout, and skills/lib/agent-memory-grading.md
for the grading rubric: what counts as durable, the evidence a delete
must produce, how a transfer is phrased, which file it lands in, and
the standard that file is held to once you have written into it — which
includes deleting what no longer earns its place, whoever wrote it.
This skill restates neither.
/cc-tools:agent-memory-inbox-cleanup <branch>
<branch> (required) — the branch whose inbox is curated, and the
branch the transfers are committed and pushed onto.Two, and no more:
| Verdict | What happens |
|---|---|
| transfer | the constraint is written into a governing README, a docs/rules/*.md, or CLAUDE.md, and the inbox entry is deleted |
| delete | the inbox entry is deleted and nothing is written |
There is no third verdict that keeps an entry where it is — nothing reads the inbox back, so keeping an entry there discards it at the end of the session with extra steps. Two consequences the rubric leaves to each calling skill follow:
transfer iff the entry states a present-tense constraint this repo
should carry — the rubric's "What counts as durable" or the class
beside it. Everything else is delete, including an entry you cannot
pin to a delete case: the rubric's fallback for that is a
keep-in-place verdict this skill does not have, and publishing into
the one file every agent reads is the wrong way to resolve a doubt.
The delete cases remain the shapes to look for, and their evidence
bar remains what you produce in the report when you cite one.These exist so the skill curates the right memories onto the right branch and cannot clash with another checkout. Run both before reading anything:
git ls-remote --exit-code --heads origin <branch>
git branch --show-current
<branch> must exist on origin.git branch --show-current must equal <branch>.On either failure, abort: name the branch you were given and what you found instead, and change nothing — no edit, no delete, no commit. The caller checks the branch out; this skill never does.
Enumerate this branch's inbox entries:
find <inbox path for this branch> -type f -name '*.md'
An inbox directory that is absent or empty is not a failure: it means no agent wrote a memory this run, or none survived capture's session-scope filter. Report that there was nothing to grade and stop.
Otherwise read every entry in full, plus the surfaces the rubric grades against.
Give every entry exactly one verdict per the rubric, then:
<plugin>-<agent>/ directory, and the
branch's inbox directory itself. The inbox is empty when you are
done.Deletions are not confirmed with anyone. The inbox is not a repository and holds no undo, which is why a delete that cites a rubric case has to produce that case's evidence, and a delete that cites none has to say so in the report: an unexamined delete is the one thing this pass cannot take back.
Stage by explicit path — CLAUDE.md, each docs/rules/*.md, and each
README you changed, whether you wrote a constraint into it, cut one
out of it, or created the file to receive a transfer — a README you
created is untracked, so staging it by path is what puts it in the
commit at all — plus any companion edit the repo's own rules obliged
that change to carry. Never git add -A, and never a directory-wide
add. Nothing under .claude/agent-memory/ is ever staged: the memory
tree is not part of this flow.
git add <each path you changed>
git diff --cached --name-only
If that output is empty, there is nothing to commit: do not run
git commit, and do not report a commit SHA. The previous tip of the
branch is not your commit, and claiming it would misattribute someone
else's work as this run's output. This is a valid outcome, distinct
from the empty-inbox case above — here entries existed and were graded,
they just left the tree unchanged.
Use git diff --cached --name-only, not git status --porcelain: the
latter also reports untracked and unstaged changes elsewhere in the
worktree, so an unrelated stray file would make its output non-empty
even when nothing was staged, falsely skipping this no-op path and
falling through to git commit with an empty index.
Otherwise commit and push:
git commit -m "Transfer agent memory into repo docs"
git push
The commit message must never place a closing keyword (close,
closes, closed, fix, fixes, fixed, resolve, resolves,
resolved, case-insensitive) immediately before an issue reference
(#N, owner/repo#N, GH-N, or an issue URL) — that pattern
auto-closes the referenced issue.
A commit or push failure is a genuine failure, not the no-op case above: do not report success, and do not report a SHA you have not verified on the remote. Verifying the push is the caller's gate; report the SHA you pushed and let it check.
Report one line per entry, grouped by verdict, one per section you cut
from a destination file, and always a Commit: line — the field the
caller branches on, so it is present on every path including the ones
where there is no SHA to give:
## Agent memory curation
Transferred (N):
- <plugin>-<agent>/<file> -> <destination> — <the constraint, one line>
Deleted (N):
- <plugin>-<agent>/<file> — <the delete case, and the check that substantiated it>
- <plugin>-<agent>/<file> — no citable delete case; states no constraint the repo should carry
Cut from <destination> (N):
- <section> — <why it no longer earns its place>
Inbox: emptied
Commit: <SHA> | none — <why nothing was staged>
A <destination> the transfer created rather than edited carries
(created) after its path — the caller has no other way to tell a new
file from an amended one.
Where the inbox was absent or empty, the report is that one fact plus
Commit: none.
The two delete lines above are the two shapes a deletion takes, and every deleted entry is reported as one of them. A delete that cites a rubric case quotes the check that substantiated it. A surviving-bar delete cites no case — there is none to cite — so it says so in those words instead, which is the whole record a human gets of an entry nothing else grades.
The per-entry and per-cut lines are the record of a destructive operation. Report all of them — those are what a human reads to tell curation from data loss.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub thevoskamps/claude-plugins-marketplace --plugin cc-tools8 skills in this plugin
/agent-memory-cleanupCurate a repo's .claude/agent-memory/ in one acting pass. Grades every entry persist / scrub / transfer, deletes what the code or the repo's documentation already says, moves durable lore into that documentation as present-tense constraints, and repairs the MEMORY.md indexes and wikilinks. Takes an optional PR number; with none, curates the current working tree./agent-memory-inbox-captureCopy the invoking agent's own .claude/agent-memory/<plugin>-<agent>/ entry files that outlive this run into the session's per-branch agent-memory inbox under the scratchpad, so a curator can transfer the durable ones into the repo's own documentation. Takes no arguments and commits nothing./Other plugins' skills for the same job