Crash on --resume/--continue after branching session history (Esc Esc): g9H is not a function
Bug Description
When resuming a session that has been branched multiple times by going back in time (using Esc Esc to rewind), both --resume and --continue crash with an undefined function error.
Steps to Reproduce
- Start a Claude Code session
- Branch the conversation multiple times by pressing
Esc Escto go back in history - Exit the session
- Attempt to resume with
claude --dangerously-skip-permissions --resumeorclaude --dangerously-skip-permissions --continue
Error Output
ERROR g9H is not a function. (In 'g9H(K)', 'g9H' is undefined)
/$bunfs/root/src/entrypoints/cli.js:9251:5663
Stack Trace
- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)
- WC (/$bunfs/root/src/entrypoints/cli.js:492:63749)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76948)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
Analysis
From the minified source, g9H maps to onSessionRestored — a callback destructured from FXK() (appears to be a plugin/extension hook system). The crash occurs during REPL initialization when the session restore path calls g9H(K) (i.e., onSessionRestored(initialMessages)), but the function is undefined.
The relevant destructuring at the call site:
let {onBeforeQuery: F9H, onTurnComplete: ZLH, onSessionRestored: g9H, render: aM_, ownsInput: LLH} = FXK({enabled: S, ...})
The function is called during the initial useEffect:
s_.useEffect(() => {
if (K && K.length > 0)
HP_(K, K8()), ..., g9H(K) // crashes here
}, []);
It seems like the FXK hook returns undefined for onSessionRestored when the session has a forked/branched history, possibly because the enabled flag (S) evaluates to false for branched sessions and the hook doesn't return a no-op fallback.
Environment
- OS: macOS (Darwin 24.6.0)
- Shell: zsh
- Claude Code version: Latest as of 2026-04-25
- Model: claude-opus-4-6 (1M context)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗