Skip to content

sessions: the swap tooltip reads as Claude Code's swap; it is the whole machine's #156

Description

@grimmerk

The swap chip's tooltip reads swap 16.7GB of 18.0GB · pressure normal — close sessions (save a list first) or quit heavy apps; macOS only clears swap on a restart, and in context — a chip that sits beside ● 23 live, in an app about Claude Code sessions, with advice about closing sessions — it reads as Claude Code is using 16.7 of 18 GB. That is not what either number means, and the misreading happened to the person who asked for the feature (2026-09-08).

What the numbers actually are

Both come from sysctl -n vm.swapusage, which is machine-wide and has no per-process concept at all:

  • used (16.7GB, the figure on the chip) is how much of the swap file currently holds paged-out data from every process on the Mac.
  • total (18.0GB) is the swap file's current size. macOS grows it on demand, so it is not a limit, and it is not physical RAM (32GB on the reference machine).

What Claude Code's actual share was

Per-process swap is measurable — vmmap --summary <pid> reports a SWAPPED column on its TOTAL row — so the real attribution on the same machine, minutes later:

27 claude processes, swap 4.24 GB
machine swap in use 16.46 GB
Claude Code's share 26%
the same processes, resident (ps RSS) 5.43 GB
largest single process 325 MB swapped

So roughly a quarter, against an intuition of nearly all of it. (Summing per-process figures double-counts shared pages, so treat 4.24 GB as an upper bound.)

Proposal

Reword the tooltip so the scope is stated rather than inferred. Something like: swap 16.7GB of the machine's 18.0GB swap file (every app, not just Claude) · pressure normal — …. The chip's own label can stay swap 16.7GB; it is the tooltip that has room to say whose swap it is.

Not proposed: showing Claude Code's share on the chip. One vmmap --summary call was measured at 1.8 seconds; 27 live processes would be about a minute per refresh, which is far past what this chip should cost. The machine-wide figure is the cheap one (sysctl on the same refresh as the process table) and is still the number that says "this machine is in trouble" first — which is why it was added.

Follows #152, which shipped the chip.

🤖 On behalf of @grimmerk — generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions