feat(cli): wire --resume / --continue / --fork-session to resume sessions#153
Merged
Conversation
…ions
These flags were parsed but ignored — the REPL always started fresh. Wire them
through startRepl → a new resolveSession():
- --resume <id> / -r <id> resume that session, seeding its stored history
- --resume / -r (no id) interactive picker over recent sessions
- --continue / -c resume the most-recently-updated session in this cwd
- --fork-session resume into a NEW session seeded with a copy of the
source history, leaving the original intact
Unknown id / no-session-in-cwd fall back to a fresh session with a notice.
-r and -c short aliases added for Claude Code parity.
resolveSession is pure over a SessionManager (6 unit tests: fresh / resume-by-id
/ continue-most-recent-in-cwd / continue-none / fork / unknown-id). Smoke-tested
end-to-end against a throwaway HOME for all three flags. Full CLI suite: 124 pass.
Flips the --resume/--continue/--fork-session row in BEHAVIOR_PARITY 🔄 → ✅.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
The
--resume/--continue/--fork-sessionflags were parsed but ignored — the REPL always started a fresh session (🔄 "parsed only" inBEHAVIOR_PARITY.md). This wires them throughstartRepl→ a newresolveSession():--resume <id>/-r <id>— resume that session, seeding its stored history into the agent context.--resume/-r(no id) — interactive picker listing recent sessions (most-recent-first).--continue/-c— resume the most-recently-updated session in the current cwd.--fork-session— resume into a new session seeded with a copy of the source history, leaving the original intact.Unknown id / no-session-in-cwd fall back to a fresh session with a notice.
-r/-cshort aliases added for Claude Code parity.Tests
repl-resume.test.ts— 6 cases overresolveSession(fresh · resume-by-id · continue-most-recent-in-cwd · continue-none · fork-copies-and-preserves-source · unknown-id-fallback), pure over aSessionManagerrooted at a temp dir.$HOME:--continueresumed the newest in cwd; the picker listed + resumed the chosen session (validates the dual-readline);--fork-sessioncreated a new id (session count 2→3) leaving the source intact.Flips the
--resume/--continue/--fork-sessionrow inBEHAVIOR_PARITY.md🔄 → ✅.Follow-up (not in scope)
/resumemid-session switching (still list-only).🤖 Generated with Claude Code