Agent skill

Claude Cleanup

by suyuan2022 in suyuan2022/suyuan-skill

在 macOS 上安全审计、完整备份、清理或重置 Claude Code 与 Claude Desktop 本机状态。适用于清理可再生缓存和日志、轮换本地 ID、重置桌面端登录态、移除应用、继承现有遥测状态、启用最小提示词模式或修改台北时区;不用于规避封禁或平台风控。

MITAuto-check: notes

Install Claude Cleanup

skills CLI
$ npx skills add suyuan2022/suyuan-skill --skill claude-cleanup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install suyuan2022/suyuan-skill claude-cleanup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/suyuan2022/suyuan-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude-cleanup .claude/skills/claude-cleanup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
claude-cleanup
GitHub stars
308
Token cost
~634 tokens
SKILL.md length
101 words
Files
4 (incl. scripts)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

在 macOS 上安全审计、完整备份、清理或重置 Claude Code 与 Claude Desktop 本机状态。适用于清理可再生缓存和日志、轮换本地 ID、重置桌面端登录态、移除应用、继承现有遥测状态、启用最小提示词模式或修改台北时区;不用于规避封禁或平台风控。

  • Works in 5 steps: 如果当前执行者就是 Claude Code,只运行只读审计并提醒用户切换到… → 如果由 Codex 或普通终端执行,先运行审计并向用户说明 → 用户明确要求继续后,在真实终端运行 → …
  • SKILL.md covers 运行顺序, 自动安全清理, 绝对保护范围 and 风险操作, plus 1 more section
  • Runs Python scripts from its folder; calls python3 and claude

What it does

Claude Cleanup is an agent skill from suyuan2022/suyuan-skill. 在 macOS 上安全审计、完整备份、清理或重置 Claude Code 与 Claude Desktop 本机状态。适用于清理可再生缓存和日志、轮换本地 ID、重置桌面端登录态、移除应用、继承现有遥测状态、启用最小提示词模式或修改台北时区;不用于规避封禁或平台风控。

Its SKILL.md is about 630 tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts (for example `scripts/claude_cleanup.py` and `tests/test_claude_cleanup.py`).

It works with macOS. The repository describes itself as: Claude Code Skills by Suyuan — AI-native productivity tools for real practitioners. The licence is MIT.

Example prompts

  • “/claude-cleanup”

Requirements

  • Python 3
  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 如果当前执行者就是 Claude Code,只运行只读审计并提醒用户切换到 Codex 或普通终端。不要让正在使用 ~/.claude 的 Claude Code 自己修改该目录。
  2. 如果由 Codex 或普通终端执行,先运行审计并向用户说明
  3. 用户明确要求继续后,在真实终端运行
  4. 脚本显示展开后的完整清单。用户输入一次 CONFIRM 后才开始写盘。若需要修改时区,开机密码只能由用户在 macOS 原生 sudo 隐藏提示中输入;不要让用户把密码发给执行者,也不要读取或保存。
  5. 结束后报告备份路径、废纸篓批次、实际选择、遥测继承结果和时区。任何中途停止都报告为部分完成,不能笼统声称清理成功。

What it can do on your machine

Read from SKILL.md and the folder at commit 423473d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Claude Cleanup loads about 634 tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 101 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~634

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:76
    时区**:仅在 macOS 当前不是 `Asia/Taipei` 时询问。使用 `sudo systemsetup` 修改并验证。

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from suyuan2022/suyuan-skill at commit 423473d, republished under its MIT licence (© suyuan2022). 101 words, ~634 tokens.

Download SKILL.mdSave it as .claude/skills/claude-cleanup/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
claude-cleanup
description
在 macOS 上安全审计、完整备份、清理或重置 Claude Code 与 Claude Desktop 本机状态。适用于清理可再生缓存和日志、轮换本地 ID、重置桌面端登录态、移除应用、继承现有遥测状态、启用最小提示词模式或修改台北时区;不用于规避封禁或平台风控。

Claude 本机清理

使用随附脚本执行,不要临时拼接 rm。脚本采用窄白名单、完整备份、一次最终知情确认和失败即停止。

运行顺序

  1. 如果当前执行者就是 Claude Code,只运行只读审计并提醒用户切换到 Codex 或普通终端。不要让正在使用 ~/.claude 的 Claude Code 自己修改该目录。

    bash
    python3 scripts/claude_cleanup.py --audit
  2. 如果由 Codex 或普通终端执行,先运行审计并向用户说明:

    • 第一个写操作是完整复制并校验 ~/.claude,同时备份 ~/.claude.json;
    • 可再生缓存和日志会自动纳入最终清单,不逐项询问;
    • 身份、钥匙串、桌面端登录态、应用、精简模式和时区属于风险操作,仍由用户选择;
    • 所有移除只进入时间戳废纸篓目录,不会永久删除或清空废纸篓;
    • 保护路径和遥测设置保持不变。
  3. 用户明确要求继续后,在真实终端运行:

    bash
    python3 scripts/claude_cleanup.py

    不要用管道代答,不要增加跳过确认参数。若只有自动安全清理且 Claude 正在运行,脚本直接跳过安全目标,不要求退出;若用户选择风险操作,再交由用户正常退出并复检。脚本不能自动结束进程。

  4. 脚本显示展开后的完整清单。用户输入一次 CONFIRM 后才开始写盘。若需要修改时区,开机密码只能由用户在 macOS 原生 sudo 隐藏提示中输入;不要让用户把密码发给执行者,也不要读取或保存。

  5. 结束后报告备份路径、废纸篓批次、实际选择、遥测继承结果和时区。任何中途停止都报告为部分完成,不能笼统声称清理成功。

自动安全清理

在 Claude Code 和 Claude Desktop 都已退出后,自动把下列现存目标纳入最终清单,无需逐项提问:

text
~/.claude/cache
~/.claude/stats-cache.json
~/.claude/telemetry
~/.claude/usage-data
~/.claude/usage.jsonl
~/.claude/usage.with-fix.jsonl
~/Library/Caches/claude-cli-nodejs
~/Library/Caches/com.anthropic.claudefordesktop*
~/Library/Logs/Claude
~/Library/Logs/DiagnosticReports/Claude*
~/Library/Application Support/CrashReporter/Claude*

这些目标必须仍通过脚本白名单检查,并且只移入废纸篓。

绝对保护范围

绝不删除或移动:

text
~/.claude/projects、sessions、history.jsonl、file-history、debug
~/.claude/skills、plugins、hooks、commands、scripts、agents、mcp-servers
~/.claude/backups、CLAUDE.md、settings.json、settings.local.json
任何项目目录、Git 仓库、Codex 会话,以及未明确列入白名单的路径

settings.json 只允许结构化修改被用户明确选择的键。保留其他 env、hooks、plugins、权限、模型、MCP、状态栏和秘密。目标与保护路径重叠时立即停止。

风险操作

  • 本地身份轮换:轮换 ~/.claude.json 的 userID、machineID,清除已知账号缓存字段,并把同一组新值同步到 ~/.claude/backups/.claude.json.backup.*。仅用于隐私和排障,不宣称能改变平台关联判断。
  • 钥匙串:删除 Claude Code-credentials 会退出 CLI 登录,单独选择。
  • Claude Desktop:可选择仅清持久数据与登录态,或连 /Applications/Claude.app 一并移入废纸篓。不能自动结束应用进程。
  • 最小提示词模式:在 settings.json 的 env 中设置或移除 CLAUDE_CODE_SIMPLE=1。启用后使用最小系统提示词和有限工具,并跳过 hooks、skills、plugins、MCP、自动记忆及 CLAUDE.md 自动发现;这些资产不会被删除。一次性脚本调用优先考虑 claude --bare。
  • 台北时区:仅在 macOS 当前不是 Asia/Taipei 时询问。使用 sudo systemsetup 修改并验证。

遥测继承

逐值保存以下键:

text
DISABLE_TELEMETRY
DISABLE_ERROR_REPORTING
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC

当前关闭就保持关闭;当前未关闭就不主动关闭。改变遥测状态不属于本 skill 的清理范围。

本 skill 不用于规避封禁、支付检查、设备或 IP 信誉、浏览器指纹或任何平台风控。

© suyuan2022, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in claude-cleanup of suyuan2022/suyuan-skill.

  • SKILL.md
  • .gitignore
  • scripts/claude_cleanup.py
  • tests/test_claude_cleanup.py

Open the folder on GitHubat commit 423473d

Compare with similar skills

Claude Cleanup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Claude Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Claude Cleanup this skillsuyuan2022/suyuan-skill308—~634Automated safety check: NotesMIT
Site ArchitectureAvdLee/RocketSimApp80611 repos~3.3kAutomated safety check: PassCustom licence
Engine Whats Newflutter/flutter180k—~978Automated safety check: PassBSD-3-Clause
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
Openclaw Live Updateropenclaw/openclaw392k—~3.7kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca89k1 repos~584Automated safety check: PassApache-2.0

Similar skills

  • Site Architecture

    AvdLee/RocketSimApp

    When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking.

    806 GitHub starsUsed in 11 repos~3.3k tokens
    Marketing & SEOAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    180k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    89k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed

More from suyuan2022/suyuan-skill

  • Claude Cleanup Audit

    suyuan2022/suyuan-skill

    Audit and safely modify local Claude Code and Claude Desktop cleanup/privacy settings on macOS.

    308 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Task Triage

    suyuan2022/suyuan-skill

    Task triage with position-based thinking. An agent skill from suyuan2022/suyuan-skill.

    308 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Codex Review

    suyuan2022/suyuan-skill

    Dual-model code review via Codex CLI. An agent skill from suyuan2022/suyuan-skill.

    308 GitHub stars~3.5k tokensUpdated 1 mo ago
    Auto-check: warnings
  • Break AI Slop

    suyuan2022/suyuan-skill

    Break AI Slop — force the AI to think like a real expert before doing anything.

    308 GitHub stars~981 tokensUpdated 1 mo ago
    Auto-check passed
  • Whatis

    suyuan2022/suyuan-skill

    What Is This — explain anything as a picture-first HTML page.

    308 GitHub stars~606 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Claude Cleanup

What does Claude Cleanup do?

在 macOS 上安全审计、完整备份、清理或重置 Claude Code 与 Claude Desktop 本机状态。适用于清理可再生缓存和日志、轮换本地 ID、重置桌面端登录态、移除应用、继承现有遥测状态、启用最小提示词模式或修改台北时区;不用于规避封禁或平台风控。. Claude Cleanup is an agent skill from suyuan2022/suyuan-skill.

How do I install Claude Cleanup in Claude Code?

Run `npx skills add suyuan2022/suyuan-skill --skill claude-cleanup -a claude-code`. Or copy the skill folder (claude-cleanup in suyuan2022/suyuan-skill) into .claude/skills/claude-cleanup in your project. Claude Code loads it when a task matches its description.

How do I install Claude Cleanup in Codex?

Run `npx skills add suyuan2022/suyuan-skill --skill claude-cleanup -a codex`. Or copy the skill folder (claude-cleanup in suyuan2022/suyuan-skill) into .agents/skills/claude-cleanup in your project. Codex loads it when a task matches its description.

Can I use Claude Cleanup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add suyuan2022/suyuan-skill --skill claude-cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/claude-cleanup, .gemini/skills/claude-cleanup, .github/skills/claude-cleanup and .opencode/skills/claude-cleanup in your project.

What does Claude Cleanup need to run?

Going by SKILL.md and its folder, Claude Cleanup needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and claude). Our summary lists: Python 3; Node.js.

Does Claude Cleanup access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Claude Cleanup safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Claude Cleanup use?

Claude Cleanup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Claude Cleanup use?

About 634 tokens (SKILL.md is roughly 2.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Claude Cleanup?

Skills that share tags, products or a category with Claude Cleanup: Site Architecture (AvdLee/RocketSimApp, 806 stars), Engine Whats New (flutter/flutter, 180k stars), macOS Spm App Packaging (Dimillian/Skills, 4k stars) and Openclaw Live Updater (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Claude Cleanup?

suyuan2022 (a GitHub user) maintains it in suyuan2022/suyuan-skill, which has 308 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 24, 2026.

Source: suyuan2022/suyuan-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.