clean

A cleanup workflow for removing Claude Code's local history, temporary traces, and caches while preserving login details, settings, and installed plugins.

In plain words
What is it for?
Use it when you explicitly want to erase Claude Code history or local traces from a machine. It checks file counts and sizes, backs up `~/.claude.json`, removes approved data, and verifies preserved settings.
Why use it?
It helps remove stored conversations, prompts, snapshots, and other local records without forcing you to sign in or configure Claude Code again. It lists what will be removed and asks for approval before deletion.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tomoking2004/claude-plugins/clean
Any agent
npx skills add tomoking2004/claude-plugins --skill clean
Clone the repo
git clone --depth 1 https://github.com/tomoking2004/claude-plugins

Made for: Claude Code, Codex.

Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00154 $0.02567
Opus 5 $0.00077 $0.01283
Sonnet 5 $0.00031 $0.00513
Haiku 4.5 $0.00015 $0.00257

Measured 2d ago against content hash f1a1b10d52ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

clean scanned grade B with 1 finding 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 2d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `~/.claude/settings.json` — モデル・テーマ・`enabledPlugins`・`extraKnownMarketplaces` 等の設定.
plugins/ops/skills/clean/SKILL.md · 71 lines

How it starts

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

対象:このマシンに Claude Code が残す履歴・痕跡・キャッシュ——過去の会話・入力・編集前スナップショット・スクラッチ・利用統計など,消えても次回以降の起動と身元・設定・導入済みプラグインに影響しないもの.

対象外(絶対に消さない):身元と設定——履歴ではなく,消せば再ログインや再導入・再設定を強いるもの.何がそれに当たるかは下の「維持の対象」が列挙する.

手順

  1. 列挙する:下の「削除の対象」を実際に走査し,各項目の実在・ファイル数・容量を数える——存在しない項目は黙って飛ばす.同時に「維持の対象」も実在を確かめ,触れないものとして脇に置く.
  2. 明示して承認を得る:何を・どれだけ消し,何を残すかを表で示してから問う——削除は取り消せない(手順3のバックアップは ~/.claude.json のみを守る).ユーザーが範囲を指定していればそれに従い,承認なしに手順4へ進まない.
  3. ~/.claude.json を退避する:このファイルは身元・設定と履歴が同居する唯一のファイルで,手順5で一部キーだけを削る——編集前の全文を %TEMP%\claude-cleanup-backup\(POSIX では $TMPDIR/claude-cleanup-backup)へ複製してから触る.他の削除対象はバックアップしない(履歴そのものを消すのが目的).
  4. ファイル・ディレクトリを消す:「削除の対象」を下の「削除の正典」に従って消す——器の残し方も,生きているセッションの避け方もそこが定める.
  5. ~/.claude.json から履歴キーだけを削る:「削除の正典」の除去方式で,利用統計・キャッシュ系のキーだけを落とし,身元・設定キーは残す.
  6. 裏取りして報告する:削除後に,下の「維持の対象」が無傷であることを実際に読んで確かめ,解放した容量と残したものを簡潔に伝える.

削除の対象

~/.claude/ 配下(~ は Windows では %USERPROFILE%):

  • projects/ — 全会話のトランスクリプト(.jsonl・tool-results・subagents ログ).最大の痕跡
  • file-history/ — 編集前ファイルのスナップショット(Undo 用).
  • history.jsonl — 入力したプロンプトの履歴.
  • shell-snapshots/ — シェル環境のスナップショット.
  • session-env/ — セッション毎の環境ディレクトリ.
  • backups/~/.claude.json の自動バックアップ.
  • cache/ — changelog・issue 等のキャッシュ.
  • telemetry/ — 送信待ち/失敗したテレメトリイベント.
  • sessions/ide/ — セッション状態と IDE ロック.ただし生きているものは残す(正典参照).

~/ 直下と一時領域:

  • ~/.claude.json.tmp.* — 書き込み失敗の残骸.空のこともあるが,~/.claude.json全内容をそのまま含むことがあるoauthAccountprojects.* も)——本体からキーを削っても,これを残せば履歴は消えていない.
  • スクラッチ領域 %TEMP%\claude\(POSIX では $TMPDIR/claude) — レンダリング・ブラウザプロファイル等の作業ファイル.現在のセッションのディレクトリと bundled-skills は残す(正典参照).

~/.claude.json 内のキー(利用統計・キャッシュ・参照履歴):tipsHistorytipLifetimeShownCountsskillUsagepluginUsageannouncementImpressionsseenNotificationspromptQueueUseCountnumStartupslastPlanModeUseclosedIssuesLastCheckedchangelogLastFetchedcachedGrowthBookFeatures(+At)・cachedExperimentDatacachedExperimentFeaturesclientDataCacheSlots・各種 *CachepassesEligibilityCachegroveConfigCachefeedbackSurveyStategithubRepoPaths

Read the full file on GitHub · 71 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. 2d ago First seen · 71 lines · 154 tokens per session scan B f1a1b10d52ff

Subscribe to this mod's changes

clean is a skill published in the GitHub repository tomoking2004/claude-plugins (3 stars, last pushed 1mo ago), licensed MIT. It adds 154 tokens to every session and 2,567 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

skill-teilen

Reicht einen Skill, ein Plugin oder eine Vorlage (CLAUDE.md, settings.json, Prompt) in die SKAILE Community Skill-Library ein. Nutzen wenn der User sagt "teile meinen Skill", "teile meine CLAUDE.md", "teile meine Vorlage", "lade meinen Skill in die Community hoch", "reiche meinen Skill ein", "skill teilen" oder "in…

sebaskauf/skaile-community-library · 97 tokens

show-and-share

Schreibt einen fertigen Show-&-Share-Post für die SKAILE Community. Nutzen wenn der User sagt "schreib mir einen Show & Share Post", "stelle meinen Skill vor", "Post für meinen Skill/meine Vorlage", "schreib einen Post zu dem was ich gebaut habe", oder direkt nachdem ein Skill mit skill-teilen eingereicht wurde.

sebaskauf/skaile-community-library · 74 tokens

readme-pro

Schreibt oder verbessert ein README für das aktuelle Projekt. Nutzen wenn der User "schreib mir ein README", "dokumentier das Projekt" oder "readme-pro" sagt.

sebaskauf/skaile-community-library · 37 tokens

skill-guide

Design, write, and review SKILL.md files using proven patterns. Use when creating, improving, or reviewing agent skills, choosing a design pattern (Tool Wrapper, Generator, Reviewer, Inversion, Pipeline), structuring progressive disclosure, writing skill descriptions, or composing patterns. Also trigger for 'skill…

AndyElessar/skills · 102 tokens

microsoft-webui

Microsoft WebUI Framework expertise — a language-agnostic server-side rendering framework where templates compile to a binary protocol and interactive Web Components hydrate as islands. Use when authoring, reviewing, or debugging WebUI components (.html + .css + .ts triplets), wiring up routes, hydrating with…

AndyElessar/skills · 212 tokens

plugin-creator

Guide AI agents through creating GitHub Copilot CLI and Claude Code plugins and plugin marketplaces — from scaffolding plugin directories and writing plugin.json manifests to building marketplace.json registries and testing installations. Use this skill whenever the user wants to create, scaffold, configure, package…

AndyElessar/skills · 181 tokens