claude-code - 💡(How to fix) Fix `--resume` crashes with "UKH is not a function" when restoring a session with prior messages (2.1.120) [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#53089Fetched 2026-04-25 06:12:39
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
7
Author
Participants
Timeline (top)
labeled ×5cross-referenced ×3commented ×1

Error Message

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 } }, []);

Root Cause

Root cause (from reading the minified bundle)

Fix Action

Workaround

Downgrade to 2.1.119 — verified working.

Code Example

claude --dangerously-skip-permissions --resume

---

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

---

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

---

- <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)

---

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

---

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
  }
}, []);

---

UKH?.(K);
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

The most likely fix is to guard the call to UKH with an optional chaining operator, UKH?.(K);, to prevent the TypeError when UKH is undefined.

Guidance

  • The issue is caused by UKH being undefined when the RW4 function returns an object without the onSessionRestored property.
  • To verify the fix, run the command claude --dangerously-skip-permissions --resume with an existing session that has prior messages and check if the session restores and the REPL opens without crashing.
  • The suggested fix is to add a guard to the call to UKH to prevent the TypeError, or to modify the RW4 function to always return a no-op onSessionRestored callback.
  • An alternative workaround is to downgrade to version 2.1.119, which has been verified to work.

Example

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); // Add the optional chaining operator to guard the call
  }
}, []);

Notes

  • The issue reproduces on every --resume against any existing session, not just specific ones.
  • The --continue and --fork-session commands may also be affected by this issue.

Recommendation

Apply the workaround by downgrading to version 2.1.119, as it has been verified to work and 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