Claude Cleanup logo

Claude Cleanup

Community
suyuan2022
claude-cleanup

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

Overview

Publishersuyuan2022
Repositorysuyuan-skill
Skill nameclaude-cleanup
Stars
415
Forks
40
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by suyuan2022 on GitHub. Read the source before you install it.

Installation

Install the Claude Cleanup AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/suyuan2022/suyuan-skill/tree/main/claude-cleanup
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/suyuan2022/suyuan-skill.git /tmp/suyuan-skill
mkdir -p .claude/skills
cp -r /tmp/suyuan-skill/claude-cleanup .claude/skills/claude-cleanup
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Claude Cleanup in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Claude Cleanup on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Claude Cleanup is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 信誉、浏览器指纹或任何平台风控。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Claude Cleanup AI skill do?

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

Why use Claude Cleanup on TypingMind?

Because you install it once and use it with any model. Claude Cleanup is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Claude Cleanup in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/suyuan2022/suyuan-skill/tree/main/claude-cleanup. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Claude Cleanup?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Claude Cleanup?

As many as you like. As long as a model supports skills, you can use Claude Cleanup with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Claude Cleanup AI skill free?

Yes. It is published on GitHub by suyuan2022 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇