maintenance
File cleanup and archiving. Tidies up bloated Plans.md, session-log.md, old logs, and state files. Trigger: /maintenance, cleanup, archive, organize, split session-log. Do NOT load for: implementation, review, release, new feature development.
- License 许可
- MIT
- 所属仓库
- foden303/harness
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- maintenance
- effort
- low
- description
- File cleanup and archiving. Tidies up bloated Plans.md, session-log.md, old logs, and state files. Trigger: /maintenance, cleanup, archive, organize, split session-log. Do NOT load for: implementation, review, release, new feature development.
- allowed-tools
- [ "Read", "Write", "Edit", "Grep", "Glob", "Bash" ]
- argument-hint
- [plans|session-log|logs|state|all] [--dry-run]
- description-en
- File cleanup and archiving. Tidies up bloated Plans.md, session-log.md, old logs, and state files. Trigger: /maintenance, cleanup, archive, organize, split session-log. Do NOT load for: implementation, review, release, new feature development.
- user-invocable
- true
02 资源文件 1
- 参考文档references/cleanup.md5.4 KB
03 SKILL.md 正文
Maintenance
A single-purpose skill for tidying up cluttered files. Invoke it when auto-cleanup-hook raises a warning, or as routine housekeeping.
Prerequisite: Before destructive operations (archive moves, line deletions), confirm that important information in Plans.md / session-log.md has been promoted to the SSOT (decisions.md / patterns.md). If not yet synced, run
/memory syncfirst.
Quick Reference
| Subcommand | Target | Typical triggers |
|---|---|---|
maintenance plans |
Archive completed tasks from Plans.md | "tidy Plans.md", "move old tasks" |
maintenance session-log |
Split session-log.md by month | "split session-log", "the log is too long" |
maintenance logs |
Delete old files in .claude/logs/ |
"clean up logs", "delete logs older than 30 days" |
maintenance state |
Trim agent-trace.jsonl / harness-usage.json |
"trace bloat", "compact state" |
maintenance all |
Run the four above in order | "tidy everything", "full cleanup" |
Adding --dry-run only lists what would be done without executing. Free-form
instructions (e.g. "also delete old archives", "keep only this session-log") are
accepted in Step 1 and reflected in the processing parameters from Step 2 onward.
Execution Steps
- Parse the user instruction: Extract the subcommand plus any free-form details (exclusions, destinations, day thresholds)
- SSOT sync check: If
.claude/state/.ssot-synced-this-sessionis absent, prompt for/memory sync(required only when touching Plans.md) - Open the reference file: Read
${CLAUDE_SKILL_DIR}/references/cleanup.mdand run the matching section - Report Before/After: Show line counts and deletion counts, then finish
Subcommand Details
For per-target execution steps, thresholds, and archive destinations, see cleanup.md.
Integration with auto-cleanup-hook
The PostToolUse hook (scripts/auto-cleanup-hook.sh / Go version auto_cleanup_hook.go)
detects when Plans.md, session-log.md, or CLAUDE.md exceed their line limits and returns
feedback recommending that you archive old tasks via /maintenance.
When you see this warning, run the corresponding subcommand.
Notes
- Do not move in-progress tasks:
cc:WIP,pm:pendingare excluded from archiving - Archive destination is fixed:
.claude/memory/archive/— confirm with the user before moving anything elsewhere - Backup: Before editing a file over 200 lines, take a local backup with
cp <file> <file>.bak.$(date +%s) - CLAUDE.md is warning-only: Never edit it automatically. Only offer a split proposal
Related Skills
memory— SSOT promotion before tidying Plans.md (updating decisions.md / patterns.md)harness-setup— Routine maintenance right after setup can also be invoked viaharness-setupsession-init— Controls the maintenance-recommendation notice at session start
04 同仓库更多 Skills
escape-skill
暂无简介
zz-review-empty
暂无简介
memory
Manage SSOT, memory, and cross-tool memory search. Guardian of decisions.md and patterns.md. Use when user mentions memory, SSOT, decisions.md, patterns.md, merging, migration, SSOT promotion, sync memory, save learnings, memory search, harness-mem, past decisions, or record this. Do NOT load for: implementation work, reviews, ad-hoc notes, or in-session logging.
harness-work
HAR: Execute Plans.md tasks from single task to full parallel team run. Trigger: implement, execute, do everything, breezing, team run, parallel. Do NOT load for: planning, review, release, setup.
harness-sync
HAR: Sync Plans.md with implementation. Drift detect, marker update, retrospective. Trigger: sync-status, where am I, check progress. --snapshot for snapshots. Do NOT load for: planning, implementation, review, release.
harness-setup
HAR: Project init, tool setup, agent config, memory setup, skill mirror sync. Trigger: setup, init, new project, CI setup, harness-mem, mirror. Do NOT load for: implementation, review, release, planning.