claude-code - 💡(How to fix) Fix --continue crashes with "g9H is not a function" on 2.1.120 (macOS arm64) [1 comments, 2 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#53119Fetched 2026-04-26 05:23:55
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

In version 2.1.120, running claude --continue immediately throws an unhandled error and the CLI exits. Running claude without --continue works fine. 2.1.119 does not have this issue. The error reproduces deterministically.

Error Message

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

 /$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:76926)
 - fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
 - async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18808:11089)

Root Cause

Because enabled is false, FXK returns an object whose onSessionRestored is undefined. But shortly afterwards there is an unconditional call:

Fix Action

Workaround

Roll back to 2.1.119:

ln -sfn ~/.local/share/claude/versions/2.1.119 ~/.local/bin/claude

Code Example

claude --continue --dangerously-skip-permissions

---

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

 /$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:76926)
 - fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
 - async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18808:11089)

---

let S = s_.useMemo(() => !1, []);
...
let { onBeforeQuery: F9H, onTurnComplete: ZLH, onSessionRestored: g9H,
      render: aM_, ownsInput: LLH } = FXK({ enabled: S, ... });

---

s_.useEffect(() => {
  if (K && K.length > 0) {
    HP_(K, K8());
    hY8({ abortController: new AbortController, taskRegistry: YH });
    tC8(K);
    UQ(K);
    sYH.current.current = xz_(K, g8);
    g9H(K);   // <-- crashes when initialMessages is non-empty and enabled=false
  }
}, []);

---

ln -sfn ~/.local/share/claude/versions/2.1.119 ~/.local/bin/claude
RAW_BUFFERClick to expand / collapse

Summary

In version 2.1.120, running claude --continue immediately throws an unhandled error and the CLI exits. Running claude without --continue works fine. 2.1.119 does not have this issue. The error reproduces deterministically.

Environment

  • Claude Code: 2.1.120 (auto-updated 2026-04-25, install via the Bun-bundled binary at ~/.local/share/claude/versions/2.1.120)
  • macOS: 26.2 (build 25C56), Apple Silicon (arm64)
  • Shell: zsh
  • Plugins enabled in settings.json: clangd-lsp@claude-plugins-official
  • skipDangerousModePermissionPrompt: true

Steps to reproduce

  1. Have at least one previous session in the current project (so there is something to continue).
  2. Run:
    claude --continue --dangerously-skip-permissions
  3. Crash before any UI is rendered.

Error

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

 /$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:76926)
 - fT (/$bunfs/root/src/entrypoints/cli.js:492:76827)
 - async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18808:11089)

Likely cause (from reading the minified source)

In Ub8 (REPL component), the FXK hook is called with enabled: S, where S is hardcoded:

let S = s_.useMemo(() => !1, []);
...
let { onBeforeQuery: F9H, onTurnComplete: ZLH, onSessionRestored: g9H,
      render: aM_, ownsInput: LLH } = FXK({ enabled: S, ... });

Because enabled is false, FXK returns an object whose onSessionRestored is undefined. But shortly afterwards there is an unconditional call:

s_.useEffect(() => {
  if (K && K.length > 0) {
    HP_(K, K8());
    hY8({ abortController: new AbortController, taskRegistry: YH });
    tC8(K);
    UQ(K);
    sYH.current.current = xz_(K, g8);
    g9H(K);   // <-- crashes when initialMessages is non-empty and enabled=false
  }
}, []);

K is initialMessages, which is non-empty exactly when --continue (or --resume) loaded a prior session. So any user with a prior session hits this on --continue.

Suggested fix: guard the call (g9H?.(K)), or only attach the effect when enabled.

Workaround

Roll back to 2.1.119:

ln -sfn ~/.local/share/claude/versions/2.1.119 ~/.local/bin/claude

extent analysis

TL;DR

The issue can be fixed by guarding the call to g9H or only attaching the effect when enabled is true, but a simpler workaround is to roll back to version 2.1.119.

Guidance

  • The error occurs because g9H is undefined when enabled is false, which happens when using --continue with a prior session.
  • To verify the issue, run claude --continue and check if it crashes before rendering the UI.
  • A potential fix is to change the line g9H(K); to g9H?.(K); to guard against calling an undefined function.
  • Another possible solution is to only attach the effect when enabled is true, by moving the useEffect hook inside a conditional statement that checks the value of enabled.

Example

s_.useEffect(() => {
  if (enabled && K && K.length > 0) {
    HP_(K, K8());
    hY8({ abortController: new AbortController, taskRegistry: YH });
    tC8(K);
    UQ(K);
    sYH.current.current = xz_(K, g8);
    g9H(K);
  }
}, [enabled, K]);

Notes

  • The suggested fix is based on the analysis of the minified source code and may not be the only possible solution.
  • Rolling back to version 2.1.119 is a simpler workaround, but it may not be a long-term solution.

Recommendation

Apply the workaround by rolling back to version 2.1.119, as it is a simpler and more straightforward solution that does not require modifying the code.

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