`--resume` crashes with "UKH is not a function" when restoring a session with prior messages (2.1.120)

Resolved 💬 4 comments Opened Apr 25, 2026 by junjzhang Closed Apr 27, 2026

Title

--resume crashes with "UKH is not a function" when restoring a session that has prior messages (2.1.120)

Environment

  • Claude Code: 2.1.120 (native bun bundle, installed at ~/.local/share/claude/versions/2.1.120)
  • OS: CachyOS Linux (Arch-based), kernel 7.0.1-1-cachyos, x86_64
  • Shell: zsh
  • Terminal: ghostty (Wayland / niri compositor)
  • Node: not used at runtime — the binary is a self-contained bun build (/$bunfs/root/src/entrypoints/cli.js)

Repro

claude --dangerously-skip-permissions --resume

Pick any existing session that has prior messages from the interactive picker.

Also reproduces with an explicit session id:

claude --dangerously-skip-permissions --resume <session-id>

Expected

Session restores and the REPL opens with the prior transcript.

Actual

Crashes immediately with:

ERROR  UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)
 /$bunfs/root/src/entrypoints/cli.js:9247:5663

Stack trace (top frames):

- <anonymous> (cli.js:9247:5663)
- JR  (cli.js:492:63749)
- Bw  (cli.js:492:76948)
- Xz  (cli.js:492:76827)
- Bw  (cli.js:492:76926)
- Xz  (cli.js:492:76827)
- Bw  (cli.js:492:77745)
- Xz  (cli.js:492:76827)

Root cause (from reading the minified bundle)

In QC6 (the REPL component) the bundle has:

let I = s$.useMemo(() => !1, []);
...
let { onBeforeQuery: FKH,
      onTurnComplete: vvH,
      onSessionRestored: UKH,
      render: sJ$,
      ownsInput: VvH } = RW4({ enabled: I, setMessages: F7, ... });

I is hardcoded to false, so RW4 is always called with enabled: false. When disabled, RW4 short-circuits and returns an object that does not include onSessionRestored — so UKH is undefined.

Later, the initial-message effect calls it unconditionally:

s$.useEffect(() => {
  if (K && K.length > 0) {
    $L$(K, K6());
    yO6({ abortController: new AbortController, taskRegistry: OH });
    eR6(K);
    Bc(K);
    tOH.current.current = u3$(K, U6);
    UKH(K);   // <-- TypeError: UKH is undefined
  }
}, []);

This effect only fires when initial messages are present, which is exactly the resume-with-history path — so a fresh claude (no --resume) is unaffected.

Suggested fix

Either guard the call:

UKH?.(K);

or have RW4 always return a no-op onSessionRestored (consistent with the other returned callbacks). The guard is the safer one-liner since the other destructured fields (FKH, vvH, etc.) are presumably handled the same way.

Workaround

Downgrade to 2.1.119 — verified working.

Notes

  • Reproduces on every --resume against any existing session, not just specific ones.
  • --continue likely hits the same path (same eJ$ resume function, same UKH(K) line).
  • --fork-session does not avoid it: both fork (XFK) and resume (fr$) branches fall through to the same UKH(K) call.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗