claude-code - 💡(How to fix) Fix UKH is not a function: crash on --resume when onSessionRestored callback is undefined [3 comments, 3 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#53127Fetched 2026-04-26 05:23:42
View on GitHub
Comments
3
Participants
3
Timeline
12
Reactions
1
Timeline (top)
labeled ×4commented ×3cross-referenced ×3mentioned ×1

Running claude --resume <session-id> crashes immediately with a runtime error: UKH is not a function. (In 'UKH(K)', 'UKH' is undefined).

Error Message

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

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

Root Cause

Root Cause (from minified source)

Code Example

claude --resume 49f27d6a-b17a-4d0b-a5e1-3ffa5795061d

---

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

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

---

let{onBeforeQuery:FKH,onTurnComplete:vvH,onSessionRestored:UKH,...}=RW4({...})

---

if(K&&K.length>0)
  $L$(K,K6()),yO6(...),eR6(K),Bc(K),
  tOH.current.current=u3$(K,U6),
  UKH(K)   // <-- crashes when UKH is undefined

---

- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9247:5663)
- JR (/$bunfs/root/src/entrypoints/cli.js:492:63749)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:76948)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18811:2361)
RAW_BUFFERClick to expand / collapse

Description

Running claude --resume <session-id> crashes immediately with a runtime error: UKH is not a function. (In 'UKH(K)', 'UKH' is undefined).

Steps to Reproduce

claude --resume 49f27d6a-b17a-4d0b-a5e1-3ffa5795061d

Error

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

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

Root Cause (from minified source)

In the resume callback eJ$, UKH is the onSessionRestored destructured from RW4():

let{onBeforeQuery:FKH,onTurnComplete:vvH,onSessionRestored:UKH,...}=RW4({...})

Later, it is called unconditionally:

if(K&&K.length>0)
  $L$(K,K6()),yO6(...),eR6(K),Bc(K),
  tOH.current.current=u3$(K,U6),
  UKH(K)   // <-- crashes when UKH is undefined

UKH should be guarded: UKH?.(K) or if(UKH) UKH(K).

Stack Trace

- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9247:5663)
- JR (/$bunfs/root/src/entrypoints/cli.js:492:63749)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:76948)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:76926)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- Bw (/$bunfs/root/src/entrypoints/cli.js:492:77745)
- Xz (/$bunfs/root/src/entrypoints/cli.js:492:76827)
- async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18811:2361)

Environment

  • Claude Code version: 2.1.119
  • Platform: Linux (Ubuntu)
  • Node: n/a (Bun runtime via /$bunfs)

extent analysis

TL;DR

The issue can be fixed by adding a null check for the UKH function before calling it.

Guidance

  • The error occurs because UKH is undefined when the onSessionRestored property is not returned from RW4().
  • To fix this, add a null check for UKH before calling it, e.g., UKH?.(K) or if (UKH) UKH(K).
  • Verify the fix by running claude --resume <session-id> again and checking for the absence of the runtime error.
  • If the issue persists, investigate why RW4() is not returning the onSessionRestored property.

Example

if (K && K.length > 0) {
  $L$(K, K6()), yO6(...), eR6(K), Bc(K),
  tOH.current.current = u3$(K, U6),
  UKH?.(K) // Add null check
}

Notes

The provided stack trace and code snippet suggest that the issue is specific to the claude command and the RW4() function. Without more information about the RW4() function, it's difficult to provide a more detailed solution.

Recommendation

Apply the workaround by adding a null check for UKH to prevent the runtime error. This fix should resolve the immediate issue, but further investigation may be needed to determine why RW4() is not returning the onSessionRestored property.

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