maintenance

maintenance is a skill for Claude Code, Codex from Chachamaru127/claude-code-harness. It costs 57 tokens per session (1,220 once invoked), scanned A, original, MIT.

A file-cleanup and archiving routine for project plans, session logs, old logs, and agent state files. Archiving moves information out of active files so they stay manageable.

In plain words
What is it for?
Use it to archive completed plan items, split long session logs, remove old log files, trim state files, preview cleanup with a dry run, or perform all four tasks.
Why use it?
It reduces clutter and file growth while checking that important decisions have been copied to the project's main record before cleanup.

Skill for Claude CodeCodex

Part of the claude-code-harness plugin — 25 skills, 5 commands, 5 agents, 27 hooks shipped together

About the project

Claude Code Harness is a development workflow for coding agents that organizes work into planning, implementation, review, synchronization, and release stages. It helps developers keep specifications, tests, independent reviews, and release evidence connected while using tools such as Claude Code, Codex CLI, Cursor, or Grok.

Chachamaru127/claude-code-harness · 3,082 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/chachamaru127/claude-code-harness/maintenance
Any agent
npx skills add Chachamaru127/claude-code-harness --skill maintenance
Clone the repo
git clone --depth 1 https://github.com/Chachamaru127/claude-code-harness

Made for: Claude Code, Codex.

Or install claude-code-harness, the plugin that ships this one along with the rest of its 25 skills, 5 commands, 5 agents, 27 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for maintenance

README.md
[![agentmods](https://agentmods.dev/badge/skills/chachamaru127/claude-code-harness/maintenance.svg)](https://agentmods.dev/skills/chachamaru127/claude-code-harness/maintenance)
Your own site
<a href="https://agentmods.dev/skills/chachamaru127/claude-code-harness/maintenance"><img src="https://agentmods.dev/badge/skills/chachamaru127/claude-code-harness/maintenance.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.01220
Opus 5 $0.00028 $0.00610
Sonnet 5 $0.00011 $0.00244
Haiku 4.5 $0.00006 $0.00122

Measured 5d ago against content hash b0f7b12ed0dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

maintenance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

codex/.codex/skills/maintenance/SKILL.md · 68 lines

What it actually says

Maintenance

散らかったファイルを整頓する単一目的スキル。auto-cleanup-hook が警告を出した時、 または定期的な家事として呼び出す。

前提: 破壊的操作(アーカイブ移動・行削除)の前に Plans.md / session-log.md の 重要情報が SSOT (decisions.md / patterns.md) に昇格済みか確認する。 未同期なら /memory sync を先に走らせる。

Quick Reference

サブコマンド 対象 典型トリガー
maintenance plans Plans.md 完了タスクのアーカイブ移動 「Plans.md 整理」「古いタスクを移動」
maintenance session-log session-log.md の月別分割 「session-log 分割」「ログが長い」
maintenance logs .claude/logs/ の古いファイル削除 「ログ掃除」「30日以上前のログ消して」
maintenance state agent-trace.jsonl / harness-usage.json のトリム 「trace 肥大」「state 圧縮」
maintenance all 上記4つを順に実行 「全部整理」「総掃除」

--dry-run を付けると何をするかだけ列挙して実行しない。自由記述の指示(例: 「古いアーカイブも消して」「この session-log だけ残して」)は Step 1 で 受け付けて Step 2 以降の処理パラメータに反映する。

実行手順

  1. ユーザー指示のパース: サブコマンド + 自由記述(除外対象、保存先、日数閾値)を抽出
  2. SSOT 同期チェック: .claude/state/.ssot-synced-this-session が無ければ /memory sync を促す(Plans.md を触る場合のみ必須)
  3. 参照ファイルを開く: ${CLAUDE_SKILL_DIR}/references/cleanup.md を読み対応セクションを実行
  4. Before/After を報告: 行数と削除件数を表示して完了

サブコマンド詳細

対象ごとの実行手順・閾値・アーカイブ先は cleanup.md を参照。

auto-cleanup-hook との連携

PostToolUse hook (scripts/auto-cleanup-hook.sh / Go 版 auto_cleanup_hook.go) は Plans.md・session-log.md・CLAUDE.md の行数超過を検知すると /maintenance で古いタスクをアーカイブすることを推奨します と feedback を返す。 この警告を見たら該当サブコマンドを実行する。

注意事項

  • 進行中タスクは動かさない: cc:WIP, pm:依頼中, cursor:依頼中 はアーカイブ対象外
  • アーカイブ先ディレクトリは固定: .claude/memory/archive/ — 別の場所に移すときは ユーザーに確認する
  • バックアップ: 200 行超のファイルを編集する前に cp <file> <file>.bak.$(date +%s) で ローカルバックアップを取る
  • CLAUDE.md は警告のみ: 自動編集しない。分割提案だけ出す

関連スキル

  • memory — Plans.md 整理前の SSOT 昇格(decisions.md / patterns.md 更新)
  • harness-setup — セットアップ直後の定期メンテは harness-setup 経由でも呼べる
  • session-init — セッション開始時のメンテ推奨通知を制御
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 68 lines · 57 tokens per session scan A b0f7b12ed0dc

Subscribe to this mod's changes

maintenance is a skill published in the GitHub repository Chachamaru127/claude-code-harness (3,082 stars, last pushed 4d ago), licensed MIT. It adds 57 tokens to every session and 1,220 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens