clean-temp
/clean-temp
Finds temp files Claude left in the repo while working (dry-run folders, .bak/.tmp files, root temp scripts, captures) and other sessions' scratchpads, then moves the ones the user picks to the OS trash. Only when the user invokes it.
- Author
- JQ-WCoding ↗
- Repository
- devkit ↗
- Licence
- MIT
- Last repository change
- 13.11.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/clean_temp.py
What it does and when to use it
Finds temp files Claude left in the repo while working (dry-run folders, .bak/.tmp files, root temp scripts, captures) and other sessions' scratchpads, then moves the ones the user picks to the OS trash. Only when the user invokes it.
Arguments
/clean-temp [all | paths...]
Original author description
Finds temp files Claude left in the repo while working (dry-run folders, .bak/.tmp files, root temp scripts, captures) and other sessions' scratchpads, then moves the ones the user picks to the OS trash. Only when the user invokes it.
How it works
- 1. Scan
- 2. Confirm
- 3. Clean up and report
- Out of scope
SKILL.md preview
---
name: clean-temp
description: Finds temp files Claude left in the repo while working (dry-run folders, .bak/.tmp files, root temp scripts, captures) and other sessions' scratchpads, then moves the ones the user picks to the OS trash. Only when the user invokes it.
disable-model-invocation: true
argument-hint: "[all | paths...]"
---
# Temp file cleanup
Never delete work in progress; this comes first. "Untracked or ignored by Git" does not mean "temporary". Handle only what the script classifies, and remove only with its `trash` command after user confirmation. Never use `rm` or another permanent delete.
`<script>` is `${CLAUDE_PLUGIN_ROOT}/skills/clean-temp/scripts/clean_temp.py`. Write it out as an absolute path in commands; the shell may not have `CLAUDE_PLUGIN_ROOT` set.
## 1. Scan
The scan only lists. Pass this session's scratchpad path when there is one; it is never listed.
```bash
python3 -I <script> scan <repo root> [--scratchpad <this session's scratchpad path>]
```
| Class | Contents | Handling |
|---|---|---|
| Removal candidates | `_dryrun*`, `_tmp*`, `tmp`, `tmp_*`, `tmp1`, `scratch*`, `test-results` and similar folders at the root or under `docs/` (not `templates/` or `temperature/`); `*.bak`, `*.orig`, `*.tmp`, `*~`, `*.swp`, `*.rej` anywhere. Untracked only, not ignored: images at the root or directly in `docs/`, scripts and notes at the root. A temp folder holding protected files is split into its other files | Clean up after confirmation |
| Needs review | Other untracked files | Show the list only; clean up only what the user names |
| Protected | Tracked files; any path through `src`, `test(s)`, `node_modules`, `build`, `out`, `dist`, `target`, `logs`, `.venv`, `.worktrees`, `.devkit`, `.claude` and other tool folders; `CLAUDE.md`, `AGENTS.md`, `.env*`, `.mcp.json`; the repo's `protect` globs | Not listed and never touched |
| Other sessions' scratchpads | Sibling folders of this session's scratchpad, with size and last change | Only when the user wants; a recent last change may be a live session (e.g. a parallel-work worker) |
**Repo-specific protections** live in `<repo>/.devkit/clean-temp/config.json` (local, like `.devkit/peer-review/`):
```json
{"protect": ["database/", "docs/design/[!_]*", "docs/rules/"]}
```
Globs match repo-relative paths; `*` also matches `/`; a trailing `/` means everything under it. If there is no config and the repo rules or `CLAUDE.md` name local work folders to keep (specs, mockups, work SQL), propose `protect` entries for them and write the file after approval, then scan again.
## 2. Confirm
Show the removal candidates and the needs-review list with path, size and reason, and ask which to clean up. Propose all removal candidates by default. If an item's contents are unclear, open it first to check whether it is an output of this work. If the user already set a scope (`all`, or named paths), use exactly that scope.
## 3. Clean up and report
```bash
python3 -I <script> trash <repo root> [--scratchpad <this session's scratchpad path>] <selected paths...>
git status --porcelain
```
- The script checks every path first and moves nothing if any is tracked, protected, holds a protected path, is this session's scratchpad, or is outside the repo and scratch root. A symlink is moved as the link, never its target. Report refusals as they are; don't work around them.
- If no trash tool exists (Linux without `gio` or `trash-cli`), report the next action it gives. Don't fall back to deleting.
- Use `git status` to confirm tracked files and in-progress changes are intact. Report the cleaned paths and sizes and the needs-review items left in place, and mention the files can be restored from the trash. If needs-review items remain, don't call the tree "clean".
## Out of scope
- Build output and dependencies, logs, DB objects, containers and backups.
- Other repositories and general files in the system temp folder.
- Hooks or automatic runs at the end of a task.
Files in this package (3)
- SKILL.md 4 KB
- evals/evals.json 1 KB
- scripts/clean_temp.py 14 KB
Versions
The database has no other skills named clean-temp.
Database snapshot: 13.11.2026 · package version 385a316c8ddd (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100temp-files
Guidelines for creating temporary files in system temp directory. Use when agents need to create reports, logs, or progress files without cluttering the repository. - 90tidying
Finds junk files (backups, temp, stray notes) and removes them reversibly after your ok. Use when the user asks to clean up the project, remove leftovers, or says the repo is messy. Not for refactoring code. - 87vibeic-temp
Inspect and clean Vibe-IC leftovers from crashed executions, showing size, date and name. Use for leftover temp cleanup, including an explicit request to remove all leftovers older than a day. - 100task-planning
Use when the user plans a week, asks for this week's tasks, hands over new tasks or ideas to record, or finishes a week. Creates and maintains the local .temp/ task files (backlog, one file per week, archive). - 95temp-mail-pro
临时邮箱(Temp Mail)收件与一次性邮箱管理 skill,通过 MaxHub API 创建/查询临时邮箱、读取邮件列表与邮件详情。仅限自动化测试、合法验证码接收和隐私保护场景使用。严禁用于规避平台身份验证、批量注册诈骗、发送垃圾邮件或任何违反《网络安全法》第24条(真实身份信息认证要求)的场景。所有请求发送到 https://www.aconfig.cn。 - 100clean-disk-space
Safe disk space analysis and cleanup workflow for local machines. Use when asked to analyze full disks, identify large cache/log/temp/build artifacts, produce a cleanup report, run or simulate dry-runs, wait for user approval, and then clean only confirmed redundant files…