Skip to content
Back to search

cc-sessions

MarketplaceWorks with Claude CodeGitHub

cc-sessions: see and safely clean up Claude Code sessions.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/droiddevgeeks--cc-sessions/badge.svg)](/listings/droiddevgeeks--cc-sessions)

HTML

<a href="/listings/droiddevgeeks--cc-sessions"><img src="/api/listings/droiddevgeeks--cc-sessions/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**As a Claude Code plugin** (recommended):

/plugin marketplace add droiddevgeeks/cc-sessions
/plugin install cc-sessions@cc-sessions

That gives you the `/sessions` skill straight away. For the `ccs` terminal command too, ask Claude to "install the ccs command" or run once:

python3 ~/.claude/plugins/cache/cc-sessions/cc-sessions/*/cc_sessions.py install-cli

It writes small launchers to `~/.local/bin` that always run the newest installed plugin version, so `/plugin update` needs no reinstall.

**From git** (if you want to hack on it):

git clone https://github.com/droiddevgeeks/cc-sessions.git
cd cc-sessions && bash install.sh

This symlinks `cc-sessions` and `ccs` into `~/.local/bin` and the `/sessions` skill into `~/.claude/skills`, so `git pull` updates all of it. `bash install.sh --uninstall` removes the links (never your data). Use one method or the other, not both, or you'll have two `/sessions` skills.

Needs Python 3.9+. Nothing to pip install.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 14 lines
  1. {
  2. "name": "cc-sessions",
  3. "description": "cc-sessions: see and safely clean up Claude Code sessions.",
  4. "owner": {
  5. "name": "droiddevgeeks"
  6. },
  7. "plugins": [
  8. {
  9. "name": "cc-sessions",
  10. "source": "./",
  11. "description": "Clean up Claude Code without losing work you forgot you had: sessions, RAM, transcripts and /tmp scratchpads, with unpushed work saved before anything is deleted."
  12. }
  13. ]
  14. }
README.md · README · 105 lines
  1. # cc-sessions
  2. **Clean up Claude Code without losing work you forgot you had.**
  3. Heavy [Claude Code](https://claude.com/claude-code) use leaves a trail: ~400 MB of RAM per open session, transcripts piling up in `~/.claude`, and per-session scratchpads in `/tmp` full of cloned repos. On my machine that was 1.9 GB on disk, and one forgotten clone held 3 commits that existed nowhere else.
  4. `ccs` shows all of it in one place: what's running, what each session was about, what's taking space. Then it helps you clean up without the usual risk. It never touches live sessions, flags clones with unpushed work, shows you the actual commits before letting you delete them, and saves them to a git bundle first. Every deletion is logged, and at-risk work is saved so you can restore it.
  5. Type `ccs` and use the arrow keys, or just ask Claude to "clean up my sessions".
  6. Single Python file, standard library only. macOS and Linux.
  7. ```
  8. ▍Sessions 105 · 1.7G on disk
  9. # SIZE IDLE TITLE PROJECT
  10. 1 657.2M <1m Node 24 migration web/api ● live
  11. 2 313.6M 4h Fix auth on public routes infra ⚠ cfg: 3 unpushed commit(s)
  12. 3 207.8M 7d Checkout screen redesign android/app
  13. ```
  14. ## Install
  15. **As a Claude Code plugin** (recommended):
  16. ```
  17. /plugin marketplace add droiddevgeeks/cc-sessions
  18. /plugin install cc-sessions@cc-sessions
  19. ```
  20. That gives you the `/sessions` skill straight away. For the `ccs` terminal command too, ask Claude to "install the ccs command" or run once:
  21. ```bash
  22. python3 ~/.claude/plugins/cache/cc-sessions/cc-sessions/*/cc_sessions.py install-cli
  23. ```
  24. It writes small launchers to `~/.local/bin` that always run the newest installed plugin version, so `/plugin update` needs no reinstall.
  25. **From git** (if you want to hack on it):
  26. ```bash
  27. git clone https://github.com/droiddevgeeks/cc-sessions.git
  28. cd cc-sessions && bash install.sh
  29. ```
  30. This symlinks `cc-sessions` and `ccs` into `~/.local/bin` and the `/sessions` skill into `~/.claude/skills`, so `git pull` updates all of it. `bash install.sh --uninstall` removes the links (never your data). Use one method or the other, not both, or you'll have two `/sessions` skills.
  31. Needs Python 3.9+. Nothing to pip install.
  32. ## Use
  33. Type `ccs` and choose with ↑↓ / Enter:
  34. ```
  35. ▍cc-sessions what do you want to do?
  36. ❯ 1 Overview — processes, disk, everything
  37. 2 List sessions
  38. 3 Inspect a session
  39. 4 Clean old scratch (preview first)
  40. 5 Pick sessions to delete
  41. 6 Kill leftover processes
  42. 7 Deletion log & rescued work
  43. q Quit
  44. ```
  45. In *Pick*, Space ticks sessions, `a` ticks all, Enter confirms. Esc goes back from anywhere.
  46. Or ask Claude Code: "clean up my sessions", "what's eating RAM", "find the session where I worked on X", or `/sessions`.
  47. ### Commands (for scripts)
  48. | Command | Does |
  49. |---|---|
  50. | `cc-sessions overview` | Processes + transcripts + scratchpads |
  51. | `cc-sessions ps` | Live processes, RAM, session name/status |
  52. | `cc-sessions disk [--all]` | Disk use, with clone status per scratchpad |
  53. | `cc-sessions ls [--all]` | Numbered session list with titles |
  54. | `cc-sessions show <#\|sid>` | One session: tokens, first prompt, clones, resume command |
  55. | `cc-sessions clean --scratch 3d` | Preview deleting scratch idle > 3 days |
  56. | `cc-sessions clean --scratch 3d --yes` | Actually delete |
  57. | `cc-sessions clean --transcripts 14d --yes` | Delete old transcripts (no more `/resume` for them) |
  58. | `cc-sessions clean --only <sid> --yes` | One session |
  59. | `cc-sessions kill <pid>…` | SIGTERM Claude processes |
  60. | `cc-sessions log [-n N]` | What was deleted, when, and where rescued work went |
  61. Ages: `3d`, `12h`, or a bare number of days.
  62. ## Safety
  63. - **Preview by default.** `clean` deletes nothing without `--yes`; the menu and pick make you type `yes`.
  64. - **Live sessions are never deleted**, even with `--force`.
  65. - **Clones with unpushed commits, uncommitted changes, no remote, or an unreadable `.git` are skipped.** To delete them anyway, *pick* shows the at-risk commits and makes you type the clone's name; scripts need `--force`.
  66. - **At-risk work is saved before it's deleted.** Unpushed commits go to a git bundle, uncommitted changes to a `.patch`, untracked files to a `.tar`, all in `~/.claude/cc-sessions-rescue/`. If saving fails, the folder is not deleted. Restore with `git clone <file>.bundle restored` or `git apply <file>.patch`. An unreadable repo can't be saved; it's deleted only on explicit confirmation and noted as such.
  67. - **Every deletion is logged** to `~/.claude/cc-sessions.log` (JSON lines): when, what, title, size, rescued files. `cc-sessions log` shows it.
  68. - `kill` refuses the session you run it from and anything that isn't a Claude process. "Kill leftovers" only targets orphaned tool shells, never a background session.
  69. - Scratch-only deletes keep transcripts, so `claude --resume` still works.
  70. ## Develop
  71. ```bash
  72. python3 -m unittest -v # unit tests (git is exercised for real, not mocked)
  73. python3 tools/drive_tty.py steps.json -- ./cc_sessions.py # drive the arrow-key UI through a real pty
  74. ```
  75. Env overrides: `CLAUDE_CONFIG_DIR` (default `~/.claude`), `CC_SESSIONS_SCRATCH` (scratch root), `NO_COLOR`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.