claude-code - 💡(How to fix) Fix 2.1.120 regression: claude --resume / --continue crash with "g9H is not a function" [6 comments, 7 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53086Fetched 2026-04-25 06:12:43
View on GitHub
Comments
6
Participants
7
Timeline
23
Reactions
18
Author
Timeline (top)
cross-referenced ×7commented ×6labeled ×6subscribed ×4

claude --resume <session-id> and claude --continue crash immediately on 2.1.120 with a JS runtime error. The interactive workaround (claude --new, then /resume <session-id> from the REPL) works fine. Both --resume and --continue worked correctly on 2.1.119.

Error Message

claude --resume <session-id> and claude --continue crash immediately on 2.1.120 with a JS runtime error. The interactive workaround (claude --new, then /resume <session-id> from the REPL) works fine. Both --resume and --continue worked correctly on 2.1.119.

Error output

ERROR g9H is not a function. (In 'g9H(K)', 'g9H' is undefined)

Root Cause

The two paths diverge because:

  • claude --resume / --continue → REPL mounts with K = [prior session messages] → effect fires → crash
  • claude --new → REPL mounts with K = [] → effect is skipped → /resume uses a different internal function that doesn't reference g9H

Fix Action

Workaround

Either:

  • Roll back the symlink: ln -sfn ~/.local/share/claude/versions/2.1.119 ~/.local/bin/claude
  • Or use claude --new and then type /resume <session-id> from inside the REPL (this takes a different code path that doesn't hit the bug)

Code Example

ERROR  g9H is not a function. (In 'g9H(K)', 'g9H' is undefined)

/$bunfs/root/src/entrypoints/cli.js:9251:5663

---

let { onSessionRestored: g9H, ... } = FXK({ enabled: S, ... })
// S = useMemo(() => false, [])  — always false

---

useEffect(() => {
  if (K && K.length > 0) {
    ..., g9H(K)   // 💥 crashes when undefined
  }
}, [])
RAW_BUFFERClick to expand / collapse

Summary

claude --resume <session-id> and claude --continue crash immediately on 2.1.120 with a JS runtime error. The interactive workaround (claude --new, then /resume <session-id> from the REPL) works fine. Both --resume and --continue worked correctly on 2.1.119.

Repro steps

  1. Have at least one prior session in ~/.claude/projects/.
  2. From a shell: claude --resume <session-id>
  3. Observe the crash. claude --continue crashes the same way.

Error output

ERROR  g9H is not a function. (In 'g9H(K)', 'g9H' is undefined)

/$bunfs/root/src/entrypoints/cli.js:9251:5663

(Full stack trace shows repeated calls through pj / fT callbacks in line 492 before reaching the crash site at line 9251.)

Environment

  • Platform: macOS (arm64)
  • Install method: native auto-updater (~/.local/share/claude/versions/)
  • Version that broke: 2.1.120 (auto-installed 2026-04-24)
  • Last working version: 2.1.119 (confirmed working after rolling back)
  • Shell: fish (via zsh login shell), also zsh and bash

Version timeline

VersionInstalledStatus
2.1.1182026-04-22Working
2.1.1192026-04-23Working
2.1.1202026-04-24 15:53Broken

Workaround

Either:

  • Roll back the symlink: ln -sfn ~/.local/share/claude/versions/2.1.119 ~/.local/bin/claude
  • Or use claude --new and then type /resume <session-id> from inside the REPL (this takes a different code path that doesn't hit the bug)

Analysis (from reading obfuscated source — not verified against real source)

The REPL component at cli.js:9251 destructures an onSessionRestored callback from a hook that appears to be gated by a feature flag:

let { onSessionRestored: g9H, ... } = FXK({ enabled: S, ... })
// S = useMemo(() => false, [])  — always false

When enabled is false, the hook returns no onSessionRestored, so g9H is undefined. A useEffect on REPL mount then calls g9H(K) unconditionally when K (the initial messages array) is non-empty:

useEffect(() => {
  if (K && K.length > 0) {
    ..., g9H(K)   // 💥 crashes when undefined
  }
}, [])

The two paths diverge because:

  • claude --resume / --continue → REPL mounts with K = [prior session messages] → effect fires → crash
  • claude --new → REPL mounts with K = [] → effect is skipped → /resume uses a different internal function that doesn't reference g9H

The fix would be g9H?.(K) instead of g9H(K), or ensuring the hook always returns a safe no-op for onSessionRestored even when disabled.

extent analysis

TL;DR

The most likely fix is to modify the useEffect hook to conditionally call g9H(K) only when g9H is defined.

Guidance

  • The issue is caused by the g9H function being undefined when the enabled flag is false, leading to a crash when g9H(K) is called.
  • To verify the issue, check the value of g9H before calling it, and ensure that the onSessionRestored callback is properly defined.
  • A potential workaround is to use the interactive REPL approach (claude --new and then /resume <session-id>) which takes a different code path that doesn't hit the bug.
  • To mitigate the issue, consider adding a null check for g9H before calling it, such as g9H?.(K).

Example

useEffect(() => {
  if (K && K.length > 0 && g9H) {
    ..., g9H(K)
  }
}, [K, g9H])

Alternatively, ensure the hook always returns a safe no-op for onSessionRestored even when disabled:

let { onSessionRestored: g9H = () => {} } = FXK({ enabled: S, ... })

Notes

The provided analysis is based on reading obfuscated source code and may not be entirely accurate. The actual fix may require verifying the issue against the real source code.

Recommendation

Apply the workaround by using the interactive REPL approach (claude --new and then /resume <session-id>) until a fixed version is available. This approach takes a different code path that doesn't hit the bug, providing a safe alternative until the issue is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING