Repository navigation
feat(sessions): resume a recent Claude Code session or start one in a repo - #234
Open
adefreitas wants to merge 2 commits into
Open
adefreitas wants to merge 2 commits into
adefreitas wants to merge 2 commits into
Conversation
…erminal RecentSessions lists the newest transcripts under ~/.claude/projects, reading only the head and tail of each so a hundred-megabyte transcript costs two chunks. It skips sessions that are already running, subagent transcripts and folders that no longer exist. SessionLauncher opens a command in a new window in a folder: Ghostty through its AppleScript API (no "allow to execute" prompt), Terminal or iTerm. The terminal comes from STACKNUDGE_SESSION_TERMINAL, else Ghostty when installed, else Terminal.app. Nothing calls it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two keys on the Sessions page, each opening a native menu at the panel's top-left so it is driven with the arrows and ⏎ like the rest of the panel: - O lists the 15 newest sessions that aren't running and resumes the picked one with `claude --resume` in its own folder. - T starts `claude` in a repo: the git checkouts under STACKNUDGE_CHECKOUTS_ROOT, or with that unset, the folders of recent sessions. The root has no default. The keys follow the keyboard rules in AGENTS.md: neither is bound on Sessions already and the page has no text field, so single letters are fine. Routing is a pure function (sessionLaunchKeyAction) that takes the NSEvent, so modifiers pass through and a held key acts once. The footer lists both. Co-Authored-By: Claude Opus 5.5 <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.
Summary
Starting a Claude Code session today means finding a terminal and typing
cdandclaude. This adds two keys to the Sessions tab:oresumes a recent session andtstarts a new one in a repo, each in a new terminal window.Changes
RecentSessionslists the 15 newest transcripts under~/.claude/projects, reading only the head and tail of each file. It skips sessions that are running, subagent transcripts and folders that no longer exist.SessionLauncheropens a command in a new window: Ghostty through its AppleScript API (no "allow to execute" prompt), Terminal or iTerm.STACKNUDGE_SESSION_TERMINALpicks one; unset, it is Ghostty when installed, else Terminal.app. A Ghostty without the scripting API falls back to Terminal.oopens a menu of recent sessions (project and title) and resumes the pick withclaude --resume.topens a menu of repos: the git checkouts directly underSTACKNUDGE_CHECKOUTS_ROOT, or with that unset, the folders of recent sessions. The root has no default.sessionLaunchKeyAction(for:): plain keys only (so⌘Tstays with the app) and a held key acts once. The menus are nativeNSMenus, driven with↑ ↓and⏎;Esccloses the menu. The footer lists both keys.notify.conf.example: both settings, commented out.RecentSessionsTests(title selection, clipping, skipped transcripts),SessionLauncherTests(quoting, repo discovery, terminal choice),SessionLaunchKeyTests(key table, modifiers, repeat).Testing
Automated:
./build.sh(no new warnings),make test-without-xcode(1483 tests, 0 failures),make typecheck-tests.Manual, after
make reload, with at least one Claude Code transcript on disk that isn't running:⌘2). The footer shows Resume…Oand New…T.o. A menu titled "Resume a session" opens at the panel's top-left. Press↓then⏎. The panel hides and a terminal opens in that session's folder runningclaude --resume <id>.Escwhile the menu is open. The menu closes and the panel stays.twithSTACKNUDGE_CHECKOUTS_ROOTunset. The menu lists the folders of recent sessions. Pick one: a terminal opens there runningclaude.STACKNUDGE_CHECKOUTS_ROOT=~/some-dir-of-reposin~/.stack-nudge/config, presst. Only the git repos directly under it are listed.STACKNUDGE_SESSION_TERMINAL=iterm(thenterminal), repeat step 2. The window opens in that app.o. One menu opens, not a stack of them.Related issues
None.
🤖 Generated with Claude Code