agentleFS
maxwell2732maxwell2732/claudecode-research-harness-workflow/skills/maintenance/SKILL.md

maintenance

Skill42 starsChanged 6 days agoMITView on GitHub

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.

17 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use recall and release.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • termdockSkill

    recall

    Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.

    Also in 3 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add --dry-run to only list what would be done without executing.

    line 30
  2. Very specific:

    SSOT sync check: If .claude/state/.ssot-synced-this-session is absent, prompt to run /memory sync (required only when touching Plans.md)

    line 37
  3. Very specific:

    Open reference file: Read ${CLAUDE_SKILL_DIR}/references/cleanup.md and execute the relevant section

    line 39
  4. Distinctive:

    When you see this warning, run the relevant subcommand.

    line 51
  5. Very specific:

    Backup: Before editing files over 200 lines, take a local backup with cp <file> <file>.bak.$(date +%s)

    line 57
  6. Distinctive:

    CLAUDE.md is warning-only: Do not auto-edit. Only propose a split

    line 58

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Maintenance

A single-purpose skill for tidying up messy files. Invoke when auto-cleanup-hook issues a warning, or as routine housekeeping.

Prerequisite: Before destructive operations (archiving, line deletion), confirm that important information in Plans.md / session-log.md has been promoted to SSOT (decisions.md / patterns.md). If not yet synced, run /memory sync first.

Quick Reference

SubcommandTargetTypical Trigger
maintenance plansArchive completed tasks in Plans.md"Organize Plans.md", "Move old tasks"
maintenance session-logMonthly split of session-log.md"Split session-log", "Log is too long"
maintenance logsDelete old files in .claude/logs/"Clean up logs", "Delete logs older than 30 days"
maintenance stateTrim agent-trace.jsonl / harness-usage.json"Trace is bloated", "Compress state"
maintenance allRun all 4 in sequence"Organize everything", "Full cleanup"

Add --dry-run to only list what would be done without executing. Free-form instructions (e.g. "delete old archives too", "keep only this session-log") are parsed in Step 1 and applied to processing parameters in Step 2 and beyond.

Execution Steps

  1. Parse user instructions: Extract subcommand + free-form details (exclusions, destination, day threshold)
  2. SSOT sync check: If .claude/state/.ssot-synced-this-session is absent, prompt to run /memory sync (required only when touching Plans.md)
  3. Open reference file: Read ${CLAUDE_SKILL_DIR}/references/cleanup.md and execute the relevant section
  4. Report Before/After: Display line counts and deletion counts when done

Subcommand Details

For execution steps, thresholds, and archive destinations per target, see cleanup.md.

Integration with auto-cleanup-hook

The PostToolUse hook (scripts/auto-cleanup-hook.sh / Go version auto_cleanup_hook.go) detects line count overruns in Plans.md, session-log.md, and CLAUDE.md and returns Recommend archiving old tasks with /maintenance as feedback. When you see this warning, run the relevant subcommand.

Notes

  • Do not move in-progress tasks: cc:WIP, pm:requested, cursor:requested are excluded from archiving
  • Archive destination directory is fixed: .claude/memory/archive/ — confirm with user before moving elsewhere
  • Backup: Before editing files over 200 lines, take a local backup with cp <file> <file>.bak.$(date +%s)
  • CLAUDE.md is warning-only: Do not auto-edit. Only propose a split

Related Skills

  • memory — SSOT promotion before organizing Plans.md (updates decisions.md / patterns.md)
  • harness-setup — Periodic maintenance after setup can also be invoked via harness-setup
  • session-init — Controls maintenance recommendation notifications at session start

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.