cts

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 17 Imported by: 0

README

Cut The Shit — reclaim your machine from dead AI tooling

A fast, safe CLI that finds and removes dead skills, agents, plugins and MCP servers left behind by AI coding tools — with dry-run, confirmation and automatic backups.

CI Go Platforms Single binary


The problem

Every AI coding tool you try leaves a trail: orphaned skills, abandoned agent CLIs, plugin caches, marketplace clones, MCP servers configured once and forgotten. It piles up — hundreds of megabytes of disk, and worse, dozens of tool and skill definitions injected into every prompt's context.

Cleaning it by hand means hunting through ~/.claude, ~/.config, AppData, ~/Library, npm/bun/uv globals and JSON configs. cts does it for you — and never deletes anything without a backup.

What it finds

Category What cts detects
Skills broken symlinks, skills missing SKILL.md
Agents orphan config (a config dir whose binary isn't installed) across every OS config root
Plugins orphan marketplaces (clones/caches with no installed plugin)
MCP servers inventory of configured servers + stdio servers whose command is missing

Demo

$ cts scan

SKILL
    nestjs-best-practices          4.5KB
  x improve-codebase              0B        broken symlink

AGENT
  x codebuddy                     0B        orphan config (binary not installed)
  x iflow                         0B        orphan config (binary not installed)

PLUGIN
    claude-plugins-official       21.2MB

MCP
    context7                       0B        user
    notion                         0B        project: my-app

36 targets · 3 dead

Run cts with no arguments for the interactive menu — pick exactly what to remove from a list (dead items pre-checked), confirm, done.

Features

  • 🔍 Four scanners, one report — skills, agents, plugins and MCP servers, grouped and color-coded.
  • 🧹 Two ways to cleanpurge the obviously-dead in one shot, or clean to hand-pick from an interactive list.
  • 🛟 Safe by default — dry-run is the default, every removal asks for confirmation, and everything is backed up to .cts-backups/ first. If the backup fails, nothing is deleted.
  • 🌍 Truly cross-platform — scans config across the home dir, ~/.config (XDG), Windows AppData, and macOS ~/Library.
  • 📦 Proper uninstall — removes packages via their real manager (npm rm -g, bun rm -g, uv tool uninstall) and MCP servers via claude mcp remove, not by hacking config files.
  • Single binary, tiny footprint — written in Go, no runtime required.

Install

go build -o cts .          # or: go install

Usage

cts                  # interactive menu (logo + pick an action)
cts scan             # list what's on the machine (read-only)
cts clean            # pick items from a list and remove them
cts purge            # show what it would remove (dead only, dry-run)
cts purge --yes      # actually remove the dead ones (with backup)
cts help             # command reference

Safety: scan and purge (without --yes) never touch your files. Real removal always confirms first and writes a backup to .cts-backups/<timestamp>/.

Architecture

cts follows a deep-module design: a pure domain at the center, IO and wiring at the edge, and a single small seam (Scanner) that every category plugs into.

  main · interactive            CLI, wiring, IO  ── the edge
        │
        ├── ui                  presentation: logo, help, colored report
        │
        ├── scan                Scanner seam + Run (fan-out, error-join)
        │    ├── skills
        │    ├── agents   ── configroots   (cross-platform config roots)
        │    ├── plugins  ── dirsize       (directory size)
        │    └── mcp
        │
        ├── remove              dry-run · backup · Runner (uninstall) · delete
        │
        └── target              pure domain: Target, Category  (imported by all)

Flow:

scan:    main → scan.Run(scanners...) → []target.Target → ui.Report
remove:  selection → remove.Remover → backup → uninstall (Runner) → delete

The Scanner seam is one method per category, satisfied implicitly (no inheritance):

type Scanner interface {
    Category() target.Category
    Scan(ctx context.Context) ([]target.Target, error)
}

Each category is an independent adapter, testable in isolation with t.TempDir(). External dependencies (PATH lookups, command execution, config roots) are injected, so the entire scan-and-remove core is tested without ever touching the real machine.

See docs/ARCHITECTURE.md for the full design and docs/adr/ for the recorded decisions.

Project structure

cts/
├── main.go                 CLI entry, command dispatch, real adapters
├── interactive.go          interactive multi-select flow (huh)
├── internal/
│   ├── target/             pure domain (Target, Category)
│   ├── scan/               Scanner seam + Run
│   │   ├── skills/
│   │   ├── agents/
│   │   ├── plugins/
│   │   └── mcp/
│   ├── remove/             removal core (dry-run, backup, uninstall)
│   ├── configroots/        OS-specific config base directories
│   ├── dirsize/            directory size measurement
│   └── ui/                 logo, help, colored report
├── docs/                   architecture, working guide, ADRs, prior art
└── .github/workflows/      CI (vet, lint, race tests, build)

Development

go test ./...              # run the tests
./scripts/check.sh         # full local gate: fmt + vet + lint + race tests + build

Every push runs CI (format, vet, golangci-lint, race tests, build). Contribution conventions live in docs/WORKING.md.

Roadmap

  • Uninstall of go-installed and Python-venv agents (currently config-only).
  • Removal of project-scoped MCP servers (currently inventory-only).

License

Released under the MIT License.


Built in Go · safe by default · your machine, your call.

Documentation

Overview

Command cts — Cut The Shit. Cleans dead skills, agents, plugins and MCP servers.

Directories

Path Synopsis
internal
configroots
Package configroots resolves the OS-specific base directories where tool configuration lives, so scanners find configs on Linux, macOS and Windows.
Package configroots resolves the OS-specific base directories where tool configuration lives, so scanners find configs on Linux, macOS and Windows.
dirsize
Package dirsize sums the size of the files under a directory.
Package dirsize sums the size of the files under a directory.
remove
Package remove deletes targets safely: dry-run by default and a backup before deleting.
Package remove deletes targets safely: dry-run by default and a backup before deleting.
scan
Package scan coordinates the per-category scanners.
Package scan coordinates the per-category scanners.
scan/agents
Package agents finds agent CLIs and flags orphan config: a config directory whose binary is no longer installed (e.g.
Package agents finds agent CLIs and flags orphan config: a config directory whose binary is no longer installed (e.g.
scan/mcp
Package mcp inventories the configured MCP servers and flags the stdio ones whose command is not installed.
Package mcp inventories the configured MCP servers and flags the stdio ones whose command is not installed.
scan/plugins
Package plugins finds orphan plugin marketplaces: clones/caches on disk for a marketplace that no longer has any installed plugin.
Package plugins finds orphan plugin marketplaces: clones/caches on disk for a marketplace that no longer has any installed plugin.
scan/skills
Package skills finds installed skills and flags the broken/incomplete ones.
Package skills finds installed skills and flags the broken/incomplete ones.
target
Package target defines what cts finds and can remove.
Package target defines what cts finds and can remove.
ui
Package ui handles presentation: logo, help and the formatted report.
Package ui handles presentation: logo, help and the formatted report.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL