garbage-collect-memory
Garbage-collect the git-managed memory files under memories/: delete knowledge that no longer holds or is no longer needed, and merge duplicated entries into…
Skill by dyoshikawa
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/dyoshikawa-garbage-collect-memory
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/garbage-collect-memory
What's inside
- Skill name
garbage-collect-memory- Description
- Garbage-collect the git-managed memory files under memories/: delete knowledge that no longer holds or is no longer needed, and merge duplicated entries into one — within a file and across the repository and topic files — so the memory stays short, current and consistent. Use when the user asks to clean up, prune, tidy, deduplicate or garbage-collect the memories, or when the memory files have grown long enough that stale or repeated entries get in the way.
- License
- MIT
- Instructions
- 52 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Garbage-Collect Memory `record-session-memory` only ever adds and updates entries, so over time `memories/` collects facts that went stale, threads that were closed, and the same lesson written down twice in different words. This skill is the counterpart: it removes what is no longer needed and folds duplicates together, without losing anything that still matters. ## What to delete Delete an entry when **one** of these is true — and you have checked it, not guessed it: - **It no longer holds.** The code, config, deployment or external service has changed since it was written (a pitfall fixed upstream, a workaround for a bug that is gone, a version pin that was lifted, a model or API that was replaced). - **It is superseded.** A later decision reversed or replaced it (for example, a "use X" entry after the user switched to Y). Keep only the decision in force; drop the history unless the reason for the reversal is itself worth knowing. - **It is finished.** An open thread, pending task or TODO that has since been done, merged or abandoned. - **It is now derivable.** The fact has since landed in the code, a README, CLAUDE.md, a skill or a test, so the repository itself tells the next session. - **It describes something that is gone.** A repository removed from `repos/`, a service no longer used, a script or file that was deleted. - **It never mattered again.** A one-off detail of a single session that is not a pitfall, a decision or reusable knowledge. Do **not** delete: - The user's stated decisions and preferences, unless the user has since replaced them. - Pitfalls that still reproduce, even if old — age alone is not a reason. - Anything you cannot verify either way. When in doubt, keep it; at most add or refresh its date. ## What to merge - **Duplicates in one file** — two entries that state the same fact, or one that is a subset of another: keep one entry that carries everything the pair said, in the fitting section. - **Duplicates across files** — the same knowledge in `memories/repos/<repo>.md` and a topic file, or in two repository files: cross-repository knowledge lives once in the topic file (`memories/<topic>.md`); the repository file keeps only what is specific to that repository. Do not leave a pointer behind unless the repository file would otherwise lose context a reader needs. - **Contradictions** — two entries that disagree: find out which is true now, keep that one, delete the other. - **Scattered pieces** — several small entries about one subject spread across sections: gather them under one section, one entry where they read as one fact. Merging must not drop information: the merged entry keeps every detail from its sources that still holds, and the most recent date among them. ## How to verify Before deleting or rewriting an entry, check it against the source of truth that it is about: - Code and config — `grep`/read the file in `repos/<repo>` (pull first with `git -C repos/<repo> pull --ff-only` when the clone may be behind; skip the pull if the working tree has uncommitted changes of another session). - History — `git -C repos/<repo> log --oneline -S '<keyword>'` or `git log` on the workspace, to see when a thing was fixed, removed or decided. - GitHub state — `gh issue view` / `gh pr view` for threads that were "open" or "pending". - Other memory files and skills — to find the duplicate or the newer statement. Do not call paid or rate-limited external APIs, deploy, or change anything outside `memories/` to verify an entry. If the only way to verify is such a call, keep the entry. ## Workflow 1. Run `git status` in the workspace. If `memories/` has uncommitted changes from another session, leave those files alone or stop and tell the user. 2. Read `memories/README.md`, then every file under `memories/` (or only the ones the user named). Note each file's size (`wc -l memories/*.md memories/repos/*.md`) to see where the growth is. 3. Go file by file. For each entry, decide **keep**, **delete** or **merge** using the rules above, verifying as described. Also look across files for the same subject. 4. Edit the files: delete, merge and move entries; keep each file's one-line purpose and its section structure; remove sections left empty. Delete a file that is left with nothing, and create no new files except when moving cross-repository knowledge into a topic file that does not exist yet. 5. Update `memories/README.md` so each line still describes what its file covers, and drop lines for deleted files. 6. Show the user a short summary per file: what was deleted and why, what was merged into what, and any entry you kept only because it could not be verified. 7. Commit only the memory files (`git add memories && git commit`) with a message such as `docs(memories): garbage-collect stale and duplicated entries` — on the workspace's default branch, or through a pull request if your workflow requires one.
From dyoshikawa/skills, MIT.
More from dyoshikawa/skills
- 0.561score
batch-all-issues
dyoshikawa
Resolve every open issue one at a time: fact-check each with web research, close the ones that need no action, and run the `goal-pr` skill to fix, review, and…
SkillAFreshness: AClaude Code +9 - 0.561score
batch-all-scrap-issues
dyoshikawa
Resolve every open maintainer-scrap issue one at a time: fact-check each with web research, close the ones that need no action, and run the `goal-pr` skill to…
SkillAFreshness: AClaude Code +9 - 0.524score
create-scrap-issue
dyoshikawa
Create a GitHub issue that consolidates passed content into a single scrap issue with background context and solution details, labeled as maintainer-scrap.
SkillBFreshness: BClaude Code +9 - 0.524score
batch-review-prs-awaiting-maintainer
dyoshikawa
Batch-triage open pull requests: list PRs with prs-awaiting-maintainer, review each with review-pr, then post-review-comments when there are merge-blocker…
SkillBFreshness: BClaude Code +9 - 0.524score
commit-push-pr
dyoshikawa
Commit current changes, push to remote, and create or update a pull request.
SkillBFreshness: BClaude Code +9 - 0.524score
git-worktree-runner
dyoshikawa
Manages git worktrees using git-worktree-runner (gtr).
SkillBFreshness: BClaude Code +9 - 0.524score
goal-pr
dyoshikawa
Drive a pull request to a clean state and merge it: run the `review-pr` skill, fix every mid-or-above finding, and repeat until no mid-or-above findings…
SkillBFreshness: BClaude Code +9 - 0.524score
goal-release
dyoshikawa
Cut a release end to end: use the `draft-release` skill to open the release PR and draft GitHub release, wait for CI to turn green, run the `merge-pr` skill…
SkillBFreshness: BClaude Code +9 - 0.524score
draft-issue-to-external-repository
dyoshikawa
Draft a GitHub issue targeting a third-party repository (outside this project's owner).
SkillBFreshness: BClaude Code +9 - 0.524score
babysit-dependabot-pr
dyoshikawa
Babysit a Dependabot dependency-bump PR all the way to merge: verify the author is the genuine Dependabot bot, diagnose and resolve any CI failure (excluding…
SkillBFreshness: BClaude Code +9 - 0.521score
create-issue-with-websearch
dyoshikawa
Create a GitHub issue from a vague idea by thoroughly researching the topic on the web to sharpen the specification before filing
SkillBFreshness: BClaude Code +9 - 0.518score
diff-analyze
dyoshikawa
Analyze the differences between the current branch and origin/main, and summarize the current work progress
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- Oct 19, 2026 (8 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/dyoshikawa/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from dyoshikawa
- 0.561score
batch-all-scrap-issues
dyoshikawa
Resolve every open maintainer-scrap issue one at a time: fact-check each with web research, close the ones that need no action, and run the `goal-pr` skill to…
SkillAFreshness: AClaude Code +9 - 0.561score
batch-all-issues
dyoshikawa
Resolve every open issue one at a time: fact-check each with web research, close the ones that need no action, and run the `goal-pr` skill to fix, review, and…
SkillAFreshness: AClaude Code +9 - 0.524score
create-scrap-issue
dyoshikawa
Create a GitHub issue that consolidates passed content into a single scrap issue with background context and solution details, labeled as maintainer-scrap.
SkillBFreshness: BClaude Code +9 - 0.524score
commit-push-pr
dyoshikawa
Commit current changes, push to remote, and create or update a pull request.
SkillBFreshness: BClaude Code +9 - 0.524score
git-worktree-runner
dyoshikawa
Manages git worktrees using git-worktree-runner (gtr).
SkillBFreshness: BClaude Code +9 - 0.524score
goal-pr
dyoshikawa
Drive a pull request to a clean state and merge it: run the `review-pr` skill, fix every mid-or-above finding, and repeat until no mid-or-above findings…
SkillBFreshness: BClaude Code +9
Cite this page
garbage-collect-memory skill. Agent Mart. https://agentmart.dev/skills/dyoshikawa-garbage-collect-memory (last updated 2026-10-24)