Claude Code in the notch: dedupe the transcripts, ask the CLI for usage

Claude Code in a terminal is one of the main things Super Notch puts in the notch. That means getting two things right: which sessions are real, and how much of the Claude limit is left.

Both broke first. Here's what each one taught me.

A new transcript isn't a new session

Super Notch finds a Claude Code session from the claude process and the folder it started in. It matches that to the transcript Claude Code keeps under ~/.claude/projects.

Short-lived Claude batch jobs write a new transcript every run. Discovery treated every transcript touched in the last ~20 minutes as a live session.

That burned the discovery limit and flooded the notch with dozens of repeated ghost64 cards.

Release 0.3.9, PR #98, collapses recent batch transcript cards by exact workspace path, before the live scan limit and again on history merge. Distinct live processes, paths, host sessions, and subagents stay separate. The September 28 Journal entry covers that release and the four around it.

Later, PR #111 ordered cards by the latest conversation update. Scanning open processes and windows no longer makes an idle session look newer than a real reply.

Working means you spoke last

A card shows the project, the recent messages, and working or idle. That's all it reports.

A session counts as working when the last thing in the transcript is a message from you, no more than 75 seconds old, with no reply yet. Once the agent answers and sits at the prompt, the card goes back to idle.

Super Notch doesn't watch Claude Code's permission prompts. I still answer those in the terminal.

A click follows the process to its terminal

Click a Claude Code card and Super Notch walks from the claude process up to the app that hosts it. A session in iTerm2 brings iTerm2 forward, and one in Ghostty brings Ghostty forward. That needs the macOS Accessibility permission.

Reopening a closed card opens the macOS Terminal app and runs claude --resume with that session's ID. With no ID, it runs claude --continue in the project folder. New launches always use Terminal.

The Claude Code integration page has the setup side.

The usage meter used to read the login

Release 0.3.6 taught Claude usage to read an available CLI Keychain session without prompting. So to get one number, Super Notch was reading Claude's sign-in.

PR #114 took that out. Claude usage and the signed-in check now go through the installed Claude CLI. Super Notch no longer reads Claude Keychain items or calls the usage endpoint with a copied token.

Now it runs claude auth status --json. If you're signed in with a Claude.ai account, it runs Claude Code's own /usage in safe mode, which turns off hooks, plugins, and MCP servers and sends no prompt to a model.

That check runs in its own scratch folder, ~/.supernotch/claude-usage-probe. Super Notch hides the folder from session cards, so the probe never shows up as a session.

Login and Retry mean different things

Only an explicit signed-out result from the CLI shows Login. Signed in with no usage numbers shows Retry.

I learned that one on Grok first. In September the Grok row stuck on Retry after a successful credits payload that just didn't include a percent. I wrote up how the Grok usage row stopped inventing a bar, and Claude follows the same rule now. A button should only show up when pressing it can help.

The meter itself shows the 5-hour and weekly windows. Compact is the default, and PRs #123 and #124 added optional side-by-side rows labeled 5h and Wk. A window Claude doesn't report is left out.

What I'd tell myself

When a tool already owns sign-in, let it keep owning it and read what it prints.

When a tool writes a transcript per run, group the transcripts by workspace before you count sessions.

Claude Code still does the coding. Super Notch finds and resumes Claude Code, Codex, and Cursor sessions from the MacBook notch.

All ship logs