[BUG] claude --resume crashes with "g9H is not a function" (onSessionRestored undefined)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running claude --resume <session-name>, Claude Code crashes immediately with a JavaScript runtime error. The session never loads — the crash happens before any session content is read.
What Should Happen?
The previous session should resume normally and the conversation history should
be restored.
Error Messages/Logs
/$bunfs/root/src/entrypoints/cli.js:9251:5663
- <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: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)
- pj (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18815:2361)
Steps to Reproduce
- Start any Claude Code session and work in it (session gets saved
automatically)
- Exit the session
- Run:
claude --resume <session-name> - Crash occurs immediately — session never loads
Root cause hypothesis :
In the REPL component (Ub8), onSessionRestored is destructured from
FXK({enabled: S, ...})
where S = useMemo(() => !1, []) — hardcoded false.
When enabled=false, FXK appears to return undefined for onSessionRestored (g9H
in minified output).
The --resume path calls g9H(K) unconditionally with no null/undefined guard →
TypeError crash.
Fix: add a null guard before calling onSessionRestored, or ensure FXK always
returns a no-op
function for this callback regardless of the enabled flag.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.119
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
The session data itself appears intact — the crash happens before any session
file is read.
Workaround: none found. claude --resume is completely broken for named
sessions.
Platform: Claude Code CLI (direct)
Operating System: macOS Darwin 25.4.0
Terminal/Shell: iTerm2 / zsh
Last login: Sun Apr 26 12:16:35 on ttys002
You have mail.
[rjavgal@panw:~]$ claude --version
2.1.119 (Claude Code)
[rjavgal@panw:~]$
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗