session-vitals
Keep an eye on long Claude Code sessions: how often they have been compacted, and a
checkpoint that survives compaction and reaches the next session.
🔴 22 137.9MB acme--platform-rewrite
\ 4 duplicate record(s) from resume/fork, not counted
🔴 9 67.4MB acme--reporting-service
🟡 5 82.9MB side-projects
Requirements
Python 3.8+. It is the only dependency, but it is not free:
| Platform | Situation |
|---|
| macOS | /usr/bin/python3 is present; without Xcode Command Line Tools the first run pops an install prompt |
| Linux | Preinstalled on nearly every distribution, usually nothing to do |
| Windows | Not preinstalled, you need to install Python first |
As of 2026 Claude Code ships as a native binary and carries no runtime of its own, so
you cannot assume Node or Python is already on the machine. Run python3 --version
before installing.
Desktop notifications need macOS osascript. Elsewhere they are skipped and everything
else works unchanged. /session-vitals:doctor tells you exactly how far your platform is
supported.
Install
Paste this and let Claude do all of it:
Install session-vitals: run `claude plugin marketplace add vickyhoo/session-vitals`
then `claude plugin install session-vitals@vickyhoo`. Confirm `python3 --version` works,
since that is the only dependency. Then tell me to run /reload-plugins myself, since you
cannot, and afterwards run /session-vitals:doctor and explain what it found.
Or type it yourself. In Claude Code:
/plugin marketplace add vickyhoo/session-vitals
/plugin install session-vitals@vickyhoo
Or in a terminal, which is the same thing without the prompt:
claude plugin marketplace add vickyhoo/session-vitals
claude plugin install session-vitals@vickyhoo
Then run /reload-plugins. Hook configuration is otherwise captured when a session
starts, so the session you installed from runs none of it - no reporting, no
checkpointing, and no error either. That is the single most common way to conclude the
plugin does nothing.
/reload-plugins
/session-vitals:doctor
/reload-plugins applies the hooks to the running session; verified by registering a
hook mid-session and watching it fire immediately afterwards. doctor then says
explicitly whether they are live in the session you are in - trust that line over any
instruction here, including this one.
Staying up to date
Turn on auto-update for the marketplace, because it is off by default for
third-party ones:
/plugin → Marketplaces → vickyhoo → Enable auto-update
Claude Code then refreshes shortly after each session starts and tells you to run
/reload-plugins when something changed. Without it, update manually:
/plugin update session-vitals@vickyhoo
This plugin deliberately does not check for its own updates. It used to, and that was a
weaker copy of a mechanism the platform already has - the platform installs the update,
a self-check can only mention it.
What it does
1. Compaction reporting
When the context window fills up, Claude Code compacts history: thousands of lines of
conversation become roughly ten thousand characters of summary. That is lossy.
session-vitals reports how many times it happened, how tightly, and how much
conversation has been summarized away.
| Compactions | Behavior |
|---|
| 0-2 | Completely silent |
| 3-5 | Points at /session-vitals:checkpoint - save, keep working |
| 6+ | Points at /session-vitals:retire - save, then continue in a fresh session |
The grade decides which of the two commands applies, so the alert names one rather than
offering both. checkpoint writes what has been concluded and the session continues;
retire does the same write and then hands off.
Two signals each escalate one level: a gap under 512KB between compactions, and no
compaction markers found at all in a large transcript, which means Claude Code's format
may have changed and the numbers cannot be trusted.
Two more are reported without escalating: more than 4MB piled up since the last
compaction, which only means the session is busy, and lines that failed to parse, which
are usually records caught mid-flush.
Be clear about what this metric supports:
Known to be true: compaction happens, and each pass condenses a lot of conversation
into a small amount of text. It is genuinely lossy.
Not claimed: that "N compactions make the model hallucinate." That causal link is
unproven. Measurements show summary length does not shrink monotonically with
compaction count, and the same summary gets re-written into the transcript on resume
or fork (in one real session, 4 of 26 records were such duplicates). This tool hashes
summary content to deduplicate and measures gaps in bytes rather than line numbers,
so the number stays as close to reality as it can.