clean-traces

clean-traces is a skill for Claude Code from tomoking2004/claude-plugins. It costs 163 tokens per session (2,919 once invoked), scanned B, original, MIT.

A guided cleanup workflow for removing Claude Code's local history, temporary files, and caches while keeping login details, settings, installed plugins, and automatic memory.

In plain words
What is it for?
Use it when you explicitly want to remove Claude Code conversation history, edit snapshots, shell records, or other local traces.
Why use it?
It separates disposable records from files needed to keep Claude Code configured, and requires approval before deleting anything.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Part of the ops plugin — 3 skills shipped together

Good fit Use it when you explicitly want to remove Claude Code conversation history, edit snapshots, shell records, or other local traces.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tomoking2004/claude-plugins/clean-traces
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.

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

Made for: Claude Code.

Or install ops, the plugin that ships this one along with the rest of its 3 skills.

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 clean-traces

README.md
[![agentmods](https://agentmods.dev/badge/skills/tomoking2004/claude-plugins/clean-traces/github.svg)](https://agentmods.dev/skills/tomoking2004/claude-plugins/clean-traces)
Your own site
<a href="https://agentmods.dev/skills/tomoking2004/claude-plugins/clean-traces"><img src="https://agentmods.dev/badge/skills/tomoking2004/claude-plugins/clean-traces/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 clean-traces

Your own site · 80×15
<a href="https://agentmods.dev/skills/tomoking2004/claude-plugins/clean-traces"><img src="https://agentmods.dev/badge/skills/tomoking2004/claude-plugins/clean-traces.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 163 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,919 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00163 $0.02919
Opus 5.5 $0.00065 $0.01168
Sonnet 5.5 $0.00033 $0.00584
Haiku 4.5 $0.00016 $0.00292

Measured 11d ago against content hash bff76cc7dc1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

clean-traces 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 11d 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-traces/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 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. 裏取りして報告する:削除後に,下の「維持の対象」が無傷であることを実際に読んで確かめ,手順3で退避した複製を消す(本体の全内容を持つので,残せば履歴を消したことにならない).解放した容量と残したものを簡潔に伝える.

削除の対象

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

  • projects/ — 全会話のトランスクリプト(.jsonl・tool-results・subagents ログ).ただし各プロジェクトの memory/ は残す(維持の対象).
  • file-history/ — 編集前ファイルのスナップショット(Undo 用).
  • history.jsonl — 入力したプロンプトの履歴.
  • shell-snapshots/ — シェル環境のスナップショット.
  • session-env/ — セッション毎の環境ディレクトリ.
  • backups/ — ~/.claude.json の自動バックアップ.
  • cache/ — changelog・issue 等のキャッシュ.
  • telemetry/ — 送信待ち/失敗したテレメトリイベント.
  • ide/ — IDE のロック.ただし生きているものは残す(正典参照).
  • paste-cache/ — 大きな貼り付けの中身.
  • uploads/ — Remote Control の添付.
  • plans/ — プランモードの計画ファイル.
  • debug/ — セッション毎のデバッグログ.
  • stats-cache.json・usage-data/ — /usage の集計と /insights の分析.
  • image-cache/・todos/・statsig/・logs/ — 旧版の残り.

~/ 直下と一時領域:

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

Read the full file on GitHub · 78 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. 11d ago First seen · 78 lines · 163 tokens per session scan B bff76cc7dc1a

Subscribe to this mod's changes

clean-traces is a skill published in the GitHub repository tomoking2004/claude-plugins (3 stars, last pushed 2d ago), licensed MIT. It adds 163 tokens to every session and 2,919 once invoked, about $0.0007 per session on Opus 5.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-11-21.

Related

clean-traces compared with skills from other repositories

clean-traces next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
clean-tracestomoking2004/claude-pluginsSkill32d agoMITB163Claude Code
notion-artifact-captureAtlasOmnia/hermes-custom-packSkill8816d agoMITA82Claude Code, Codex
hold-my-handmelodic-software/claude-code-pluginsSkill34todayMITA95Claude Code
prerequisitesmelodic-software/claude-code-pluginsSkill34todayMITA47Claude Code
ad-nachbausebaskauf/skaile-community-librarySkill96d agoMITA125Claude Code
ad-schnittsebaskauf/skaile-community-librarySkill96d agoMITA104Claude Code
ad-analysesebaskauf/skaile-community-librarySkill96d agoMITA100Claude Code