claude-top
Find out which Claude Code session is eating your Mac.
Activity Monitor knows about processes. It has never heard of a session.
What it is
When you are running a dozen Claude Code sessions the unit of work is a session, not a process, and nothing on the machine reports at that level. You can see that something is holding 291% CPU. You cannot see that it is one session running nine test workers, or that a worktree you walked away from yesterday still has a watcher and two containers alive.
claude-top reports per session: CPU, memory, how many processes and how many containers. Then it separates what is still attached to a live session from what is not.
How it attributes
Claude Code already stamps every process it spawns with a socket path naming the session that owns it. On macOS the environment of any same-uid process is readable, so reading that stamp is a lookup rather than a guess, and it survives both reparenting and the session dying.
Four tiers, first hit wins:
- The environment stamp — exact, and survives the session that set it.
- The process tree — walked up to a stamped ancestor.
- The worktree path — which checkout the process is working in.
- Container labels — Docker Compose and Testcontainers.
Two decisions worth knowing
Getting it
It is open source under MIT, with no third-party dependencies. It builds from a terminal with swift build, and every file is reviewable in git. There is a terminal binary and a SwiftUI menu bar app. macOS 14 or newer; docker and claude on your PATH are optional, and without them the matching tiers report nothing rather than failing.