context-rot-cleanup
Examine workspace files for durable context, filter out low-value noise, and clean up stale memory or rule files that contribute to context rot.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Examine workspace files for durable context, filter out low-value noise, and clean up stale memory or rule files that contribute to context rot.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Distill Herd commander memory, clean stale MEMORY.md entries, promote durable commander lessons into LONG_TERM_MEM.md, and propose shared-knowledge updates through a review gate. Use for periodic commander memory cleanup.
Write or rewrite agent skill files so they are outcome-oriented, bounded, and easy for another agent to apply. Use when creating a new skill, translating a skill, or tightening an existing skill's acceptance criteria, boundaries, or output contract.
Add or pair a Herd machine — mint an enrollment token and return the one-line connect command, or re-pair an existing daemon machine.
Conversationally collect, validate, preview, and create a new Herd commander through the backend API.
Create a Herd automation from a conversation while preserving sourceConversationId provenance.
Turn a structured outline, report, or research brief into a presentation plan with slide-by-slide content and visual direction.
| name | context-rot-cleanup |
| description | Examine workspace files for durable context, filter out low-value noise, and clean up stale memory or rule files that contribute to context rot. |
| user-invocable | true |
| argument-hint | [ROOT_DIR] [--mode observer|reflector] [--since YYYY-MM-DD|--days N] |
| disable-model-invocation | false |
| allowed-tools | Bash, Read, Write, Edit, Glob |
Use this skill when a workspace has accumulated logs, notes, memory files, or agent guidance that may be stale, duplicated, too verbose, or missing durable lessons. The goal is to preserve only reusable context that is likely to matter for future work, while deleting or rewriting context that wastes attention.
$ARGUMENTS:
ROOT_DIR - Workspace root to inspect. Default to the current directory.--mode observer - Append fresh observations only. Do not edit rule files.--mode reflector - Promote durable observations into rules and clean stale
memory. Default when the user asks to clean up context rot.--since YYYY-MM-DD or --days N - Observation window. Default to today for
observer mode and the current active memory horizon for reflector mode.AGENTS.md, CLAUDE.md, or the closest
project-local agent guide under ROOT_DIR. If a guide points to routing
tables or rule indexes, read only the files needed for this cleanup.find, ls, rg) inside ROOT_DIR. Do not
rely on a top-level git diff as the only input because workspaces can contain
nested repositories or untracked context files.Date frontmatter/header and ignore old
posts changed only by formatting.Use the target workspace's existing tier labels if present. Otherwise classify items with these plain labels:
HIGH - Hard constraints, reusable methods, architectural decisions, safety
boundaries, and cross-project lessons.MEDIUM - Active project state, current technical tradeoffs, near-term
milestones, and module-specific decisions likely to matter soon.LOW - Routine task logs, completed todos, transient debugging details, and
context useful only for the current session or day.Promote HIGH items to durable rules or guides in reflector mode. Keep only
still-active MEDIUM items in memory. Drop or summarize LOW items unless the
user asked for an audit trail.
Resolve ROOT_DIR, mode, date window, and the local memory/rules paths.
Common paths are contexts/memory/OBSERVATIONS.md, rules/, AGENTS.md,
CLAUDE.md, docs/, and project-specific knowledge bases.
Build a scoped file inventory for candidate Markdown, text, CSV, and config files. Exclude dependency directories, build outputs, caches, and known mechanical logs.
Read candidate files and extract only evidence-backed observations. For each candidate, record tier, date or freshness, source path, and why it should survive future context loading.
In observer mode, append observations to the workspace observation file. Use the existing local format; otherwise write:
Date: YYYY-MM-DD
- [HIGH] <durable observation> (evidence: path:line)
- [MEDIUM] <active project state> (evidence: path:line)
In reflector mode, compare current observations against rule and memory files. Promote durable rules to the narrowest authoritative file, rewrite observations to remove promoted or expired entries, and delete duplicated context inside memory files when the same fact now lives in a rule.
Stop without edits if the scan finds no durable signal. Report that no cleanup was warranted instead of creating filler observations.
Produce file edits in the target workspace:
contexts/memory/OBSERVATIONS.md.Report a concise walkthrough with: