Metadata-Version: 2.4
Name: unclog
Version: 0.3.0
Summary: Audit your Claude Code installation and clear context-window bloat. Local-only.
Project-URL: Homepage, https://github.com/thomaschill/unclog
Project-URL: Repository, https://github.com/thomaschill/unclog
Project-URL: Issues, https://github.com/thomaschill/unclog/issues
Author: Tom Hill
License: MIT License
        
        Copyright (c) 2026 Tom Hill
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: audit,claude,claude-code,cli,context,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: readchar>=4.0
Requires-Dist: rich>=13.7
Requires-Dist: tiktoken>=0.7
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-snapshot>=0.9; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# unclog

[![PyPI](https://img.shields.io/pypi/v/unclog.svg)](https://pypi.org/project/unclog/)
[![GitHub stars](https://img.shields.io/github/stars/thomaschill/unclog?style=flat&logo=github)](https://github.com/thomaschill/unclog)

**Every agent, skill, slash command, and MCP server you've installed occupies your Claude Code context window on every turn.** `unclog` scans your install, shows you what's costing tokens, flags MCP servers you haven't called in 30 days, and lets you handpick what to delete — locally, with no telemetry, no accounts, and no network calls.

```
# install
uv tool install unclog

# run
unclog
```

![unclog scan output](https://raw.githubusercontent.com/thomaschill/unclog/main/media/screenshot.png)

## What it shows

- Every **agent** in `~/.claude/agents/`, with its token cost.
- Every **skill** in `~/.claude/skills/`, with its token cost.
- Every **slash command** in `~/.claude/commands/`, with its token cost.
- Every **MCP server** declared in `~/.claude.json` (global and per-project), with its **invocation count over the last 30 days** so you can see which ones are actually pulling their weight. Servers with zero invocations get an `[unused]` flag.
- A **baseline** — the total tokens loaded before you type a single message.

### Why no per-MCP token count?

Modern Claude Code session logs no longer record the tools schema, so unclog cannot recover an exact token cost for each MCP server without spinning up the server and querying it. We've chosen to stay lightweight (no network, no spawning user-configured commands) and show `— tok` honestly rather than guess. **Invocation count is the next-best signal**: a server you haven't called in 30 days is paying schema rent for nothing.

Invocation counts come from walking every session JSONL under `~/.claude/projects/` (parent and subagent files) and tallying `tool_use` blocks per server. Counts are per server *name* — if the same MCP is declared at both global and project scope, both rows show the same total.

## Remove what's costing you

![unclog interactive curate flow](https://raw.githubusercontent.com/thomaschill/unclog/main/media/demo.gif)

After the scan, one sectioned picker opens. Tick the agents / skills / commands / MCPs you want to remove, hit `enter`, confirm once, done. A post-apply line shows how many tokens you saved and the new baseline.

Picker keys: `↑↓` move · `space` toggle · `a` / `A` check section / all · `n` / `N` clear section / all · `enter` apply · `q` quit.

**Actions are destructive.** Deleted files are removed from disk. MCP servers are deleted from `~/.claude.json`. There is no undo and unclog keeps no snapshot — if you want to revive something, restore it from your own backup or reinstall.

## Requirements

Python 3.11+, Claude Code ≥ 2.1.90, macOS or Linux.

## Development

```
uv sync --all-extras --dev
uv run pytest
uv run ruff check src tests
uv run mypy src/unclog
```

## License

MIT. See [LICENSE](LICENSE).
