tidy-scratch

tidy-scratch is a skill for Claude Code, Codex from shck-dev/ccx-context-system. It costs 48 tokens per session (1,149 once invoked), scanned C, original, MIT.

A cleanup workflow for a scratch notebook containing old or completed work notes. It scans folders and open pull requests, then proposes what to keep, archive, or remove.

In plain words
What is it for?
Use it to review scratch folders, identify finished threads, and prepare a cleanup plan. It starts as a dry run and waits for confirmation before destructive cleanup.
Why use it?
It helps reduce stale notes while considering recent activity and whether related work is still open.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the ccx plugin — 3 skills, 3 hooks shipped together

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/shck-dev/ccx-context-system/tidy-scratch
Any agent
npx skills add shck-dev/ccx-context-system --skill tidy-scratch
Clone the repo
git clone --depth 1 https://github.com/shck-dev/ccx-context-system

Made for: Claude Code, Codex.

Or install ccx, the plugin that ships this one along with the rest of its 3 skills, 3 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 tidy-scratch

README.md
[![agentmods](https://agentmods.dev/badge/skills/shck-dev/ccx-context-system/tidy-scratch.svg)](https://agentmods.dev/skills/shck-dev/ccx-context-system/tidy-scratch)
Your own site
<a href="https://agentmods.dev/skills/shck-dev/ccx-context-system/tidy-scratch"><img src="https://agentmods.dev/badge/skills/shck-dev/ccx-context-system/tidy-scratch.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,149 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00048 $0.01149
Opus 5 $0.00024 $0.00575
Sonnet 5 $0.00010 $0.00230
Haiku 4.5 $0.00005 $0.00115

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

Security

Grade C, and why

tidy-scratch scanned grade C with 1 finding 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 4d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **delete:** `rm -rf <scratch_root>/<slug>` — permanent if the notebook isn't version-controlled.
plugins/ccx/skills/tidy-scratch/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tidy scratch — date-aware GC for the scratch notebook

A read → propose → execute sweep. This is the only ccx skill that proposes destructive actions; save-state stays a pure read-only dashboard. The sweep is dry-run by default — it prints a plan and touches nothing until you confirm. If the scratch dir is not version-controlled (the usual setup), a delete is permanent. When in doubt: archive (move), don't delete.

Live data (injected at load)

Project + config: !bun "${CLAUDE_PLUGIN_ROOT}/scripts/where.ts"

Now: !date "+%Y-%m-%d %H:%M %Z"

Folder scan — date-aware, stalest first (newest-file age per folder; STATE=NO = no handoff doc): !bun "${CLAUDE_PLUGIN_ROOT}/scripts/scan.ts"

Open PRs (a matching open PR keeps a thread alive): !gh pr list --limit 30 2>/dev/null || echo "(gh unavailable / not a GitHub repo)"

Then do this

  1. Classify every folder from the scan. With ticket_system: none there is no external "closed" oracle — only age + PR signals exist, so stay patient and conservative. age = the scan's age_days; thresholds are defaults you may adjust per item when presenting the plan:
    • KEEP (active)age < 3 (protects an active spike), OR an open PR that matches the thread's topic/branch.
    • ARCHIVE (likely done) — has a STATE doc AND age > 30 AND no open PR. (Longer threshold than a ticket-oracle setup would use: age alone must be more patient.)
    • ADOPT (unfiled work)STATE = NO AND files > 3 — too much accumulated work to be throwaway; propose creating a STATE doc for it (offer /ccx:start-thread), never delete in this pass.
    • DELETE (throwaway)STATE = NO AND age > 14 AND files ≤ 3 (no handoff value + cold + tiny).
    • DELETE (empty)files = 0.
    • FLAG → default KEEP (unsure) — anything that fits no rule above, and every kind: hub reference note. Never auto-propose deleting a folder that has a STATE doc.
  2. Print the PLAN — execute NOTHING yet. One table, stalest first:

Read the full file on GitHub · 74 lines

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. 4d ago First seen · 74 lines · 48 tokens per session scan C 77eb072c5008

Subscribe to this mod's changes

tidy-scratch is a skill published in the GitHub repository shck-dev/ccx-context-system (1 stars, last pushed 1mo ago), licensed MIT. It adds 48 tokens to every session and 1,149 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

claude-code-bash-patterns

Claude Code Bash tool patterns with hooks, automation, git workflows. Use for PreToolUse hooks, command chaining, CLI orchestration, custom commands, or encountering bash permissions, command failures, security guards, hook configurations.

secondsky/claude-skills · 52 tokens

promote

Turn a scratch script into a permanent tool this repo keeps. Use when a check, report, or analysis has proved worth running more than once.

ArcticFox2029/chamnan · 29 tokens

high-output-management

Manage for output using Grove's "High Output Management": a manager's output is their organization's output, raised by high-leverage activities. Use when the user mentions "high output management", "managerial leverage", "one-on-ones", "1:1 agenda", "OKRs", "performance review", "task-relevant maturity", "delegation"…

wondelai/skills · 176 tokens

37signals-way

Build lean, opinionated products using the 37signals philosophy from "Getting Real", "Rework", and "Shape Up". Use when the user mentions "Getting Real", "Rework", "Shape Up", "37signals", "Basecamp method", "six-week cycles", "fixed time variable scope", "appetite vs estimates", "betting table", "breadboarding", "fat…

wondelai/skills · 177 tokens

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

aceternity-ui

100+ animated React components (Aceternity UI) for Next.js with Tailwind. Use for hero sections, parallax, 3D effects, or encountering animation, shadcn CLI integration errors.

secondsky/claude-skills · 48 tokens