SkillUtilitiesClaudeCodexVersion 1.0.0-r1

Context Cleanup

Clean up after your agent. Remove stale files, trim agent notes, free disk space, and more!

A broom sweeps a pile of old files and notes off a laptop screen, and leaves a tidy window and sparkles behind.

The Problem

Every coding session with your agent generates countless files including plans, handoff files, logs, drafts, temp folders, build data, etc. that are relevant for the duration of that session. Yet, after your session successfully ends in a shipped feature, these files stick around, taking up your disk space and polluting your future sessions with bloated and stale context that the new session agent can easily get just by reading your latest code.

The Solution

The context-cleanup skill solves this problem by running a full sweep on your project to identify and delete the unnecessary files after you git commit your feature. Here is how it works:

  • One command, and only when you type it. Type /context-cleanup in Claude Code or $context-cleanup in Codex. Neither agent starts the skill by itself.
  • It stops when the work is not done. If a file that git tracks has changes that are not committed, the agent stops at the first step and names the file. It deletes nothing.
  • A fresh subagent judges each leftover. A new subagent, the Sweeper, reads the project the way the next session will. It edits nothing. It gives each leftover one verdict: delete, ask, rewrite, or keep. The main agent checks each verdict before it acts.
  • Short notes that are true for the code. AGENTS.md, CLAUDE.md, and other notes that only agents read keep what the project is, how to set it up, build, run, test, and deploy it, its working rules, and the gotchas of outside tools. Decisions, their reasons, and history go. Docs for your users keep their content, and their stale lines are fixed.
  • Rules become checks. A written rule that a check could catch becomes a check, if you say yes. The agent adds it to a check that the project already runs, shows that the check catches a break, and removes the rule from the notes.
  • Free disk space. It finds session temp folders, transcripts, worktrees, Xcode build data for project folders that are gone, and simulators that the work made. With all, it looks at every project on your Mac.

It deletes without asking only what git can bring back, or what nothing can use again: tracked files, merged branches, clean worktrees, and build data whose project folder is gone. The note rewrites and these deletions go in one commit, so git revert brings them back. It never pushes. For everything else, it asks you once, with each item and its size. It never touches a running session, a booted simulator, or a secret.

Try it: in a git repository, change one line of a tracked file and do not commit it. Type /context-cleanup. The agent stops and names the file.

FAQs

Does it delete things without asking?

Only what git can bring back, or what nothing can use again. Those deletions and the note rewrites go in one commit, so git revert brings them back. Before it deletes anything else, it lists each item with its size and asks you once.

What happens after you buy

  1. 1

    Download

    Click on the download link to get the zip. Open the downloaded folder and share it with your agent.

  2. 2

    Install with Claude or Codex

    Your agent will help you install the skill via instructions in INSTALL.md.

  3. 3

    Make it yours

    After committing your session work, type /context-cleanup in Claude or $context-cleanup in Codex. Ask your agent to adjust the skill to your needs at any time.

It is a starter tool

Context Cleanup is a starter tool. You change it to fit your work.

  • You can use, copy and change it, for yourself and for your work, in any number of projects.
  • The license is for one person: you. Each person on your team buys their own copy.
  • A version that you changed in a significant way is yours. You can share or sell it. Give it its own name. Do not say that NatashaTheRobot made it or supports it.
  • You must not share, publish or sell the tool as it is, or with small changes only. A new name and new colors are small changes.

The full terms are in the LICENSE file in the zip. The tool comes with no warranty.

Let your agent check if Context Cleanup is right for you.

Just copy this prompt:

Read https://tools.natashatherobot.com/context-cleanup.md, the page of the Context Cleanup tool. Based on what you know about my projects and workflow, tell me if Context Cleanup would be useful to me. Say what it would do for me, what it needs that I may not have, and how much time or money it could save me relative to its price. If it does not fit, say so and why. Ask me if you need more context.