agentleFS
droiddevgeeksdroiddevgeeks/cc-sessions/skills/sessions/SKILL.md

sessions

Skill4 starsChanged 10 days agoMITView on GitHub

Use when the user wants to see, find, resume or clean up Claude Code sessions — "clean up claude sessions", "claude is using too much disk/RAM", "kill old claude processes", "what's in my scratchpad", "find the session where I worked on X", "free up space from ~/.claude or /private/tmp/claude-*", or types /sessions. Covers running processes, transcripts (~/.claude/projects) and per-session scratchpads with cloned repos.

  • Deletes or force-pushes

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tool-rename-deprecation, add-policy and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • gitpod-ioSkill

    tool-rename-deprecation

    Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

    Also in 5 projects that use this

  • OpenCortexIDESkill

    add-policy

    Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

    Also in 4 projects that use this

  • gitpod-ioSkill

    agent-sessions-layout

    Agent Sessions workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agent Sessions workbench layout.

    Also in 3 projects that use this

  • slopusSkill

    control-flow

    Analyze and design control flows and data structures. Produces compact ASCII tree diagrams showing triggers, call chains, payload shapes, state mutations, and re-render effects. Use when user asks to diagram, trace, visualize, or design a flow or data structure.

    Also in 3 projects that use this

  • slopusSkill

    metrics-graphana

    Query and manage Grafana dashboards and Prometheus metrics for Happy infrastructure. Covers grafanactl CLI usage, direct Prometheus queries through Grafana proxy, and dashboard-as-code workflows. Use when user asks about metrics, dashboards, monitoring, Grafana, Prometheus, or wants to add/modify panels.

    Also in 3 projects that use this

  • TheKREATORSSkill

    refactor-clean

    No description

    Also in 3 projects that use this

  • +2 more from gitpod-io

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use cc-sessions if command -v cc-sessions finds it.

    line 12
  2. Very specific:

    If the user wants ccs in their own terminal and it isn't installed: python3 "<base>/../../cc_sessions.py" install-cli writes ccs + …

    line 14
  3. Very specific:

    Use session-id prefixes, not # row numbers: row numbers shift between runs as sizes change.

    line 36
  4. Very specific:

    Run the preview (no --yes).

    line 40
  5. Distinctive:

    Wait for the user to say yes to *that* preview.

    line 41
  6. Very specific:

    Default to scratch only. Add --transcripts only when the user asks about transcripts/history, and say that those sessions can no longer be …

    line 44

“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

sessions

Everything goes through the cc-sessions CLI (alias ccs). It already knows which sessions are live, which scratch clones hold unpushed or unreadable work, and which processes are background sessions vs leftovers. Hand-rolled rm -rf, find -delete, pkill or kill -9 skip those checks, so they are not used here.

Running it

Use cc-sessions if command -v cc-sessions finds it. Otherwise run the copy bundled with this skill: python3 "<base directory of this skill>/../../cc_sessions.py" (the base directory is shown when the skill loads). Below, cc-sessions means whichever of the two works. If neither exists, tell the user and stop — don't improvise deletions.

If the user wants ccs in their own terminal and it isn't installed: python3 "<base>/../../cc_sessions.py" install-cli writes ccs + cc-sessions to ~/.local/bin (ask first; it adds files to their PATH).

Your Bash is not a terminal

The arrow-key menu (ccs with no args) and cc-sessions pick need a real TTY. From the Bash tool, bare cc-sessions prints the plain report and pick refuses. Use the subcommands below. If the user wants to browse or tick sessions with arrow keys themselves, tell them to run ccs in their own terminal.

Quick reference

User wantsRun
Overview of everythingcc-sessions overview
Processes + RAMcc-sessions ps
Disk: transcripts + scratchpads + clone statuscc-sessions disk --all
Find a session by topiccc-sessions ls --all | grep -i '<topic>'
Details + resume commandcc-sessions show <session-id-prefix>
Preview scratch cleanupcc-sessions clean --scratch 3d
Delete what the preview listedsame command + --yes
Old transcripts (loses /resume)cc-sessions clean --transcripts 14d → then --yes
One specific sessioncc-sessions clean --only <sid-prefix> → then --yes
Kill processescc-sessions kill <pid> [pid…]
What was deleted / recover workcc-sessions log

Use session-id prefixes, not # row numbers: row numbers shift between runs as sizes change.

Cleanup recipe

  1. Run the preview (no --yes). Show the user the "Will delete" total and the "Kept" list.
  2. Wait for the user to say yes to that preview. "Just do it" before seeing it still means preview first, then one short confirmation.
  3. Re-run the identical command with --yes. Report the "Freed" line.

Default to scratch only. Add --transcripts only when the user asks about transcripts/history, and say that those sessions can no longer be resumed.

⚠ flagged clones (unpushed / dirty / git error)

These are skipped on purpose. --force deletes them, so it is used only when the user has seen what is inside and said to delete it. To show them:

cd <clone path from `cc-sessions show`> && git log --branches --not --remotes --oneline && git status --short

Offer to push the commits first. "git error" means the repo is unreadable — say so; the user decides.

When deletion does go ahead, cc-sessions first saves unpushed commits / uncommitted changes to ~/.claude/cc-sessions-rescue/ and skips the folder if saving fails. Tell the user where it went. cc-sessions log lists every deletion and its rescued files — use it to answer "what did I delete?" or "can I get X back?" (git clone <file>.bundle restored).

If the deletion isn't in the log, there is no rescue copy: it happened before logging existed, or outside cc-sessions (rm, another tool). Say plainly that local-only work from it is gone unless it was pushed — don't promise recovery the log can't back up.

Live sessions are never deleted, even with --force.

Processes

From cc-sessions ps:

KINDMeaningKill?
orphan-shellLeftover shell from an old tool callSafe
interactiveA session open in a terminal tabOnly if the user names it
backgroundA background session doing user workOnly if the user names it
pty-host "daemon gone · hosts N"Host carrying background session NKill together with N, only if N is being killed
daemon, spareClaude's own runtimeNo

cc-sessions kill refuses this session and non-Claude PIDs. RAM is mostly ~400 MB per open session — the honest fix is often "close tabs you're done with", not killing leftovers.

Finding and resuming a session

cc-sessions ls --all | grep -i <topic>, then cc-sessions show <sid-prefix>; its last line is the exact cd … && claude --resume <id> to give the user. Titles come from the session's title, not a full-text search; if nothing matches, try other words before grepping transcripts.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.