oac-cleanup

oac-cleanup is a command for Claude Code from darrenhinde/OpenAgentsControl. It costs 14 tokens per session (803 once invoked), scanned A, original, MIT.

A command that removes old temporary files from selected .tmp folders.

In plain words
What is it for?
Use it to clean old session files, completed task files, and cached external documentation, with optional age limits.
Why use it?
It frees disk space while showing the files it plans to delete and, by default, asking for confirmation.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the oac plugin — 12 skills, 6 commands, 7 agents, 1 hook shipped together

Good fit Use it to clean old session files, completed task files, and cached external documentation, with optional age limits.

Compare 6 commands from other repositories ↓
About the project

OpenAgents Control is a framework that adds plan-first, approval-based coding workflows to OpenCode, an AI coding framework. Developers and teams use it to make agents follow shared coding patterns, work across several programming languages, and validate changes through testing and review. The catalogue includes its agents, skills, commands, plugin, and hook.

darrenhinde/OpenAgentsControl · 4,992 stars · on GitHub

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add darrenhinde/OpenAgentsControl
Claude Code
/plugin install oac

Made for: Claude Code.

Or install oac, the plugin that ships this one along with the rest of its 12 skills, 6 commands, 7 agents, 1 hook.

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 oac-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/oac-cleanup/github.svg)](https://agentmods.dev/commands/darrenhinde/openagentscontrol/oac-cleanup)
Your own site
<a href="https://agentmods.dev/commands/darrenhinde/openagentscontrol/oac-cleanup"><img src="https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/oac-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for oac-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/commands/darrenhinde/openagentscontrol/oac-cleanup"><img src="https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/oac-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 803 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00014 $0.00803
Opus 5.5 $0.00006 $0.00321
Sonnet 5.5 $0.00003 $0.00161
Haiku 4.5 $0.00001 $0.00080

Measured 3mo ago against content hash 9a5e4f84023b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

oac-cleanup 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 3mo 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.

plugins/claude-code/commands/oac-cleanup.md · 126 lines

How it starts

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

Clean Up Temporary Files

Remove old temporary files from the .tmp directory to free up disk space.

What Gets Cleaned

The cleanup script checks three directories:

  1. .tmp/sessions/ - Session context files older than 7 days
  2. .tmp/tasks/ - Completed task files older than 30 days
  3. .tmp/external-context/ - Cached external documentation older than 7 days

Usage

Interactive Cleanup (Recommended)

!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh`

This will:

  1. Scan for old temporary files
  2. Show you what will be deleted with sizes
  3. Ask for confirmation before deleting

Force Cleanup (Skip Confirmation)

!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --force`

⚠️ Warning: This deletes files immediately without confirmation.

Custom Age Thresholds

# Clean sessions older than 14 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --session-days=14`

# Clean tasks older than 60 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --task-days=60`

# Clean external context older than 3 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --external-days=3`

# Combine options
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --session-days=14 --task-days=60 --force`

What Gets Preserved

The script is smart about what it deletes:

  • Active sessions - Never deleted (even if old)
  • In-progress tasks - Only completed tasks are eligible for cleanup
  • Recent files - Files newer than the threshold are kept

Configuration

You can customize default cleanup thresholds in your .oac config file:

cleanup:
  auto_prompt: true      # Prompt for cleanup on session start
  session_days: 7        # Days before suggesting session cleanup
  task_days: 30          # Days before suggesting task cleanup
  external_days: 7       # Days before suggesting external context cleanup

See /install-context for more about configuration.

Output

The script outputs JSON with cleanup results:

Read the full file on GitHub · 126 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. 3mo ago First seen · 126 lines · 14 tokens per session scan A 9a5e4f84023b

Subscribe to this mod's changes

oac-cleanup is a command published in the GitHub repository darrenhinde/OpenAgentsControl (4,992 stars, last pushed 5d ago), licensed MIT. It adds 14 tokens to every session and 803 once invoked, about $0.0001 per session on Opus 5.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

oac-cleanup compared with commands from other repositories

oac-cleanup next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
oac-cleanupdarrenhinde/OpenAgentsControlCommand5.0k5d agoMITA14Claude Code
feature-planVincentChuWaiChow/vanguard-frontier-agenticCommand26yesterdayApache-2.0A0Claude Code
recovery-targetVincentChuWaiChow/vanguard-frontier-agenticCommand26yesterdayApache-2.0A0Claude Code
device-infophinn/KinetAiosCommand173d agoGPL-3.0A22Claude Code
hw-troubleshootphinn/KinetAiosCommand173d agoGPL-3.0A34Claude Code
pdca-plankenjudy/pdca-agentic-coding-frameworkCommand4614d agononeA22Claude Code
convert-tablephinn/KinetAiosCommand173d agoGPL-3.0A16Claude Code