Skip to content

Render /sessions output from the model's judgment JSON - #263

Merged
haacked merged 2 commits into
mainfrom
haacked/sessions-output-redesign
Oct 28, 2026
Merged

haacked merged 2 commits into
mainfrom
haacked/sessions-output-redesign

Conversation

@haacked

@haacked haacked commented Oct 28, 2026

Copy link
Copy Markdown
Owner

The /sessions output was hard to scan. The model laid out one markdown table by hand from rules in SKILL.md. Group headers were rows with no counts, the wide PR cell wrapped before the next step did, and eight near-identical review rows buried the real decisions. The PR cell also dropped the repo, idle age didn't show, and a working session moved into "Claude can continue" because its child belonged there.

Now the model only writes its judgment as JSON, one {name, bucket, step, parent, inferred, item} object per session. claude-sessions --render <facts> <judgment> [offline count] combines that with the saved --json facts and prints the markdown, so the layout no longer depends on the model following rules. The output starts with a count line. Buckets that need action list each session with its step first, then name, a repo-qualified PR link with approvers and commenters, and idle age. Held, Working, Done, and Stale shrink to one line each. Sessions in a bucket with the same step print as one line. Each session stays in its own bucket and shows the session it waits on, instead of moving into its parent's group. The renderer rejects an unknown bucket, a name missing from the facts, or a repeated name, and the skill tells the model to fix the judgment and run it again.

Test plan

  • bin/lib/test-claude-sessions.sh passes, including render tests that compare the full markdown output
  • Rendered real claude-sessions --json output with a hand-written judgment covering a chain, an inferred edge, a collapsed group, an approved PR with commenters, and an empty group
  • Parsed that output with a CommonMark parser to check lists, nesting, and links
  • Run /sessions and check the output in the terminal

https://claude.ai/code/session_01WXojGF5XryMvBSWW1dGnK1

@haacked
haacked marked this pull request as ready for review October 28, 2026 20:11
`claude-sessions --render` prints a count line, list sections for Needs
you, Claude can continue, and Waiting on something outside, and one-line
sections for Held, Working, Done, and Stale. A list item shows the step,
the session, a repo-qualified PR link with approvers and commenters, and
idle time. A session stays in its own bucket with a "waits on" note naming
its parent, and the sessions that more sessions wait on come first. Lone
sessions that share a step collapse to one item.

judge() in claude-sessions.jq returns each session's bucket, step, and
parent, and render() formats them.
`claude-sessions --plan` sets the sidebar tint to #8E8E93 for each Supacode
worktree whose session's PR merged, and clears that gray from the worktree
of a session whose PR is open. A tint the user chose stays. A session's
Supacode worktree counts only when its git worktree is the tab's worktree.
A tint that fails does not fail the plan.
@haacked
haacked force-pushed the haacked/sessions-output-redesign branch from faa4885 to 8c08e4e Compare October 28, 2026 21:40
@haacked
haacked merged commit 4923b4d into main Oct 28, 2026
1 check passed
@haacked
haacked deleted the haacked/sessions-output-redesign branch October 28, 2026 21:41
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