Skip to main content

The cache cleaner for the AI Coding era. Clean up Claude Code, Cursor, npm, pip, cargo caches and more.

Project description

cc-cleaner

PyPI version Python 3.10+ License: MIT

The cache cleaner for the AI Coding era.

cc = Claude Code / Cursor / Copilot / Coding Cache

The Problem

In the AI Coding era, tools like Claude Code, Cursor, and GitHub Copilot have revolutionized how we write code. But there's a hidden cost:

  • Rapid project iteration - AI helps you scaffold projects in seconds, leaving behind node_modules, venv, build artifacts
  • Massive conversation logs - Claude Code stores every conversation as .jsonl files (can grow to GB!)
  • Cache explosion - Package managers (npm, pip, cargo) cache everything you've ever installed
  • Debug & telemetry data - AI tools generate tons of logs and telemetry

Result: Your disk fills up 10x faster than before.

The Solution

cc-cleaner is built specifically for AI-assisted developers. It knows exactly what to clean:

# Install
pipx install cc-cleaner

# See what's eating your disk
cc-cleaner status

# Clean safely
cc-cleaner clean

Quick Start

# Show all cleanable caches with sizes
cc-cleaner status

# Clean all safe targets (dry run first)
cc-cleaner clean --dry-run

# Actually clean
cc-cleaner clean

# Clean specific tool
cc-cleaner clean claude
cc-cleaner clean npm

What It Cleans

AI Coding Tools

Tool What's Cleaned Risk
Claude Code Debug logs, telemetry, conversation transcripts (.jsonl) Safe/Moderate

Package Managers

Tool What's Cleaned Risk
npm ~/.npm/_cacache, ~/.npm/_logs Safe
yarn Yarn cache, Berry cache Safe
pnpm Store, metadata cache Moderate
pip ~/.cache/pip Safe
uv ~/.cache/uv Safe
cargo Registry cache, git deps Safe
go Module cache, build cache Safe

Build Tools & IDEs

Tool What's Cleaned Risk
Gradle Caches, daemon, wrapper dists Moderate
CocoaPods Specs repos, download cache Moderate
Homebrew Download cache, logs Safe
Docker Build cache, dangling images, system prune Safe/Dangerous

Commands

cc-cleaner status [CLEANER]

Show disk usage. See how much space you can reclaim.

cc-cleaner status          # All cleaners
cc-cleaner status claude   # Only Claude Code
cc-cleaner status --json   # JSON output for scripts

cc-cleaner clean [CLEANER]

Clean caches. Safe by default.

cc-cleaner clean                    # Clean all safe targets
cc-cleaner clean npm                # Clean only npm
cc-cleaner clean --dry-run          # Preview only
cc-cleaner clean --include-moderate # Include moderate-risk targets
cc-cleaner clean --force            # Include dangerous targets
cc-cleaner clean -y                 # Skip confirmation

cc-cleaner list

List all available cleaners.

Risk Levels

Level Description Cleaned By Default
Safe Quick to rebuild, no impact Yes
Moderate May take time to rebuild With --include-moderate
Dangerous Potential data loss With --force

What's Safe?

  • npm/pip/cargo download caches (re-download on demand)
  • Build caches (rebuild automatically)
  • Log files (you probably don't need them)
  • Claude Code telemetry/debug logs

What's Moderate?

  • Claude Code conversation transcripts (your chat history!)
  • pnpm store (shared across projects)
  • Gradle dependencies (slow to re-download)

What's Dangerous?

  • Docker system prune (removes all unused images/containers)

Installation

pipx (Recommended)

pipx install cc-cleaner

uv

uv tool install cc-cleaner

pip

pip install cc-cleaner

Real World Usage

Weekly Cleanup Routine

# Check what's taking space
cc-cleaner status

# Clean safe stuff (no confirmation needed)
cc-cleaner clean -y

# Review and clean moderate stuff
cc-cleaner clean --include-moderate

After Heavy AI Coding Session

# Claude Code transcripts can grow huge
cc-cleaner status claude

# Clean old conversations (keep your sanity and disk space)
cc-cleaner clean claude --include-moderate

Before Running Low on Disk

# Nuclear option - clean everything safe + moderate
cc-cleaner clean --include-moderate -y

# Check Docker specifically
cc-cleaner status docker
cc-cleaner clean docker --force  # If you really need space

Contributing

Adding a new cleaner is easy:

from cc_cleaner.core import (
    BaseCleaner, CleanMethod, CleanTarget, RiskLevel,
    expand_path, get_dir_size, register_cleaner,
)

@register_cleaner
class MyCleaner(BaseCleaner):
    name = "my-tool"
    description = "My AI coding tool caches"
    risk_level = RiskLevel.SAFE

    def get_targets(self) -> list[CleanTarget]:
        cache = expand_path("~/.my-tool/cache")
        return [
            CleanTarget(
                name="my-tool/cache",
                path=cache,
                description="My tool cache",
                risk_level=RiskLevel.SAFE,
                clean_method=CleanMethod.DELETE_DIR,
                size_bytes=get_dir_size(cache) if cache.exists() else 0,
                exists=cache.exists(),
            )
        ]

PRs welcome for:

  • Cursor cache locations
  • GitHub Copilot cache locations
  • Windsurf / other AI coding tools
  • Any tool that AI coders frequently use

License

MIT


Built for the AI Coding era. Stop running out of disk space.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_cleaner-0.1.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_cleaner-0.1.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file cc_cleaner-0.1.2.tar.gz.

File metadata

  • Download URL: cc_cleaner-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_cleaner-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2e34dd27efaa7066e415e0fafd29804bc49832b241a35a474b7e720fa5af64c1
MD5 f081fe6a2cbde14418bf8283d6503ca3
BLAKE2b-256 63b8b4f1a5a16705cce32b862034be06a713e2c468e55a4cfd04452c8e3528de

See more details on using hashes here.

File details

Details for the file cc_cleaner-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cc_cleaner-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_cleaner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b235ecac0e4fb1bdf13113ae3e423d87ceca0222a44913ccae83db9d37a50bd2
MD5 1b5d9a74fa6bb0fef4bfe0e711fe3fab
BLAKE2b-256 16522eab2724023c95b2e0c7328ebb0846405f605c89b800699306dc4c0b0f1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page