sasurahime provides 45 clean targets organized by sprint.
Every target supports both detect (read-only, no side effects) and
clean (removal). All clean subcommands accept --dry-run.
sasurahime clean uvCategory: Sprint 1
What it removes: Stale simple-vN index directories inside
~/.cache/uv/ and runs uv cache prune --force.
How detect works:
~/.cache/uv/.simple-v<N> (e.g. simple-v16, simple-v21)
using UvCleaner::parse_simple_version. Symlinks are skipped.How clean works:
uv cache prune --force (removes orphaned/unpacked archives).simple-vN directory whose version is not the highest,
using fs::remove_dir_all.--dry-run is set: lists what would be removed, does not delete.Safety: Only the lowest version numbers are removed; the highest
simple-v<N> (most recent) is always kept.
sasurahime clean brewCategory: Sprint 1
What it removes: Homebrew download cache. Delegates to
brew cleanup -s --prune=all.
How detect works:
~/Library/Caches/Homebrew exists.dir_size of the cache directory as pruneable.How clean works:
brew is not in PATH, prints a message and exits (0).brew cleanup -s --prune=all."freed approximately <N>GB of disk space") using
BrewCleaner::parse_brew_freed_bytes, which in turn uses
BrewCleaner::parse_size_str (supports GB, MB, KB — case-insensitive
and space-separated variants).Safety: The Homebrew CLI itself handles safety (scoped to its own cache).
sasurahime clean miseCategory: Sprint 2
What it removes: Unused runtime versions installed by
mise under
~/.local/share/mise/installs/<tool>/<version>.
How detect works:
mise ls --current to get the set of currently active
(tool, version) pairs. Parses each tab/space-separated line via
MiseCleaner::parse_active_versions.~/.config/mise/config.toml and every .mise.toml under HOME
(max depth 5) via MiseCleaner::scan_pinned_versions to collect
pinned (tool, version) pairs.~/.local/share/mise/installs/.How clean works:
(tool, version, path) triple:
[dry-run] would remove: <tool> <version>.MiseCleaner::remove_with_uchg which:
chflags -R nouchg <path> to clear macOS immutable flags.fs::remove_dir_all.chflags fails, the error is propagated (not silently ignored).Safety (per CLAUDE.md §Safety rules):
~/.config/mise/config.toml and any .mise.toml
found within HOME (max depth 5) before removing any version.chflags -R nouchg.sasurahime clean browsersCategory: Sprint 2
What it removes: Old browser engine builds used by Puppeteer and Playwright. Keeps only the highest version per browser family.
Scanned locations:
| Label | Path |
|---|---|
| puppeteer/chrome | ~/.cache/puppeteer/chrome |
| puppeteer/chrome-headless-shell | ~/.cache/puppeteer/chrome-headless-shell |
| ms-playwright | ~/Library/Caches/ms-playwright |
| ms-playwright-go | ~/Library/Caches/ms-playwright-go |
Version comparison:
BrowserCleaner::version_key converts directory names to Vec<u32> by
extracting all runs of ASCII digits.mac_arm-131.0.6778.204 → [131, 0, 6778, 204],
chromium-1208 → [1208].Vec<u32>::cmp),
which correctly handles both semver-style and flat build-number formats.How detect works:
BrowserCleaner::find_old_versions(parent).find_old_versions reads the directory, skips symlinks and unparseable
directory names (those yielding empty version keys), finds the highest
version key, and returns paths of all entries except the highest.How clean works:
find_old_versions.--dry-run: prints what would be removed.fs::remove_dir_all on each old version path.Safety:
nightly) are skipped.sasurahime clean bunCategory: Sprint 3 — Generic caches
What it removes: Bun package cache.
Method: bun pm cache rm
How detect works:
Checks if bun is in PATH. Reports as pruneable if found (unknown size).
How clean works:
bun not found, prints message and exits (0).bun pm cache rm.Safety: Delegates to the official bun CLI.
sasurahime clean goCategory: Sprint 3 — Generic caches
What it removes: Go build cache.
Method: go clean -cache
How detect works:
Checks if go is in PATH. Reports as pruneable if found (unknown size).
How clean works:
go not found, prints message and exits (0).go clean -cache.Safety: Delegates to the official go CLI.
sasurahime clean pipCategory: Sprint 3 — Generic caches
What it removes: pip package cache.
Method: pip cache purge
How detect works:
Checks if pip is in PATH. Reports as pruneable if found (unknown size).
How clean works:
pip not found, prints message and exits (0).pip cache purge.Safety: Delegates to the official pip CLI.
sasurahime clean node-gypCategory: Sprint 3 — Generic caches
What it removes: node-gyp build cache directories.
Scanned locations:
~/.cache/node-gyp/~/Library/Caches/node-gyp/How detect works:
dir_size.How clean works:
chflags -R nouchg <path> (clears macOS immutable
flags, error is silently ignored to avoid breaking on non-APFS filesystems).fs::remove_dir_all on each existing directory.Safety: macOS uchg flag is handled automatically (GAP-010).
sasurahime clean npmCategory: Sprint 3 — Generic caches
What it removes: npm package cache.
Method: npm cache clean --force
How detect works:
Checks if npm is in PATH. Reports as pruneable if found (unknown size).
How clean works:
npm not found, prints message and exits (0).npm cache clean --force.Safety: Delegates to the official npm CLI.
sasurahime clean yarnCategory: Sprint 3 — Generic caches
What it removes: Yarn package cache.
Method: yarn cache clean
How detect works:
Checks if yarn is in PATH. Reports as pruneable if found (unknown size).
How clean works:
yarn not found, prints message and exits (0).yarn cache clean.Safety: Delegates to the official yarn CLI.
sasurahime clean pnpmCategory: Sprint 3 — Generic caches
What it removes: pnpm store.
Method: pnpm store prune
How detect works:
Checks if pnpm is in PATH. Reports as pruneable if found (unknown size).
How clean works:
pnpm not found, prints message and exits (0).pnpm store prune.Safety: Delegates to the official pnpm CLI.
sasurahime clean cachesCategory: Sprint 3 — Generic caches (aggregate)
What it removes: All generic caches in a single command.
Equivalent to running each of bun, go, pip, node-gyp, npm, yarn,
and pnpm sequentially.
Each sub-cleaner is invoked independently. If a tool is not installed, it is skipped with a message (exit code is still 0).
sasurahime clean logsCategory: Sprint 3
What it removes: Log files older than N days from known and
user-configured log directories.
Built-in log targets (scanned automatically):
| Name | Path | Files excluded from deletion |
|---|---|---|
| kilo | ~/.local/share/kilo/log |
dev.log |
| opencode | ~/.local/share/opencode/logs |
(none) |
| claude-code | ~/.local/share/claude/logs |
(none) |
| vscode-logs | ~/Library/Application Support/Code/logs |
(none) |
Extra log targets can be added via the config file (see HOWTO-USE.md
for config.toml syntax). Each extra target has its own path and optional
exclusion list.
How detect works:
LogCleaner::find_old_logs(dir, keep_days, exclude).find_old_logs reads the directory, filters to plain files only (no
subdirectories), excludes files whose names match the exclusion list, then
checks LogCleaner::is_older_than against each file’s metadata mtime.keep_days.How clean works:
find_old_logs logic as detect.--dry-run: prints [dry-run] [<name>] would remove: <path> for each
old file.fs::remove_file on each old file.Removed <N> log files.Retention policy:
keep_days = 7 (files older than 7 days are deleted).--keep-days <N> flag.[logs]\nkeep_days = <N>.Safety:
kilo target excludes dev.log by default.is_older_than uses strict > comparison (a file exactly N days old is
not deleted).sasurahime clean xcodeCategory: Sprint 3
What it removes: Project build artifact directories inside
Xcode’s DerivedData folder (~/Library/Developer/Xcode/DerivedData/).
How detect works:
DerivedData directory exists.dir_size as pruneable.How clean works:
DerivedData does not exist, prints message and exits (0).pgrep -x Xcode):
--yes mode: is_xcode_running always returns false (test
environments have no Xcode process), so the prompt is never shown.DerivedData (each is a project build).--dry-run: prints what would be removed per-project.fs::remove_dir_all on each project directory.
The DerivedData root itself is never deleted.Safety:
DerivedData root directory is never removed.read_dir — only
subdirectories are considered (files at the root are skipped).sasurahime clean actCategory: Sprint 5
What it removes: act GitHub Actions
local runner cache (~/.cache/act/, or $ACT_CACHE_DIR if set).
Method: Directory deletion.
How detect works:
$ACT_CACHE_DIR env var or
~/.cache/act/ as fallback).dir_size as pruneable.How clean works:
is_safe_delete_target to verify the path is not a system directory.$ACT_CACHE_DIR points to an unsafe path, falls back to the default.fs::remove_dir_all.Safety: $ACT_CACHE_DIR is validated against a blocklist of system paths
(/, /etc, /var, /usr, etc.). Unsafe env var values are rejected.
sasurahime clean cargoCategory: Sprint 5
What it removes: Cargo registry cache
(~/.cargo/registry/cache/) and target/ build artifact directories.
Scanned by detect:
~/.cargo/registry/cache/ — downloaded crate archives.~/src/, ~/work/, ~/dev/ with target/ dirs.How clean works:
~/.cargo/registry/cache/ contents.target/ directories under common project roots and removes them.chflags -R nouchg is run before deletion to handle macOS immutable flags.sasurahime clean cocoa-podsCategory: Sprint 5
What it removes: CocoaPods cache.
Method: pod cache clean --all
How detect works:
Checks if pod is in PATH. Reports as pruneable if found (unknown size).
How clean works:
pod not found, prints message and exits (0).pod cache clean --all.Safety: Delegates to the official CocoaPods CLI.
sasurahime clean condaCategory: Sprint 5
What it removes: Conda package cache.
Method: conda clean --all -y
How detect works:
Checks if conda is in PATH. Reports as pruneable if found (unknown size).
How clean works:
conda not found, prints message and exits (0).conda clean --all -y.Safety: Delegates to the official Conda CLI.
sasurahime clean denoCategory: Sprint 5
What it removes: Deno cache.
Method: deno cache -r (reload cache)
How detect works:
Checks if deno is in PATH. Reports as pruneable if found (unknown size).
How clean works:
deno not found, prints message and exits (0).deno cache -r.Safety: Delegates to the official Deno CLI.
sasurahime clean dockerCategory: Sprint 5
What it removes: Docker dangling images, containers, build cache, and networks.
Method: docker system prune -f
How detect works:
Checks if docker is in PATH. Reports as pruneable if found (unknown size).
How clean works:
docker not found, prints message and exits (0).docker system prune -f (dangling images only — tagged images are
preserved).Safety: Only dangling (untagged) images are removed. Explicitly avoids -a
flag to preserve tagged unused images.
sasurahime clean downloadsCategory: Sprint 5
What it removes: Old files inside ~/Downloads/.
How detect works:
~/Downloads exists.dir_size as pruneable.How clean works:
~/Downloads.chflags -R nouchg + remove_dir_all.~/Downloads/ (no recursion).sasurahime clean gradleCategory: Sprint 5
What it removes: Old version caches from
Gradle (~/.gradle/caches/). Keeps only the most
recent version of each cached artifact.
How detect works:
~/.gradle/caches/ for per-version directories.How clean works:
chflags -R nouchg + remove_dir_all.Safety: The most recent version of each cached artifact is always kept.
sasurahime clean huggingfaceCategory: Sprint 5
What it removes: Hugging Face model cache
(~/.cache/huggingface/hub/ or $HF_HOME/hub).
How detect works:
hub/ directory exists ($HF_HOME/hub or ~/.cache/huggingface/hub).dir_size as pruneable.How clean works:
huggingface-cli delete-cache --yes.huggingface-cli is not in PATH, falls back to deleting hub/ contents
directly (recreates the hub/ directory after deletion).$HF_HOME is validated against is_safe_delete_target — unsafe paths cause
a fallback to the default.Safety: $HF_HOME is validated against a blocklist of system paths.
CLI takes precedence over direct deletion.
sasurahime clean jetbrainsCategory: Sprint 5
What it removes: Old version caches from
JetBrains IDEs (IntelliJ IDEA, WebStorm, etc.)
under ~/Library/Caches/JetBrains/.
Method: Similar to Gradle cache version pruning — keeps the most recent version of each IDE cache.
How detect works:
~/Library/Caches/JetBrains/ for per-IDE per-version directories.How clean works:
chflags -R nouchg + remove_dir_all.Safety: The most recent version of each IDE cache is always kept.
sasurahime clean library-logsCategory: Sprint 5
What it removes: User log files under ~/Library/Logs/. Uses heuristic
rules to suggest which entries to delete. Interactive — opens a selection
prompt unless --all is used.
How detect works:
~/Library/Logs/.dir_size and reads last_modified time.[large][stale N days]CrashReporter, DiagnosticReports, and dot-entries.How clean works:
--dry-run: prints each entry with its reason tags.--all: deletes all suggested entries without prompting.dialoguer::MultiSelect with all entries pre-selected.
User confirms selection, then selected entries are deleted with
chflags -R nouchg + remove_dir_all.Safety:
CrashReporter and DiagnosticReports are always excluded..DS_Store, .localized, etc.) are skipped.SystemTime::now().--dry-run guarantees zero side effects.sasurahime clean orbstackCategory: Sprint 5
What it removes: Orbstack Docker runtime cache.
Method: orb prune
How detect works:
Checks if orb is in PATH. Reports as pruneable if found (unknown size).
How clean works:
orb not found, prints message and exits (0).orb prune.Safety: Delegates to the official Orbstack CLI.
sasurahime clean pipxCategory: Sprint 5
What it removes: pipx cache and unused packages.
Method: pipx cache purge
How detect works:
Checks if pipx is in PATH. Reports as pruneable if found (unknown size).
How clean works:
pipx not found, prints message and exits (0).pipx cache purge.Safety: Delegates to the official pipx CLI.
sasurahime clean poetryCategory: Sprint 5
What it removes: Poetry package cache.
Method: poetry cache clear --all
How detect works:
Checks if poetry is in PATH. Reports as pruneable if found (unknown size).
How clean works:
poetry not found, prints message and exits (0).poetry cache clear --all.Safety: Delegates to the official Poetry CLI.
sasurahime clean pre-commitCategory: Sprint 5
What it removes: pre-commit hook environment
cache (~/.cache/pre-commit/, $PRE_COMMIT_HOME, or $XDG_CACHE_HOME/pre-commit).
How detect works:
$PRE_COMMIT_HOME → $XDG_CACHE_HOME/pre-commit → ~/.cache/pre-commit.dir_size as pruneable.How clean works:
pre-commit clean.pre-commit not in PATH, deletes the cache directory directly.is_safe_delete_target — unsafe paths
cause a fallback to ~/.cache/pre-commit.Safety: Env var paths are validated. CLI takes precedence over direct deletion.
sasurahime clean rustupCategory: Sprint 5
What it removes: Unused Rust toolchain
versions (the toolchains not selected by rustup default or rustup override).
How detect works:
rustup toolchain list to enumerate installed toolchains.(default)) and any
override toolchains (marked with (override)).How clean works:
rustup toolchain remove <name>.Safety: The default and override toolchains are never removed. Only toolchains not selected by any profile are candidates for removal.
sasurahime clean spmCategory: Sprint 5
What it removes: Swift Package Manager build artifacts and cached packages.
Method: Deletes ~/Library/Caches/org.swift.swiftpm/ and
~/Library/Developer/Xcode/DerivedData/SourcePackages/.
How detect works:
dir_size as pruneable.How clean works:
chflags -R nouchg on cache directories.fs::remove_dir_all on each cache directory.sasurahime clean trashCategory: Sprint 5
What it removes: ~/.Trash — scan only. sasurahime reports the size
of the Trash directory but will not delete it (users should use Finder to
empty Trash).
How detect works:
~/.Trash exists.dir_size as pruneable.How clean works:
--dry-run: runs detect-style scan and prints the size that would
be freed.Safety: sasurahime refuses to delete ~/.Trash contents — this is an
intentional safety measure.
sasurahime clean voltaCategory: Sprint 5
What it removes: Volta Node.js version manager
cache (~/.volta/cache/).
Method: Directory deletion.
How detect works:
~/.volta/cache/ exists.dir_size as pruneable.How clean works:
~/.volta/cache/ directory via fs::remove_dir_all.Safety: Only the cache/ subdirectory is deleted; ~/.volta/ itself and
its toolchain binaries are preserved.
sasurahime clean sbtCategory: Sprint 5
What it removes: sbt build cache
(~/.sbt/) and Ivy dependency cache
(~/.ivy2/cache/).
Method: Directory deletion.
How detect works:
~/.sbt/ or ~/.ivy2/cache/ exist.dir_size of existing directories as pruneable.How clean works:
~/.sbt/ and ~/.ivy2/cache/ directories via fs::remove_dir_all.Safety: Directories are deleted entirely — dependencies will be re-fetched
on next sbt compile.
sasurahime clean tree-sitterCategory: Sprint 5
What it removes: tree-sitter parser
compilation cache (~/.cache/tree-sitter/).
Method: Directory deletion.
How detect works:
~/.cache/tree-sitter/ exists.dir_size as pruneable.How clean works:
~/.cache/tree-sitter/ directory via fs::remove_dir_all.Safety: Parsers will be recompiled on next editor use (Neovim, Helix, etc.).
sasurahime clean simulatorCategory: Sprint 5
What it removes: iOS Simulator cache — unavailable simulator runtimes
via xcrun simctl delete unavailable.
How detect works:
~/Library/Developer/CoreSimulator exists.dir_size as pruneable.How clean works:
xcrun is not in PATH, prints a message and exits (0).xcrun simctl delete unavailable.Safety: Delegates to the official xcrun CLI for safe simulator management.
sasurahime clean device-supportCategory: Sprint 5
What it removes: Old Xcode DeviceSupport directories under
~/Library/Developer/Xcode/* DeviceSupport/. Keeps the N most recent major
versions per platform (default: 2).
Scanned locations:
~/Library/Developer/Xcode/iOS DeviceSupport/~/Library/Developer/Xcode/watchOS DeviceSupport/* DeviceSupport/ directoryVersion comparison:
17.0,
18.0) are collected. The major version (first number before .) is used
for comparison.How detect works:
~/Library/Developer/Xcode/ for * DeviceSupport/ directories.How clean works:
--dry-run: prints what would be removed per directory.chflags -R nouchg then deletes via trash (or permanent).Safety:
DeviceSupport root directories are never deleted.sasurahime clean vscode-extensionsCategory: Sprint 5
What it removes: VS Code extensions cache (~/.vscode/extensions/).
Method: Directory deletion.
How detect works:
~/.vscode/extensions/ exists.dir_size as pruneable.How clean works:
~/.vscode/extensions/ via fs::remove_dir_all.Safety: Only the extensions cache is removed; VS Code configuration and settings are preserved.
sasurahime clean mavenCategory: Sprint 5
What it removes: Maven local repository cache
via mvn dependency:purge-local-repository.
How detect works:
~/.m2/repository exists.dir_size as pruneable.How clean works:
mvn is not in PATH, prints a message and exits (0).mvn dependency:purge-local-repository.Safety: Delegates to the official Maven CLI. Dependencies will be re-downloaded on next build.
sasurahime clean terraformCategory: Sprint 5
What it removes: Terraform provider plugin cache
(~/.terraform.d/plugin-cache/ or $TF_PLUGIN_CACHE_DIR).
Method: Directory deletion.
How detect works:
$TF_PLUGIN_CACHE_DIR if set,
otherwise ~/.terraform.d/plugin-cache/.dir_size as pruneable.How clean works:
fs::remove_dir_all.terraform init.Safety: $TF_PLUGIN_CACHE_DIR is validated against is_safe_delete_target.
Only the provider cache is removed; Terraform state files and configurations
are preserved.
sasurahime clean flutterCategory: Sprint 5
What it removes: Flutter/Dart pub cache
via dart pub cache clean.
How detect works:
$PUB_CACHE or
~/.pub-cache/).dir_size as pruneable.How clean works:
dart is not in PATH, prints a message and exits (0).dart pub cache clean.Safety: Delegates to the official Dart CLI. Published packages will be
re-downloaded on next dart pub get or flutter pub get.
sasurahime clean colimaCategory: Sprint 5
What it removes: Colima VM disk
cache via colima prune --all --force.
How detect works:
~/.colima/ exists.dir_size as pruneable.
Note: This is an estimated maximum — actual freed space depends on
which VM disk images are pruned.How clean works:
colima is not in PATH, falls back to deleting ~/.colima/ directly
via Trash (with chflags -R nouchg handling). Reports freed bytes.colima is found:
--yes (non-TTY) mode: skips the confirmation prompt automatically.colima prune --all --force.colima prune exits with a non-zero status, prints a warning with the
exit code and stderr output instead of silently treating it as success.Safety:
colima CLI installed.sasurahime clean ollamaCategory: Sprint 5
What it removes: Ollama model cache
(~/.ollama/models/).
How detect works:
ollama CLI is available, runs ollama list and parses model sizes
from the output. Reports the sum of model sizes as pruneable.dir_size of ~/.ollama/models/ if the CLI is not found.How clean works:
ollama CLI is available:
dialoguer::MultiSelect prompt for the user to
select models to remove (unless --dry-run).ollama rm <model> for each selected model.ollama CLI is not available:
~/.ollama/models/ directory directly with
chflags -R nouchg + remove_dir_all (or trash).Safety:
--dry-run mode, models are listed but never removed.sasurahime clean ios-backupCategory: Sprint 6
What it removes: iOS device backups from
~/Library/Application Support/MobileSync/Backup/. Each device appears as a
UUID-named subdirectory containing backup data (Manifest.db, etc.).
How detect works:
MobileSync/Backup/.dir_size.How clean works:
dialoguer::MultiSelect prompt to select which backups
to remove (unless --dry-run).chflags -R nouchg to clear macOS immutable flags.crate::trash::delete_path.Safety:
--yes mode. Non-TTY invocations are
safely skipped with a message.--dry-run mode, backups are listed but never removed.uchg) are handled automatically.sasurahime clean apfs-snapshotCategory: Sprint 6
What it removes: APFS local Time Machine snapshots via
tmutil deletelocalsnapshot / <name>.
How detect works:
tmutil is available on the system.tmutil listlocalsnapshots / and parses output via
parse_snapshot_names (lines trimmed, empty lines filtered)./.MobileBackups disk usage (if present) as a size estimate.Pruneable with the measured size (or 0 if /.MobileBackups does
not exist).How clean works:
tmutil listlocalsnapshots.dialoguer::MultiSelect prompt (unless --dry-run).tmutil deletelocalsnapshot / <name> for each selected snapshot.Safety:
--yes mode. Non-TTY invocations are
safely skipped with a message.--dry-run mode, snapshots are listed but never removed.sasurahime scan)Runs detect() on every cleaner and prints a formatted table via
comfy_table. No side effects — never creates, modifies, or deletes files.
| Mode | Behavior |
|---|---|
sasurahime (no args, TTY) |
Opens an interactive checkbox list. Select targets, confirm, and selected targets are cleaned. |
sasurahime --yes (no args, any) |
Cleans every pruneable target without prompting. Exits with 0 if nothing is found. |
sasurahime scan (non-TTY) |
Prints the scan table only. |
sasurahime clean <target> |
Cleans a specific target directly. |
sasurahime は 45 のクリーンターゲット をスプリント単位で提供しています。
すべてのターゲットは detect(読み取り専用、副作用なし)と clean(削除)の両方に対応しています。また、すべての clean サブコマンドは --dry-run をサポートしています。
sasurahime clean uvカテゴリ: Sprint 1
削除対象: ~/.cache/uv/ 内の古い simple-vN インデックスディレクトリ、
および uv cache prune --force の実行。
detect の動作:
~/.cache/uv/ 内のエントリを読み取ります。simple-v<N> にマッチする名前を UvCleaner::parse_simple_version でフィルタリングします。シンボリックリンクはスキップされます。clean の動作:
uv cache prune --force を呼び出します(孤立した/展開済みアーカイブを削除)。simple-vN ディレクトリを fs::remove_dir_all で削除します。--dry-run が設定されている場合:削除予定のリストを表示し、削除は行いません。安全性: 最も新しい simple-v<N>(最新)は常に保持され、古いバージョンのみ削除されます。
sasurahime clean brewカテゴリ: Sprint 1
削除対象: Homebrew のダウンロードキャッシュ。brew cleanup -s --prune=all に委譲します。
detect の動作:
~/Library/Caches/Homebrew が存在するか確認します。clean の動作:
brew が PATH にない場合、メッセージを表示して終了します (0)。brew cleanup -s --prune=all を実行します。BrewCleaner::parse_brew_freed_bytes を使用)。安全性: Homebrew CLI 自身が安全性を確保します。
sasurahime clean miseカテゴリ: Sprint 2
削除対象: mise がインストールした未使用のランタイムバージョン(~/.local/share/mise/installs/<tool>/<version> 内)。
detect の動作:
mise ls --current を実行し、現在アクティブな (tool, version) ペアを取得します。~/.config/mise/config.toml と HOME 下のすべての .mise.toml(最大深さ 5)をスキャンし、固定 (pinned) されたバージョンを収集します。~/.local/share/mise/installs/ 以下のディレクトリツリーを読み取ります。clean の動作:
(tool, version, path) トリプルごとに:
[dry-run] would remove: <tool> <version> を表示します。MiseCleaner::remove_with_uchg を呼び出し、chflags -R nouchg で macOS 不変フラグを解除後、fs::remove_dir_all を実行します。安全性:
.mise.toml(最大深さ 5)の 両方 をクロスチェックします。sasurahime clean browsersカテゴリ: Sprint 2
削除対象: Puppeteer と Playwright が使用する古いブラウザエンジンビルド。ブラウザファミリーごとに最新バージョンのみ保持します。
スキャン対象パス:
| ラベル | パス |
|---|---|
| puppeteer/chrome | ~/.cache/puppeteer/chrome |
| puppeteer/chrome-headless-shell | ~/.cache/puppeteer/chrome-headless-shell |
| ms-playwright | ~/Library/Caches/ms-playwright |
| ms-playwright-go | ~/Library/Caches/ms-playwright-go |
バージョン比較:
BrowserCleaner::version_key はディレクトリ名を Vec<u32> に変換します(ASCII 数字の連続を抽出)。mac_arm-131.0.6778.204 → [131, 0, 6778, 204]、chromium-1208 → [1208]。Vec<u32>::cmp)で行われ、semver 形式とフラットなビルド番号形式の両方を正しく処理します。detect の動作:
BrowserCleaner::find_old_versions(parent) を呼び出します。clean の動作:
find_old_versions を呼び出します。--dry-run の場合:削除予定を表示します。fs::remove_dir_all を実行します。安全性:
nightly など解析不能な名前のディレクトリはスキップされます。sasurahime clean bunカテゴリ: Sprint 3 — Generic caches
削除対象: Bun のパッケージキャッシュ。
方法: bun pm cache rm
detect の動作: bun が PATH にあるか確認します。見つかった場合は削除可能として報告します(サイズ不明)。
clean の動作:
bun が見つからない場合、メッセージを表示して終了します (0)。bun pm cache rm を実行します。安全性: 公式の bun CLI に委譲します。
sasurahime clean goカテゴリ: Sprint 3 — Generic caches
削除対象: Go のビルドキャッシュ。
方法: go clean -cache
detect の動作: go が PATH にあるか確認します。
clean の動作:
go が見つからない場合、メッセージを表示して終了します (0)。go clean -cache を実行します。安全性: 公式の go CLI に委譲します。
sasurahime clean pipカテゴリ: Sprint 3 — Generic caches
削除対象: pip のパッケージキャッシュ。
方法: pip cache purge
detect の動作: pip が PATH にあるか確認します。
clean の動作:
pip が見つからない場合、メッセージを表示して終了します (0)。pip cache purge を実行します。安全性: 公式の pip CLI に委譲します。
sasurahime clean node-gypカテゴリ: Sprint 3 — Generic caches
削除対象: node-gyp のビルドキャッシュディレクトリ。
スキャン対象パス:
~/.cache/node-gyp/~/Library/Caches/node-gyp/detect の動作:
dir_size を合計します。clean の動作:
chflags -R nouchg <path> を実行します(macOS 不変フラグを解除)。fs::remove_dir_all を実行します。安全性: macOS の uchg フラグは自動的に処理されます。
sasurahime clean npmカテゴリ: Sprint 3 — Generic caches
削除対象: npm のパッケージキャッシュ。
方法: npm cache clean --force
detect の動作: npm が PATH にあるか確認します。
clean の動作:
npm が見つからない場合、メッセージを表示して終了します (0)。npm cache clean --force を実行します。安全性: 公式の npm CLI に委譲します。
sasurahime clean yarnカテゴリ: Sprint 3 — Generic caches
削除対象: Yarn のパッケージキャッシュ。
方法: yarn cache clean
detect の動作: yarn が PATH にあるか確認します。
clean の動作:
yarn が見つからない場合、メッセージを表示して終了します (0)。yarn cache clean を実行します。安全性: 公式の yarn CLI に委譲します。
sasurahime clean pnpmカテゴリ: Sprint 3 — Generic caches
削除対象: pnpm ストア。
方法: pnpm store prune
detect の動作: pnpm が PATH にあるか確認します。
clean の動作:
pnpm が見つからない場合、メッセージを表示して終了します (0)。pnpm store prune を実行します。安全性: 公式の pnpm CLI に委譲します。
sasurahime clean cachesカテゴリ: Sprint 3 — Generic caches(集約)
削除対象: すべての ジェネリックキャッシュを 1 コマンドで削除します。
bun、go、pip、node-gyp、npm、yarn、pnpm を順次実行するのと同等です。
各サブクリーナーは独立して呼び出されます。ツールがインストールされていない場合はスキップされます(終了コードは 0)。
sasurahime clean logsカテゴリ: Sprint 3
削除対象: 既知およびユーザー設定のログディレクトリ内の N 日より古いログファイル。
組み込みログターゲット(自動スキャン):
| 名前 | パス | 削除除外ファイル |
|---|---|---|
| kilo | ~/.local/share/kilo/log |
dev.log |
| opencode | ~/.local/share/opencode/logs |
(なし) |
| claude-code | ~/.local/share/claude/logs |
(なし) |
| vscode-logs | ~/Library/Application Support/Code/logs |
(なし) |
追加ログターゲット は設定ファイルで追加できます。各ターゲットは独自のパスと除外リストを持ちます。
detect の動作:
LogCleaner::find_old_logs(dir, keep_days, exclude) を呼び出します。keep_days より古いすべてのファイルのバイトサイズを合計します。clean の動作:
find_old_logs ロジックを使用します。--dry-run の場合:各古いファイルに対して削除予定を表示します。fs::remove_file を呼び出します。Removed <N> log files。保持ポリシー:
keep_days = 7(7 日より古いファイルを削除)。--keep-days <N> フラグで上書き可能。[logs]\nkeep_days = <N>。安全性:
kilo ターゲットはデフォルトで dev.log を除外します。is_older_than は厳密な > 比較を使用します(正確に N 日前のファイルは削除 されません)。sasurahime clean xcodeカテゴリ: Sprint 3
削除対象: Xcode DerivedData フォルダ内のプロジェクトビルドアーティファクト(~/Library/Developer/Xcode/DerivedData/)。
detect の動作:
DerivedData ディレクトリが存在するか確認します。clean の動作:
DerivedData が存在しない場合、メッセージを表示して終了します (0)。DerivedData のサブディレクトリを一覧表示します。--dry-run の場合:プロジェクトごとに削除予定を表示します。fs::remove_dir_all を呼び出します。DerivedData ルート自体は 決して 削除されません。安全性:
DerivedData ルートディレクトリは 決して 削除されません。sasurahime clean actカテゴリ: Sprint 5
削除対象: act GitHub Actions ローカルランナーキャッシュ(~/.cache/act/、または $ACT_CACHE_DIR が設定されている場合はそのパス)。
方法: ディレクトリ削除。
detect の動作:
clean の動作:
is_safe_delete_target を実行してパスがシステムディレクトリでないことを確認します。fs::remove_dir_all でディレクトリを削除します。安全性: $ACT_CACHE_DIR はシステムパスのブロックリストに対して検証されます。安全でない環境変数値は拒否されます。
sasurahime clean cargoカテゴリ: Sprint 5
削除対象: Cargo レジストリキャッシュ(~/.cargo/registry/cache/)と target/ ビルドアーティファクトディレクトリ。
detect のスキャン対象:
~/.cargo/registry/cache/ — ダウンロード済みクレートアーカイブ。~/src/、~/work/、~/dev/ 以下のユーザープロジェクトの target/ ディレクトリ。clean の動作:
~/.cargo/registry/cache/ の内容を削除します。target/ ディレクトリをスキャンして削除します。chflags -R nouchg を実行します。sasurahime clean cocoa-podsカテゴリ: Sprint 5
削除対象: CocoaPods キャッシュ。
方法: pod cache clean --all
detect の動作: pod が PATH にあるか確認します。
clean の動作:
pod が見つからない場合、メッセージを表示して終了します (0)。pod cache clean --all を実行します。安全性: 公式の CocoaPods CLI に委譲します。
sasurahime clean condaカテゴリ: Sprint 5
削除対象: Conda パッケージキャッシュ。
方法: conda clean --all -y
detect の動作: conda が PATH にあるか確認します。
clean の動作:
conda が見つからない場合、メッセージを表示して終了します (0)。conda clean --all -y を実行します。安全性: 公式の Conda CLI に委譲します。
sasurahime clean denoカテゴリ: Sprint 5
削除対象: Deno キャッシュ。
方法: deno cache -r(キャッシュ再読み込み)
detect の動作: deno が PATH にあるか確認します。
clean の動作:
deno が見つからない場合、メッセージを表示して終了します (0)。deno cache -r を実行します。安全性: 公式の Deno CLI に委譲します。
sasurahime clean dockerカテゴリ: Sprint 5
削除対象: Docker の dangling イメージ、コンテナ、ビルドキャッシュ、ネットワーク。
方法: docker system prune -f
detect の動作: docker が PATH にあるか確認します。
clean の動作:
docker が見つからない場合、メッセージを表示して終了します (0)。docker system prune -f を実行します(dangling イメージのみ — タグ付きイメージは保持)。安全性: dangling(タグなし)イメージのみ削除します。明示的に -a フラグを避け、タグ付きの未使用イメージを保持します。
sasurahime clean downloadsカテゴリ: Sprint 5
削除対象: ~/Downloads/ 内のファイル。
detect の動作:
~/Downloads が存在するか確認します。clean の動作:
~/Downloads の直下の子項目を一覧表示します。chflags -R nouchg + remove_dir_all で削除します。~/Downloads/ の直下の項目のみ削除します(再帰なし)。sasurahime clean gradleカテゴリ: Sprint 5
削除対象: Gradle の古いバージョンキャッシュ(~/.gradle/caches/)。キャッシュされた各アーティファクトの最新バージョンのみ保持します。
detect の動作:
~/.gradle/caches/ をスキャンしてバージョンディレクトリを確認します。clean の動作:
chflags -R nouchg + remove_dir_all で古いディレクトリを削除します。安全性: 各キャッシュアーティファクトの最新バージョンは常に保持されます。
sasurahime clean huggingfaceカテゴリ: Sprint 5
削除対象: Hugging Face モデルキャッシュ(~/.cache/huggingface/hub/ または $HF_HOME/hub)。
detect の動作:
hub/ ディレクトリが存在するか確認します。clean の動作:
huggingface-cli delete-cache --yes を実行します。hub/ の内容を直接削除します(削除後に hub/ ディレクトリを再作成)。$HF_HOME は is_safe_delete_target で検証されます。安全性: $HF_HOME はシステムパスのブロックリストに対して検証されます。CLI が直接削除より優先されます。
sasurahime clean jetbrainsカテゴリ: Sprint 5
削除対象: JetBrains IDEs(IntelliJ IDEA、WebStorm など)の古いバージョンキャッシュ(~/Library/Caches/JetBrains/ 内)。
方法: Gradle キャッシュと同様に、各 IDE キャッシュの最新バージョンを保持します。
detect の動作:
~/Library/Caches/JetBrains/ をスキャンして IDE 単位・バージョン単位のディレクトリを確認します。clean の動作:
chflags -R nouchg + remove_dir_all で削除します。安全性: 各 IDE キャッシュの最新バージョンは常に保持されます。
sasurahime clean library-logsカテゴリ: Sprint 5
削除対象: ~/Library/Logs/ 下のユーザーログファイル。ヒューリスティックルールを使用して削除候補を提案します。インタラクティブ — --all が使用されない限り選択プロンプトが表示されます。
detect の動作:
~/Library/Logs/ の直下の子項目を読み取ります。dir_size と last_modified 時間を測定します。[large] タグ[stale N days] タグCrashReporter、DiagnosticReports、ドットエントリを除外します。clean の動作:
--dry-run:各エントリとその理由タグを表示します。--all:確認なしですべての候補を削除します。dialoguer::MultiSelect ですべてのエントリを事前選択して表示し、ユーザーが確認して削除します。安全性:
CrashReporter と DiagnosticReports は 常に 除外されます。.DS_Store、.localized など)はスキップされます。SystemTime::now() にクランプされます。--dry-run は副作用ゼロを保証します。sasurahime clean orbstackカテゴリ: Sprint 5
削除対象: Orbstack Docker ランタイムキャッシュ。
方法: orb prune
detect の動作: orb が PATH にあるか確認します。
clean の動作:
orb が見つからない場合、メッセージを表示して終了します (0)。orb prune を実行します。安全性: 公式の Orbstack CLI に委譲します。
sasurahime clean pipxカテゴリ: Sprint 5
削除対象: pipx キャッシュと未使用パッケージ。
方法: pipx cache purge
detect の動作: pipx が PATH にあるか確認します。
clean の動作:
pipx が見つからない場合、メッセージを表示して終了します (0)。pipx cache purge を実行します。安全性: 公式の pipx CLI に委譲します。
sasurahime clean poetryカテゴリ: Sprint 5
削除対象: Poetry パッケージキャッシュ。
方法: poetry cache clear --all
detect の動作: poetry が PATH にあるか確認します。
clean の動作:
poetry が見つからない場合、メッセージを表示して終了します (0)。poetry cache clear --all を実行します。安全性: 公式の Poetry CLI に委譲します。
sasurahime clean pre-commitカテゴリ: Sprint 5
削除対象: pre-commit フック環境キャッシュ(~/.cache/pre-commit/、$PRE_COMMIT_HOME、または $XDG_CACHE_HOME/pre-commit)。
detect の動作:
$PRE_COMMIT_HOME → $XDG_CACHE_HOME/pre-commit → ~/.cache/pre-commit。clean の動作:
pre-commit clean を実行します。is_safe_delete_target で検証されます。安全性: 環境変数パスは検証されます。CLI が直接削除より優先されます。
sasurahime clean rustupカテゴリ: Sprint 5
削除対象: 未使用の Rust ツールチェーンバージョン(rustup default や rustup override で選択されていないもの)。
detect の動作:
rustup toolchain list を実行してインストール済みツールチェーンを列挙します。(default) マーク)とオーバーライドツールチェーン((override) マーク)を特定します。clean の動作:
rustup toolchain remove <name> を実行します。安全性: デフォルトとオーバーライドのツールチェーンは 決して 削除されません。
sasurahime clean spmカテゴリ: Sprint 5
削除対象: Swift Package Manager のビルドアーティファクトとキャッシュされたパッケージ。
方法: ~/Library/Caches/org.swift.swiftpm/ と ~/Library/Developer/Xcode/DerivedData/SourcePackages/ を削除します。
detect の動作:
clean の動作:
chflags -R nouchg を実行します。fs::remove_dir_all を呼び出します。sasurahime clean trashカテゴリ: Sprint 5
削除対象: ~/.Trash — スキャンのみ。sasurahime はゴミ箱ディレクトリのサイズを報告しますが、削除は行いません(ユーザーは Finder からゴミ箱を空にしてください)。
detect の動作:
~/.Trash が存在するか確認します。clean の動作:
--dry-run: detect スタイルのスキャンを実行し、解放されるサイズを表示します。安全性: sasurahime は ~/.Trash の内容を削除することを拒否します。これは意図的な安全対策です。
sasurahime clean voltaカテゴリ: Sprint 5
削除対象: Volta Node.js バージョンマネージャのキャッシュ(~/.volta/cache/)。
方法: ディレクトリ削除。
detect の動作:
~/.volta/cache/ が存在するか確認します。clean の動作:
~/.volta/cache/ ディレクトリを fs::remove_dir_all で削除します。安全性: cache/ サブディレクトリのみ削除され、~/.volta/ 自体とツールチェーンバイナリは保持されます。
sasurahime clean sbtカテゴリ: Sprint 5
削除対象: sbt ビルドキャッシュ(~/.sbt/)と Ivy 依存関係キャッシュ(~/.ivy2/cache/)。
方法: ディレクトリ削除。
detect の動作:
~/.sbt/ または ~/.ivy2/cache/ が存在するか確認します。clean の動作:
~/.sbt/ と ~/.ivy2/cache/ を fs::remove_dir_all で削除します。安全性: ディレクトリは完全に削除されます。依存関係は次回 sbt compile 実行時に再取得されます。
sasurahime clean tree-sitterカテゴリ: Sprint 5
削除対象: tree-sitter パーサーコンパイルキャッシュ(~/.cache/tree-sitter/)。
方法: ディレクトリ削除。
detect の動作:
~/.cache/tree-sitter/ が存在するか確認します。clean の動作:
~/.cache/tree-sitter/ を fs::remove_dir_all で削除します。安全性: パーサーは次回エディタ(Neovim、Helix など)使用時に再コンパイルされます。
sasurahime clean simulatorカテゴリ: Sprint 5
削除対象: iOS シミュレータキャッシュ。xcrun simctl delete unavailable で利用不可のシミュレータランタイムを削除します。
detect の動作:
~/Library/Developer/CoreSimulator が存在するか確認します。clean の動作:
xcrun が PATH にない場合、メッセージを表示して終了します (0)。xcrun simctl delete unavailable を実行します。安全性: 公式の xcrun CLI に委譲します。
sasurahime clean device-supportカテゴリ: Sprint 5
削除対象: ~/Library/Developer/Xcode/* DeviceSupport/ 内の古い Xcode DeviceSupport ディレクトリ。プラットフォームごとに最新 N バージョンを保持(デフォルト: 2)。
スキャン対象パス:
~/Library/Developer/Xcode/iOS DeviceSupport/~/Library/Developer/Xcode/watchOS DeviceSupport/* DeviceSupport/ ディレクトリバージョン比較:
17.0、18.0)を収集。メジャーバージョン(. の前の数値)で比較します。detect の動作:
~/Library/Developer/Xcode/ 内の * DeviceSupport/ ディレクトリをスキャンします。clean の動作:
--dry-run の場合:削除予定のディレクトリを表示します。chflags -R nouchg を実行後、ゴミ箱へ移動(または完全削除)します。安全性:
DeviceSupport ルートディレクトリは決して削除されません。sasurahime clean vscode-extensionsカテゴリ: Sprint 5
削除対象: VS Code 拡張機能キャッシュ(~/.vscode/extensions/)。
方法: ディレクトリ削除。
detect の動作:
~/.vscode/extensions/ が存在するか確認します。clean の動作:
~/.vscode/extensions/ を fs::remove_dir_all で削除します。安全性: 拡張機能キャッシュのみ削除され、VS Code の設定は保持されます。
sasurahime clean mavenカテゴリ: Sprint 5
削除対象: Maven ローカルリポジトリキャッシュ。mvn dependency:purge-local-repository で削除します。
detect の動作:
~/.m2/repository が存在するか確認します。clean の動作:
mvn が PATH にない場合、メッセージを表示して終了します (0)。mvn dependency:purge-local-repository を実行します。安全性: 公式の Maven CLI に委譲します。依存関係は次回ビルド時に再ダウンロードされます。
sasurahime clean terraformカテゴリ: Sprint 5
削除対象: Terraform プロバイダプラグインキャッシュ(~/.terraform.d/plugin-cache/ または $TF_PLUGIN_CACHE_DIR)。
方法: ディレクトリ削除。
detect の動作:
$TF_PLUGIN_CACHE_DIR が設定されていればそのパス、そうでなければ ~/.terraform.d/plugin-cache/。clean の動作:
fs::remove_dir_all で削除します。terraform init 実行時に再ダウンロードされます。安全性: $TF_PLUGIN_CACHE_DIR は is_safe_delete_target で検証されます。プロバイダキャッシュのみ削除され、Terraform のステートファイルと設定は保持されます。
sasurahime clean flutterカテゴリ: Sprint 5
削除対象: Flutter/Dart pub キャッシュ。dart pub cache clean で削除します。
detect の動作:
$PUB_CACHE または ~/.pub-cache/)が存在するか確認します。clean の動作:
dart が PATH にない場合、メッセージを表示して終了します (0)。dart pub cache clean を実行します。安全性: 公式の Dart CLI に委譲します。公開パッケージは次回 dart pub get または flutter pub get 実行時に再ダウンロードされます。
sasurahime clean colimaカテゴリ: Sprint 5
削除対象: Colima VM ディスクキャッシュ。colima prune --all --force で削除します。
detect の動作:
~/.colima/ が存在するか確認します。clean の動作:
colima が PATH にない場合、~/.colima/ をゴミ箱経由で直接削除します
(chflags -R nouchg 処理あり)。解放バイト数を報告します。colima が見つかった場合:
--yes(非 TTY)モードでは:確認プロンプトを自動的にスキップします。colima prune --all --force を実行します。colima prune が非ゼロ終了した場合、サイレントに成功とみなす代わりに、
終了コードと標準エラー出力を含む警告を表示します。安全性:
colima CLI がインストール
されていない環境でもキャッシュを削除できます。sasurahime clean ollamaカテゴリ: Sprint 5
削除対象: Ollama モデルキャッシュ(~/.ollama/models/)。
detect の動作:
ollama CLI が利用可能な場合、ollama list を実行しモデルサイズをパースして報告します。~/.ollama/models/ の dir_size にフォールバックします。clean の動作:
ollama CLI が利用可能な場合:
dialoguer::MultiSelect プロンプトで削除するモデルを選択します(--dry-run 時を除く)。ollama rm <model> を実行します。ollama CLI が利用できない場合:
~/.ollama/models/ ディレクトリを chflags -R nouchg + remove_dir_all(またはゴミ箱)で削除します。安全性:
--dry-run モードではモデルが一覧表示されるのみで削除は行われません。sasurahime clean ios-backupカテゴリ: Sprint 6
削除対象: ~/Library/Application Support/MobileSync/Backup/ 内の iOS
デバイスバックアップ。各デバイスは UUID のような名前のサブディレクトリとして
保存されています。
detect の動作:
dir_size を測定します。clean の動作:
dialoguer::MultiSelect プロンプトで削除するバックアップを
選択します(--dry-run 時を除く)。chflags -R nouchg で macOS 不変フラグを解除します。安全性:
--yes モードでは決して実行されません。非 TTY
の呼び出しは安全にスキップされます。--dry-run モードではバックアップが一覧表示されるのみで削除は行われません。uchg)は自動的に処理されます。sasurahime clean apfs-snapshotカテゴリ: Sprint 6
削除対象: tmutil deletelocalsnapshot / <name> による APFS ローカル
Time Machine スナップショット。
detect の動作:
tmutil がシステムで利用可能か確認します。tmutil listlocalsnapshots / を実行し、出力を parse_snapshot_names
でパースします(行のトリミング、空行のフィルタリング)。/.MobileBackups のディスク使用量(存在する場合)をサイズ見積もりとして
測定します。Pruneable を返します(/.MobileBackups が存在しない
場合は 0)。clean の動作:
tmutil listlocalsnapshots からローカルスナップショットを一覧表示します。dialoguer::MultiSelect プロンプトを開きます(--dry-run 時を
除く)。tmutil deletelocalsnapshot / <name>
を実行します。安全性:
--yes モードでは決して実行されません。非 TTY
の呼び出しは安全にスキップされます。--dry-run モードではスナップショットが一覧表示されるのみで削除は
行われません。sasurahime scan)すべてのクリーナーで detect() を実行し、comfy_table を使ってフォーマットされたテーブルを表示します。副作用はありません — ファイルの作成、変更、削除は一切行いません。
| モード | 動作 |
|---|---|
sasurahime(引数なし、TTY) |
インタラクティブなチェックボックスリストを起動します。ターゲットを選択して確認すると、選択したターゲットがクリーンされます。 |
sasurahime --yes(引数なし) |
確認なしですべての削除可能ターゲットをクリーンします。何もなければ 0 で終了します。 |
sasurahime scan(非 TTY) |
スキャン結果の一覧のみを表示します。 |
sasurahime clean <target> |
特定のターゲットを直接クリーンします。 |