shpool-resume: annotate live sessions + surface closed Claude sessions#34
Open
mecattaf wants to merge 1 commit into
Open
shpool-resume: annotate live sessions + surface closed Claude sessions#34mecattaf wants to merge 1 commit into
mecattaf wants to merge 1 commit into
Conversation
The resume picker (Mod+Ctrl+Shift+Return) previously showed bare session UUIDs from `shpool list`, with no hint of what each one was — and could not show a Claude session whose terminal had been closed, since shpool only tracks live sessions. Now the fzf picker shows two groups: - ● live shpool sessions, annotated with cwd, the program running inside (claude / nvim / shell), an age, and an `*` when already attached. Maps each session to its leader process by matching `shpool list`'s STARTED_AT against process start times, then reads /proc for cwd and walks the process tree for the program. - ○ recently-closed Claude sessions read from $CLAUDE_CONFIG_DIR transcripts (default ~/.claude-main), excluding any whose id is live in a shpool session. Selecting one spawns a fresh shpool session that `claude --resume`s it in the right cwd, wrapped in `bash -lc 'exec …'` so the TUI survives shpool detaches. Tunables: SHPOOL_RESUME_CLOSED_DAYS (3), SHPOOL_RESUME_CLOSED_LIMIT (8). Live attach now uses `-f` so the picker reliably steals a stale client. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Mod+Ctrl+Shift+Returnruns theshpool-resumefzf picker on the desktop. It previously listed bare session UUIDs fromshpool listwith no hint of what each one was running, so they were unidentifiable. Worse, a Claude session whose terminal was closed (or whose laptop rebooted, dropping the ssh attach) vanished from the picker entirely — shpool only tracks live sessions — even though its transcript is fully resumable.This came up recovering a real closed
claudesession today: the picker simply couldn't surface it.What changed
The picker now shows two groups:
claude/nvim/shell), an age, and an*when a client is already attached. Each session is mapped to its leader process by matchingshpool list'sSTARTED_ATagainst process start times, then/proc/<pid>/cwd+ a process-tree walk give cwd and program. Selecting one doesshpool attach -f(force, so a stale client can't leave you with a blank screen).$CLAUDE_CONFIG_DIRtranscripts (default~/.claude-main), excluding any id currently live in a shpool session, shown with directory + opening prompt. Selecting one spawns a fresh shpool session thatclaude --resumes it in the right cwd, wrapped inbash -lc 'exec …'so the TUI survives shpool detaches (runningclaudeas the bare-ccommand exits on detach).Tunables:
SHPOOL_RESUME_CLOSED_DAYS(default 3),SHPOOL_RESUME_CLOSED_LIMIT(default 8).Testing
Ran on harness-desktop with
SHPOOL_RESUME_LIST_ONLY=1(a new debug hook that prints candidate lines instead of launching fzf): live sessions annotate correctly (incl. claude-as-leader recovery sessions and the attached marker), and closed Claude sessions surface with prompts while the currently-live one is correctly hidden.bash -nclean.Deploy:
chezmoi applyon harness-desktop.🤖 Generated with Claude Code