seshka
Kill what Claude Code left behind.
Claude Code sessions end. The dev servers, watchers and emulators they started don't.
seshka is a free macOS menu bar app, and a command on Linux, that finds them and kills them.

Download for macOS · Linux · Documentation · Questions and answers
Install
Download the disk image, open it and drag Seshka to Applications. It needs macOS 14 or later, on Apple silicon or Intel.
The app is signed and notarized, and keeps itself up to date: it downloads a new version in the background, tells you
with a notification and a red dot on its icon, and installs it when you click Restart now or the next time it quits.
The doll in the menu bar is open while something is left behind, and closed when your Mac is clean. The first time it
runs, a short tour shows where it lives and what each tab does.
On Linux it is one line: see Linux.
What it does
Leftover processes
- Finds every process started by a Claude Code session that has since closed, and groups them by session, with their
ports, memory and age. A session that worked in several git worktrees gets a group for each.
- Catches browsers left open by Playwright and other automation, each as one row, and what lost its parent on the way:
a script that detached itself, an ssh tunnel, a
tail -f.
- Does the same for Codex: what a closed Codex session left running is listed next to Claude Code's, under its own
heading.
- Kills one process, one session's worth, or all of them, and tells you how much memory came back.
- Skips what you protect. A process whose command contains one of your protected words is never killed in bulk.
Open sessions
- Shows every open session, Claude Code's and Codex's: whether it is working or idle, for how long, and what it has
running.
- Tells Claude Code or Codex inside an app from a session in your terminal. A conversation an app holds (the Build
tab in JigJoy, say) is listed under the app's name and comes back there, not in a terminal. An agent the app runs
for itself keeps no conversation, so it is never ended for waiting and has no way back.
- Ends idle sessions in one click, or on its own once they have waited longer than you allow (two hours unless you
change it; off until you turn it on).
- Brings back a session it ended. Each one stays listed with a Resume button that opens a terminal in its folder with
claude --resume or codex resume running.
Disk
- Shows what sessions left on disk and removes it when you click: the worktrees Claude Code made for its agents, the
scratch files of closed sessions, and caches that fill up again by themselves (Gradle, pnpm, Yarn, Homebrew downloads
and others). Only caches a tool refills on its own are offered, so clearing one never leaves something broken.
Lid closed
- Keeps the Mac awake with its lid closed while a session is working, and lets it sleep when the last one finishes.
Off until you turn it on.
History
- Lists what it killed in the last 14 days and why: you clicked, a session sat idle past your limit, or a session ended
and its leftovers went with it. Each entry names the process, its port and the session it belonged to, and is marked
AUTO when seshka acted on its own.
The week in numbers
- Keeps count of what it cleaned up over the last week and makes a picture of it to share: memory freed, processes
killed, sessions ended, disk cleaned. Only the numbers are on it.
Linux
curl -fsSL https://seshka.dev/install.sh | sh
That puts one file, seshka, in ~/.local/bin. It is complete in itself: nothing else is installed, and it runs on
any distribution, on x86-64 and arm64. Run the same line again to update it.
There is no menu bar on a server, so on Linux seshka is a command:
seshka what closed sessions left running, and the sessions that are open
seshka clean kill what was left running, except protected processes
seshka clean --here only what was left in this folder
seshka kill <pid> kill one process
seshka end <pid> end an open session; `seshka ended` gives the command that resumes it
seshka recap what seshka cleaned up in the last week: memory, processes, sessions, disk
seshka disk worktrees, scratch files and caches that sessions left on disk
seshka protect <word> never kill in bulk a process whose command has this word
What the Mac app does by itself while it sits in the menu bar, seshka watch does as a service. To have it clean
up on its own, with nothing else to set up:
seshka service install --clean-leftovers 10 --end-idle 120
Each switch is off unless you name it: