Skip to content

Add claude-sessions and /sessions to see which sessions need me - #238

Open
haacked wants to merge 1 commit into
mainfrom
haacked/claude-sessions
Open

haacked wants to merge 1 commit into
mainfrom
haacked/claude-sessions

Conversation

@haacked

@haacked haacked commented Oct 8, 2026

Copy link
Copy Markdown
Owner

With 20+ Claude sessions running, nothing shows in one place which ones need me (an open permission prompt or question), which could continue on their own, which wait on CI or a reviewer, which sit on another session's PR, and which are done.

bin/claude-sessions (renamed from supacode-claude-sessions) now lists sessions from claude agents --json, so it covers sessions outside Supacode and background agents too. For each session it shows what an open prompt waits for, the branch and uncommitted file count, the PR status, and, for a stacked PR, the base branch and the session that has it checked out. --json adds the transcript's last prompt and reply. The new /sessions skill reads that output, puts each session in a bucket with a one-line next step, and with --act offers to tell the sessions that can continue to continue, sending only what I confirm.

WAITING comes from the waitingFor field that Claude Code 2.1.292 and later report while a prompt is open ("permission prompt" or "input needed"). I had planned a Notification hook that wrote state files, but the native field already covers permission prompts and AskUserQuestion. Sessions still running 2.1.289 show as busy until they restart.

git pr --json prints the PR as one object (url, number, state, head, base, status) and skips the stack lookups, so the script reads the base branch instead of parsing terminal output. Piped git pr without the flag still prints the bare URL.

Test plan

  • bin/lib/test-claude-sessions.sh and bin/lib/test-git-pr.sh pass
  • A probe session with an open permission prompt and an open AskUserQuestion reported waitingFor "permission prompt" and "input needed"
  • Run claude-sessions and compare the table with the live sessions
  • Run /sessions, then /sessions --act and decline the send

bin/claude-sessions lists every live Claude session and background agent
from `claude agents --json`, with what an open prompt waits for, the git
and PR state of its worktree, and the tail of its transcript. The
/sessions skill groups those sessions by what each one needs next.
`git pr --json` prints the PR as JSON so the script can read its base.

Copilot AI 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.

🟡 Changes recommended

Queue classification, swallowed PR lookup failures, and inaccurate untracked-file counts need correction.

1 open finding
What changed in this PR

Adds a session dashboard to the repository’s Claude tooling, showing which sessions need attention and offering confirmed continuation messages.

Changes:

  • Replaces the Supacode-only listing with claude-sessions and adds /sessions.
  • Adds structured git pr --json output and updates bundled copies.
  • Adds regression tests, CI coverage, and documentation.
File Description
README.md Documents the new command and skill.
bin/​supacode-claude-sessions Removes the Supacode-only command.
bin/​lib/​test-git-pr.sh Tests structured PR output.
bin/​lib/​test-claude-sessions.sh Tests session facts and formatting.
bin/​git-pr Adds JSON output without stack lookups.
bin/​claude-sessions Collects session, transcript, and PR information.
ai/​skills/​wait-for-pr-reviews/​scripts/​git-pr Updates the bundled helper.
ai/​skills/​sessions/​SKILL.md Defines classification and confirmed messaging.
ai/​skills/​address-pr-reviews/​scripts/​git-pr Updates the bundled helper.
ai/​README.md Documents the session test command.
ai/​codex/​excluded-skills.txt Excludes the Claude-specific skill.
.github/​workflows/​test.yml Runs session tests in CI.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment on lines +61 to +63
2. **Needs you**: `waiting` is set, `signing` is `blocked`, the PR status is Changes requested, the PR status is Approved with no Trunk queue state (only the user can merge it), or the last assistant text asks a question that only the user can answer. The next step names the decision, such as "approve the `gh pr merge` prompt" or "choose between the two schemas it proposed".
3. **Claude can continue**: `status` is `idle`, and the last assistant text offers a next step that needs no decision from the user, such as "Next I'll run the tests" or "Want me to push?". A yes or no offer to do work it already described is an offer, not a question. The next step names the offered step briefly.
4. **Waiting on something outside**: the PR status shows a Trunk queue state, Review required, or Not approved, or the last assistant text says that it waits on CI or a reviewer.
@haacked
haacked marked this pull request as ready for review October 8, 2026 01:10
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.

2 participants