Skip to content

fix(tabby): detect idle long-context Claude + warn on outdated CLI#7

Draft
motin wants to merge 1 commit into
mainfrom
fix/tabby-idle-claude-detection
Draft

fix(tabby): detect idle long-context Claude + warn on outdated CLI#7
motin wants to merge 1 commit into
mainfrom
fix/tabby-idle-claude-detection

Conversation

@motin
Copy link
Copy Markdown
Contributor

@motin motin commented May 27, 2026

Summary

  • Detection: add new task? and Checking for updates to the Tabby session-status markers. Idle Claude sessions with high context use only emit those strings on redraw, so the startup banner and permission pill scroll out of the plugin's 256 KB output ring and the detector falsely reports terminal. Verified live against a workspace with ~15 sessions — every previously-misclassified tab (including one at 304.7k tokens) now reports ● active; a real zsh tab still correctly reports terminal.
  • Outdated-CLI visibility: alongside update-notifier's pretty banner, write a plain [cctabs] OUTDATED x.y.z < a.b.c — run: npm install -g ...@latest line to stdout. The library's banner is suppressed in non-TTY contexts, which is every cctabs invocation Claude Code makes via a shell tool — so without this, agent-driven users never see that their CLI is stale.
  • Skill triage: SKILL.md now tells the model to compare the version banner against plugin.json, surface the new OUTDATED line, and call out that the marketplace plugin update path doesn't refresh the npm-installed CLI binary.

Why this matters

A user with cctabs@0.3.0 installed globally was reading v0.4.1 docs from the freshly-updated marketplace plugin and seeing cctabs sessions falsely flag ~15 active Claude tabs as terminal / unknown. The two channels (plugin vs. CLI) drift silently — and even when update-notifier detected the gap, its banner was muted because Claude was capturing the output. The agent therefore had no signal to suggest an upgrade and instead chased a detector bug that the user had already fixed in a later release. The skill triage + stdout warning close that loop.

Test plan

  • On a workspace with multiple long-running Claude sessions (some at high context use, some default-mode, some plan-mode), run cctabs sessions and confirm previously-misclassified terminal/unknown tabs now report ● active. Real shell tabs should still report terminal.
  • npm run typecheck && npm run build — clean.
  • Manually verify the OUTDATED warning fires by running the built binary against a faked older package.json version (or npm install -g @generativereality/cctabs@0.3.0 && cctabs sessions after this release is published) and confirming the [cctabs] OUTDATED ... line appears on stdout in a non-TTY context (e.g. piped through cat).
  • Skim the new SKILL.md section to confirm the prompt phrasing is something the model will reliably act on.

🤖 Generated with Claude Code

…ent-captured output

Three connected fixes for the failure mode where `cctabs sessions` reports
running Claude sessions as 'terminal' (or 'unknown'), most visibly in
long-running tabs sitting on the "new task? /clear to save Nk tokens" prompt:

- src/core/tabby.ts: add `new task?` and `Checking for updates` to the marker
  set. Idle Claude sessions with high context use only emit those two strings
  on redraw, so the startup banner and permission pill scroll out of the
  Tabby plugin's 256KB output ring. Verified live: tabs that previously
  reported `terminal` (incl. one at 304.7k tokens) now correctly show
  `● active`, while a real zsh tab stays `terminal`.

- src/index.ts: when `update-notifier` finds a newer release, also write a
  plain `[cctabs] OUTDATED x.y.z < a.b.c — run: npm install -g ...@latest`
  line to stdout. The library's pretty banner is suppressed in non-TTY
  contexts (i.e. whenever Claude Code runs cctabs via a shell tool), so
  agent-driven users would otherwise never see "your binary is stale" even
  though the check ran.

- skills/cctabs/SKILL.md: add a "Check the installed version isn't stale"
  step instructing the model to compare the version banner against the
  skill's plugin.json and to surface the new OUTDATED line. Calls out that
  the marketplace plugin update path only refreshes the skill — the
  npm-installed CLI binary is a separate channel and must be upgraded
  explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying cctabs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a283135
Status: ✅  Deploy successful!
Preview URL: https://39aad341.cctabs.pages.dev
Branch Preview URL: https://fix-tabby-idle-claude-detect.cctabs.pages.dev

View logs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant