Skip to content

fix: detect Claude Code panes using version-string command#14

Merged
corwinm merged 2 commits into
mainfrom
fix/claude-version-command-detection
Jul 17, 2026
Merged

fix: detect Claude Code panes using version-string command#14
corwinm merged 2 commits into
mainfrom
fix/claude-version-command-detection

Conversation

@corwinm

@corwinm corwinm commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Problem

Claude Code panes stopped showing up in the tmux status output. The hooks were still writing state files correctly, but the pane detector no longer recognized the panes as agents, so they were filtered out.

Recent Claude Code releases changed both signals detectAgentPane relied on:

signal old new
pane_current_command claude version string, e.g. 2.1.206
pane_title Claude Code task summary with a status-glyph prefix, e.g. ✳ Set up AWS deployment

Neither matchesCommand(command, "claude") nor the claude/claude code title hint matched, so claudeReasons stayed empty and the pane was dropped by the detection.agent !== null filter.

Fix

In src/core/tmux.ts:

  • Add isClaudeVersionCommand() matching an N.N.N command.
  • Add hasLeadingGlyphTitle (title begins with a non-alphanumeric status glyph, as Claude's spinner UI does).
  • New detection branch: emit a command:claude-version reason when the command is a version string and the title has a leading glyph. Gating on the glyph avoids misclassifying arbitrary semver-named processes as Claude.

Once a pane is classified as claude, the existing hook-state matching by pane id lights it up immediately — no hook changes needed.

Tests

test/tmux.test.ts:

  • Updated the existing ✳ Claude Code + version-command case.
  • Added the two real-world task-summary cases (✳ …, braille spinner ⠂ …).
  • Added a negative case (node repl + 2.1.206 → not Claude).

Verification

  • npm run typecheck, npm run lint, npm test (120/120) all pass.
  • Confirmed live: coding-agents-tmux list now shows previously-missing Claude Code panes matched to their hook state.

Recent Claude Code releases report the version string (e.g. "2.1.206") as
pane_current_command instead of "claude", and set the pane title to the
current task summary prefixed with a status glyph rather than "Claude Code".
Neither the command nor the title hint matched, so those panes were filtered
out as non-agents even though the hooks were still writing state.

Add a `command:claude-version` detection signal that fires when the command
is a semver-like string and the title has a leading status glyph, corroborating
the two matching so arbitrary semver-named processes are not misclassified.
@corwinm
corwinm force-pushed the fix/claude-version-command-detection branch from c7234d5 to 8dd7b48 Compare July 17, 2026 02:22
@corwinm

corwinm commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8dd7b4846d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/tmux.ts Outdated
Comment on lines +178 to +179
const hasLeadingGlyphTitle =
title.length > 0 && normalizedLowerTitle.length > 0 && normalizedLowerTitle !== lowerTitle;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict leading-glyph matching to Claude status glyphs

This treats any leading non-alphanumeric prefix as a Claude status glyph. In tmux setups that decorate titles with prefixes like [prod] api or # build, a pane running any semver-named command will satisfy this check and then line 199 adds command:claude-version, causing discoverAgentPanesFromList to surface a non-Claude pane as Claude. Restrict this to the known Claude spinner/glyph characters, or require a stronger Claude title hint, to avoid those false positives.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 849cede. Replaced the broad "any leading non-alphanumeric" check with CLAUDE_STATUS_GLYPH_PATTERN, which matches only Claude's actual status glyphs (sparkle/asterisk dingbats U+2720–U+274F, braille spinner frames U+2800–U+28FF, and the idle middle dot). Added negative tests for decorated titles like [prod] api and # build with a semver command to confirm they're no longer surfaced as Claude.

Address PR review: the leading-glyph check treated any non-alphanumeric title
prefix as a Claude status glyph, so decorated titles like "[prod] api" or
"# build" with a semver-named command could be misclassified as Claude.

Match only Claude's actual status glyphs (sparkle/asterisk dingbats
U+2720-U+274F, braille spinner frames U+2800-U+28FF, and the idle middle dot)
via CLAUDE_STATUS_GLYPH_PATTERN, and add negative tests for decorated titles.
@corwinm
corwinm merged commit bc757df into main Jul 17, 2026
1 check passed
@corwinm
corwinm deleted the fix/claude-version-command-detection branch July 17, 2026 17:00
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