[BUG]

Resolved 💬 2 comments Opened Apr 25, 2026 by inspicere Closed Apr 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Sessions created on Claude Code ≤2.1.97 cannot be resumed on 2.1.120. The resume fails immediately with two errors:

  1. A JavaScript crash: UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)
  2. A subsequent (misleading) sandbox error: Error: sandbox required but unavailable

The sandbox error is a red herring — it fires as a side effect of the component crash. The root cause is UKH (which corresponds to onSessionRestored from the RW4 hook) being undefined during the resume flow.

Starting a new session works fine. Resuming the same session ID using the 2.1.97 binary directly also works fine.

Environment Info

  • Platform: Linux (Debian)
  • Version: 2.1.120 (regression introduced somewhere between 2.1.97 and 2.1.120)
  • Session created on: 2.1.97
  • Resume attempted on: 2.1.120

What Should Happen?

Sessions should be resumable across minor version updates. At minimum, the error output should surface the actual crash (UKH is not a function) rather than the misleading sandbox error, which sent me down the wrong troubleshooting path.

Error Messages/Logs

## Error Output


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

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

Error: sandbox required but unavailable: ${j$}
  sandbox.failIfUnavailable is set — refusing to start without a working sandbox.

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

Raw output:
claude --resume 351fd65f-612c-45d5-9e40-222e35925f00

/ ERROR  UKH is not a function.a(In 'UKH(K)',l'UKH' is undefined)
/clear                  Clear conversation history and free up context
//$bunfs/root/src/entrypoints/cli.js:9247:5663tory but keep a summary in context. Optional: /compact [instructions …

 9244: ${K.join(`
 9245:
 9246 `)}`}var $v5,sv4=1000,qv5=300,Kv5=5000;var
 :   FC6=T(()=>{L$();V$();Tp();zb();av4();$$();oN();$v5=(NmH(),S6(kmH))});var
     KV4={};X$(KV4,{useScheduledTasks:()=>Av5});function Av5({isLoading:H,assistantMode:$,setMessages:q}){let
     K=QD8.useRef(H);K.current=H;let _=B9(),A=F6(),z=Ww();QD8.useEffect(()=>{if(!TZ()||R6())return;let
     f=(M)=>Ez({value:_v5.resolveLoopDefaultFire(M),mode:"prompt",priority:"later",isMeta:!0,workload:SSH}),Y=void
     0,O=BC6({onFire:f,onFireTask:(M)=>{if(M.agentId){let
     w=dr(M.agentId,_.getState().tasks);if(w&&!sI(w.status)){fmH(w.id,M.prompt,z);return}E(`[ScheduledTasks] teammate
     ${M.agentId} gone, removing orphaned cron ${M.id}`),l$H([M.id]);return}let D=WB7(M.kind==="loop"?`Claude resuming
     /loop wakeup (${qV4(new Date)})`:`Running scheduled task (${qV4(new
     Date)})`);q((w)=>[...w,D]),f(M.prompt)},isLoading:()=>K.current,assistantMode:$,getJitterConfig:t5H,isKilled:()=>!
     TZ(),getExtraTasks:$V4&&Y?()=>$V4.getRoutineCronTasks(Z_(),Y):void 0});return
     O.start(),()=>{O.stop()}},[$,q,_.getState,z])}function qV4(H){return
     H.toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).replace(/,? at |, /,"
     ").replace(/ ([AP]M)/,($,q)=>q.toLowerCase())}var QD8,_v5,$V4=null;var _V4=T(()=>{ES();L$();h6();uT();eI();Yb();C4
     $();FC6();zb();$$();Q3();D6();K_H();QD8=u(JH(),1),_v5=(NmH(),S6(kmH))});var OV4={};X$(OV4,{REPL:()=>QC6});function
      AV4(H){let
     $=dD8.c(14),{showAllInTranscript:q,virtualScroll:K,searchBadge:_,suppressShowAll:A,status:z}=H,f=A===void
     0?!1:A,Y=J1("app:toggleTranscript","Global","ctrl+o"),O=J1("transcript:toggleShowAll","Transcript","ctrl+e"),M;if(
     $[0]===Symbol.for("react.memo_cache_sentinel"))M=kc7(),$[0]=M;else M=$[0];let D=M,w=D?`open in ${D}`:"open in
     editor",j;if($[1]===Symbol.for("react.memo_cache_sentinel"))j=A8.createElement(A8.Fragment,null,"Showing detailed
     transcript"),$[1]=j;else j=$[1];let X;if($[2]!==Y)X=A8.createElement(A8.Fragment,null,Y," to
     toggle"),$[2]=Y,$[3]=X;else X=$[3];let J=_?"n/N to navigate":K?`${_$.arrowUp}${_$.arrowDown} scroll \xB7 [ to
     print output \xB7 v to ${w}`:f?`v to ${w}`:`${O} to ${q?"collapse":"show all"}`,L;if($[4]!==X||$[5]!==J)L=A8.creat
     eElement(V,{dimColor:!0},A8.createElement(t$,null,j,X,J)),$[4]=X,$[5]=J,$[6]=L;else L=$[6];let
     P;if($[7]===Symbol.for("react.memo_cache_sentinel"))P=A8.createElement(p,{flexGrow:1}),$[7]=P;else P=$[7];let
     G;if($[8]!==_||$[9]!==z)G=A8.createElement(Lv5,{status:z,searchBadge:_}),$[8]=_,$[9]=z,$[10]=G;else G=$[10];let
     W;if($[11]!==L||$[12]!==G)W=A8.createElement(p,{noSelect:!0,alignItems:"center",alignSelf:"center",borderTopDimCol
     or:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%"},L,
     P,G),$[11]=L,$[12]=G,$[13]=W;else W=$[13];return W}function Lv5(H){let
     $=dD8.c(6),{status:q,searchBadge:K}=H;if(q){let A;if($[0]!==q)A=A8.createElement(V,null,q," "),$[0]=q,$[1]=A;else
     A=$[1];return A}if(K){let
     A;if($[2]!==K.count||$[3]!==K.current)A=A8.createElement(V,{dimColor:!0},K.current,"/",K.count,"
     "),$[2]=K.count,$[3]=K.current,$[4]=A;else A=$[4];return A}let
     _;if($[5]===Symbol.for("react.memo_cache_sentinel"))_=A8.createElement(V,{dimColor:!0},"verbose "),$[5]=_;else
     _=$[5];return _}function Pv5({jumpRef:H,count:$,current:q,onClose:K,onCancel:_,setHighlight:A,initialQuery:z}){let
     {query:f,cursorOffset:Y,handleKeyDown:O,handlePaste:M}=z0({isActive:!0,initialQuery:z,onExit:()=>K(f),onCancel:_})
     ,[D,w]=s$.useState("building");s$.useEffect(()=>{let
     L=!0,P=H.current?.warmSearchIndex;if(!P){w(null);return}return
     w("building"),P().then((G)=>{if(!L)return;if(G<20)w(null);else
     w({ms:G}),setTimeout(()=>L&&w(null),2000)}),()=>{L=!1}},[]);let
     j=D!=="building";s$.useEffect(()=>{if(!j)return;H.current?.setSearchQuery(f),A(f)},[f,j]);let
     X=Y,J=X<f.length?f[X]:" ";return
     A8.createElement(p,{borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginT
     op:1,paddingLeft:2,tabIndex:0,autoFocus:!0,onKeyDown:O,onPaste:M,width:"100%",noSelect:!0},A8.createElement(V,null
     ,"/"),A8.createElement(V,null,f.slice(0,X)),A8.createElement(V,{inverse:!0},J),X<f.length&&A8.createElement(V,null
     ,f.slice(X+1)),A8.createElement(p,{flexGrow:1}),D==="building"?A8.createElement(V,{dimColor:!0},"indexing\u2026
     "):D?A8.createElement(V,{dimColor:!0},"indexed in ",D.ms,"ms "):$===0&&f?A8.createElement(V,{color:"error"},"no
     matches "):$>0?A8.createElement(V,{dimColor:!0},q,"/",$,"  "):null)}function fV4(H){let
     $=dD8.c(6),{isAnimating:q,title:K,disabled:_,noPrefix:A}=H,z=xY(),[f,Y]=s$.useState(0),O,M;if($[0]!==_||$[1]!==q||
     $[2]!==A||$[3]!==z)O=()=>{if(_||A||!q||!z)return;let
     w=setInterval(Gv5,Wv5,Y);return()=>clearInterval(w)},M=[_,A,q,z],$[0]=_,$[1]=q,$[2]=A,$[3]=z,$[4]=O,$[5]=M;else
     O=$[4],M=$[5];s$.useEffect(O,M);let D=q?YV4[f]??zV4:zV4;return o_H(_?null:A?K:`${D} ${K}`),null}function
     Gv5(H){return H(Zv5)}function Zv5(H){return(H+1)%YV4.length}function QC6({commands:H,debug:$,initialTools:q,initia
     lMessages:K,pendingHookMessages:_,initialFileHistorySnapshots:A,initialContentReplacements:z,initialAgentName:f,in
     itialAgentColor:Y,mcpClients:O,dynamicMcpConfig:M,autoConnectIdeFlag:D,strictMcpConfig:w=!1,systemPrompt:j,appendS
     ystemPrompt:X,onBeforeQuery:J,onTurnComplete:L,disabled:P=!1,mainThreadAgentDefinition:G,disableSlashCommands:W=!1
     ,remoteSessionConfig:Z,directConnectConfig:v,sshSession:k,thinkingConfig:N}){let
     h=!!Z,R=s$.useMemo(()=>hH(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE),[]),I=s$.useMemo(()=>!1,[]),C=s$.useMemo
     (()=>hH(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),B=!1;s$.useEffect(()=>{return E(`[REPL:mount] REPL
     mounted, disabled=${P}`),()=>E("[REPL:unmount] REPL unmounting")},[P]);let[x,S]=s$.useState(G),F=w$((j$)=>j$.toolP
     ermissionContext),U=w$((j$)=>j$.verbose),g=w$((j$)=>j$.mcp),Q=w$((j$)=>j$.plugins),i=w$((j$)=>j$.agentDefinitions)
     ,n=w$((j$)=>j$.initialMessage),o=Es(),$H=w$((j$)=>j$.expandedView)==="tasks",r=w$((j$)=>j$.pendingWorkerRequest),H
     H=w$((j$)=>j$.pendingSandboxRequest),t=w$((j$)=>j$.teamContext),fH=w$((j$)=>j$.tasks),YH=w$((j$)=>j$.workerSandbox
     Permissions),XH=w$((j$)=>j$.elicitation),s=w$((j$)=>j$.ultraplanPendingChoice),a=w$((j$)=>j$.ultraplanLaunchPendin
     g),KH=w$((j$)=>j$.viewingAgentTaskId),e=F6(),zH=KH?fH[KH]:void
     0,_H=xX(zH)&&zH.retain&&!zH.diskLoaded;s$.useEffect(()=>{if(!KH||!_H)return;let
     j$=KH;VzH(hz(j$)).then((r$)=>{e((_8)=>{let Hq=_8.tasks[j$];if(!xX(Hq)||Hq.diskLoaded||!Hq.retain)return _8;let
     Eq=Hq.messages??[],OK=new Set(Eq.map((lK)=>lK.uuid)),qK=r$?r$.messages.filter((lK)=>!OK.has(lK.uuid)):[];return{..
     ._8,tasks:{..._8.tasks,[j$]:{...Hq,messages:[...qK,...Eq],diskLoaded:!0}}}})})},[KH,_H,e]);let
     DH=B9(),OH=s$.useMemo(()=>$E(()=>DH.getState(),e),[DH,e]),LH=s$.useMemo(()=>o0H(()=>DH.getState(),e),[DH,e]),jH=vi
     (),ZH=Zw(),[VH,WH]=s$.useState(H);DG4(h?void 0:Z_(),WH);let vH=w$((j$)=>j$.isBriefOnly),RH=s$.useMemo(()=>sZ(F),[F
     ,vH]);nj7(),ij7();let[BH,sH]=s$.useState(M),dH=s$.useCallback((j$)=>{sH(j$)},[sH]),[f$,O$]=s$.useState("prompt"),[
     TH,CH]=s$.useState(!1),[mH,xH]=s$.useState(!1),[aH,rH]=s$.useState(""),nH=s$.useRef(0),cH=s$.useRef(void 0),tH=s$.
     useRef(!1),{addNotification:v$,removeNotification:B$}=A7(),H8=wv5,d$=fG4(O,g.clients),[iH,x$]=s$.useState(void
     0),[FH,A$]=s$.useState(null),[kH,oH]=s$.useState(null),[M$,W$]=s$.useState(!1),[AH,wH]=s$.useState(()=>{return!1})
     ,uH=w$((j$)=>j$.showRemoteCallout),[bH,eH]=s$.useState(()=>w04());aT4(),tT4(),iT4({ideSelection:iH,mcpClients:d$,i
     deInstallationStatus:kH}),F04({mcpClients:d$}),g04(),PT4(),ZT4(),L58(),RT4(ZH),Ov4(),wv4(),xT4(ZH),mT4(),cT4(),UT4
     (),Mv5(),cZ4(),$04(),z04(),c04(),Kv4();let{recommendation:SH,handleResponse:T$}=_T4(),{recommendation:D$,handleRes
     ponse:c$}=MT4(),{pending:F$,handleAction:l8,skipForSession:E8}=Ov5(),U6=s$.useMemo(()=>{return[...RH,...q]},[RH,q]
     );$D8({enabled:!h}),PG4({enabled:!h});let
     z6=TO7();s$.useEffect(()=>{if(h)return;NT4(e)},[e,h]),s$.useEffect(()=>{let j$=setTimeout(Bv4,500);return()=>clear
     Timeout(j$)},[]),O04(h?gC6:d$,F.mode),s$.useEffect(()=>{WE6(F.mode)},[F.mode]),L24(e,K,{enabled:!h});let
     Mq=dz8(U6,g.tools,F),{tools:AK,allowedAgentTypes:U8}=s$.useMemo(()=>{if(!x)return{tools:Mq,allowedAgentTypes:void
     0};let j$=Td(x,Mq,!1,!0);return{tools:j$.resolvedTools,allowedAgentTypes:j$.allowedAgentTypes}},[x,Mq]),X6=s$.useR
     ef(AK);X6.current=AK;let IK=s$.useMemo(()=>{if(!MX())return AK;let j$=new
     Set(AK.map((_8)=>_8.name)),r$=ifH().filter((_8)=>!j$.has(_8.name));return
     r$.length>0?[...AK,...r$]:AK},[AK]),pK=iR6(VH,Q.commands),R4=iR6(pK,g.commands),g6=s$.useMemo(()=>W?[]:R4,[W,R4]);
     Lw4(h?gC6:g.clients),vG4(h?gC6:g.clients,x$);let[D9,w9]=s$.useState([]),[p1,l_]=s$.useState(null);s$.useEffect(()=
     >{if(p1&&!p1.isStreaming&&p1.streamingEndedAt){let r$=30000-(Date.now()-p1.streamingEndedAt);if(r$>0){let
     _8=setTimeout(l_,r$,null);return()=>clearTimeout(_8)}else
     l_(null)}},[p1]);let[f4,pA]=s$.useState(null),B1=s$.useRef(null);B1.current=f4;let SD=s$.useRef(null),uw=s$.useRef
     (()=>{}),__=s$.useRef(()=>{}),N3=s$.useRef(null),eX=s$.useRef(null),mw=s$.useRef(0),wA=s$.useRef(new
     vI6).current,zf=s$.useSyncExternalStore(wA.subscribe,wA.getSnapshot),[A5,I_]=s$.useState(Z?.hasInitialPrompt??!1),
     B7=zf||A5,[jA,q1]=s$.useState(void
     0),N5=s$.useRef(0),K1=s$.useRef(!1),XA=s$.useRef(0),z5=s$.useRef(0),sY=s$.useRef(null),dM=s$.useCallback(()=>{XA.c
     urrent=Date.now(),z5.current=0,sY.current=null},[]),Bj=s$.useRef(!1);if(zf&&!Bj.current)dM();Bj.current=zf;let
     dO=s$.useCallback((j$)=>{if(I_(j$),j$)dM()},[dM]),tY=s$.useRef(null),RD=s$.useRef(void 0),fY=s$.useRef(void
     0),HJ=1500,[JA,Dz]=s$.useState(!1);s$.useEffect(()=>{if(oq())JOK().then((j$)=>{if(j$)v$({key:"tmux-mouse-hint",tex
     t:j$,priority:"low"})});LOK().then((j$)=>{if(j$)v$({key:"tmux-focus-hint",text:j$,priority:"low"})})},[]);let[cM,F
     j]=s$.useState(!1);s$.useEffect(()=>{},[]);let[P8,Xq]=s$.useState(null),WK=s$.useRef(null),oK=s$.useCallback((j$)=
     >{if(j$?.isLocalJSXCommand){let{clearLocalJSX:r$,..._8}=j$;WK.current={..._8,isLocalJSXCommand:!0},Xq(_8);return}i
     f(WK.current){if(j$?.clearLocalJSX){WK.current=null,Xq(null);return}return}if(j$?.clearLocalJSX){Xq(null);return}X
     q(j$)},[]),[aK,A_]=s$.useState(()=>new
     Map),a1=s$.useCallback((j$)=>{A_((r$)=>sG4(r$,j$))},[]),[y4,Qq]=s$.useState([]),GK=s$.useMemo(()=>uD4(Qq),[Qq]),[b
     9,_9]=s$.useState(null),[cK,BA]=s$.useState([]),[n9,yY]=s$.useState([]),pw=s$.useRef(new
     Map),Uj=w$((j$)=>j$.settings.terminalTitleFromRename)!==!1,i5=s$.useSyncExternalStore(LE6,()=>Uj?XD(y$()):void
     0);s$.useEffect(()=>{return XE6(()=>{let
     j$=IcH();if(!j$)return;e((r$)=>{if(r$.standaloneAgentContext?.name===j$)return
     r$;return{...r$,standaloneAgentContext:{...r$.standaloneAgentContext,name:j$}}})})},[e]);let[f7,gj]=s$.useState(),
     CD=s$.useRef((K?.length??0)>0),K2=x?.agentType,_1=i5??K2??f7??"Claude
     Code",r5=y4.length>0||n9.length>0||r||HH,y5=P8?.isLocalJSXCommand===!0&&P8?.jsx!=null,bD=s$.useMemo(()=>Q48(fH),[f
     H]),$J=r5||y5?"waiting":B7||bD?"busy":"idle",cO=s$.useMemo(()=>If4(fH),[fH]),qJ=$J==="idle"&&cO?"busy":$J,LA=$J===
     "busy";s$.useEffect(()=>{if($J==="busy")return GD4(),()=>ZD4()},[$J]);let wz=$J!=="waiting"?void
     0:y4.length>0?`approve ${y4[0].tool.name}`:r?"worker request":HH?"sandbox request":y5?"dialog open":"input
     needed";s$.useEffect(()=>{BR$({status:qJ,waitingFor:wz})},[qJ,wz]);let lO=P44(fH),kK=Zc$();s$.useEffect(()=>{XI7({
     tasks:lO.count,queued:kK,kinds:lO.kinds})},[lO.count,kK,lO.kinds.join(",")]);let
     y3=S$("tengu_terminal_sidebar",!1)&&(h$().showStatusInTerminalTab??!1),qu=w$((j$)=>j$.postTurnSummary?.status_deta
     il);Cg$(R||!y3?null:$J,qu),s$.useEffect(()=>{return $vK(GK),()=>qvK()},[GK]);let[S9,iE]=s$.useState(K??[]),f5=s$.u
     seRef(S9),k0=s$.useRef(!1),F7=s$.useCallback((j$)=>{let r$=f5.current,_8=typeof
     j$==="function"?j$(f5.current):j$;if(f5.current=_8,_8.length<N5.current)N5.current=0,K1.current=!1,q1(void 0);else
      if(_8.length>r$.length&&K1.current){let
     Hq=_8.length-r$.length;if((r$.length===0||_8[0]===r$[0]?_8.slice(-Hq):_8.slice(0,Hq)).some(O_$))K1.current=!1;else
      N5.current=_8.length}iE(_8)},[]),Bz=s$.useCallback((j$)=>F7((r$)=>sM8(r$,j$)),[F7]);eZ4(s$.useCallback((j$)=>F7((
     r$)=>[...r$,K8({content:NA8(j$),isMeta:!0})]),[F7]));let NP=s$.useCallback((j$)=>{if(j$!==void
     0)N5.current=f5.current.length,K1.current=!0;else
     K1.current=!1;q1(j$)},[]),{dividerIndex:yP,dividerYRef:_2,onScrollAway:Cv,onRepin:KN,jumpToNew:Bs,shiftDivider:lM}
     =Ze7(S9.length);oZ4(S9,F7,B7,mw,!h);let[N0,UH]=s$.useState(null),lH=s$.useRef(N0);lH.current=N0;let
     o$=s$.useRef(null),H$=s$.useMemo(()=>Te7(S9,yP),[yP,S9.length]),U$=s$.useCallback((j$=!1,r$="?")=>{if(!j$&&!x5("au
     toScrollEnabled",!0).value)return;let _8=N3.current;if(_8&&!_8.isSticky())E(`repinScroll(${r$}, force=${j$}):
     yanking from scrollTop=${_8.getScrollTop()}
     (max=${Math.max(0,_8.getScrollHeight()-_8.getViewportHeight())})`);if(_8?.scrollToBottom(),KN(),lH.current!==null)
     UH(null)},[KN]),h8=S9.at(-1),Z8=h8!=null&&O_$(h8);s$.useEffect(()=>{if(Z8)U$(!1,"lastMsgIsHuman")},[Z8,h8,U$]);let
     {maybeLoadOlder:b6}=Xv5,s6=s$.useCallback((j$,r$)=>{if(mw.current=Date.now(),j$)KN();else
     Cv(r$)},[KN,Cv,b6]),k7=H24(_,F7),[Y5,F1]=s$.useState(null);s$.useState(()=>{return fq8(gr8()),null});let
     M7=s$.useRef(zq8()),i9=FX7(),n7=s$.useCallback(()=>Dz(!1),[]),V9=Ni(n7,HJ),Bf=s$.useRef(null),G_=s$.useCallback((j
     $)=>{if(H8(M7.current,j$))return;if(M7.current===""&&j$!==""&&Date.now()-mw.current>=Jv5)U$(!1,"typedIntoEmpty");M
     7.current=j$,fq8(j$),M6H.recordUserActivity(),kMH(!0);let r$=j$.trim().length>0;if(Dz(r$),r$)V9();else
     V9.cancel()},[Dz,U$,H8,V9]),[ff,nM]=s$.useState("prompt"),[KJ,rE]=s$.useState(),xD=s$.useCallback((j$)=>{let
     r$=new Set(j$.slash_commands);WH((_8)=>_8.filter((Hq)=>r$.has(Hq.name)||sy6.has(Hq))),e((_8)=>_8.mainLoopModel===j
     $.model?_8:{..._8,mainLoopModel:j$.model})},[WH,e]),[y0,_N]=s$.useState(new
     Set),jR=s$.useCallback((j$)=>{_N((r$)=>{switch(j$.action){case"add":{let _8=new Set(r$);for(let Hq of
     j$.ids)_8.add(Hq);return _8}case"remove":{let _8=new Set(r$);for(let Hq of j$.ids)_8.delete(Hq);return
     _8.size===r$.size?r$:_8}case"clear":return r$.size>0?new Set:r$}})},[]),EP=s$.useRef(!1),E0=s$.useRef(0),oE=s$.use
     Ref([]),EF=s$.useRef(0),mc=s$.useCallback((j$)=>{E0.current+=j$;let r$=oE.current;if(j$>0&&r$.length>0){let
     _8=r$.at(-1);if(_8.outputTokens==null)_8.lastTokenTime=Date.now(),_8.endResponseLength=E0.current}},[]),TvH=s$.use
     Callback(()=>{E0.current=0},[]),uKH=s$.useCallback((j$)=>{if(j$.type==="start"){let
     r$=Date.now(),_8=E0.current;oE.current.push({id:j$.id,ttftMs:j$.ttftMs,firstTokenTime:r$,lastTokenTime:r$,response
     LengthBaseline:_8,endResponseLength:_8})}else{let
     r$=j$.id!=null?oE.current.find((_8)=>_8.id===j$.id):oE.current.findLast((_8)=>_8.id==null);if(r$){if(r$.outputToke
     ns=j$.outputTokens,r$.lastTokenTime=Date.now(),j$.id==null)E0.current=Math.max(E0.current,r$.responseLengthBaselin
     e+j$.outputTokens*4)}}},[]),hF=ZW4({config:Z,setMessages:F7,setIsLoading:dO,onInit:xD,setToolUseConfirmQueue:GK,to
     ols:U6,setStreamingToolUses:w9,setStreamMode:Pf$,setInProgressToolUseIDs:jR,recordApiMetricsEvent:uKH,permissionMo
     de:F.mode}),Fs=kW4({config:v,setMessages:F7,setIsLoading:dO,setToolUseConfirmQueue:GK,tools:U6,permissionMode:F.mo
     de}),IF=EW4({session:k,setMessages:F7,setIsLoading:dO,setToolUseConfirmQueue:GK,tools:U6,permissionMode:F.mode}),_
     J=s$.useMemo(()=>IF.isRemoteMode?z_8("ssh",IF,!1):Fs.isRemoteMode?z_8("direct",Fs,!1):hF.isRemoteMode?z_8("ccr",hF
     ,Z?.viewerOnly??!1,Z?.sessionId):qG6,[IF,Fs,hF,Z?.viewerOnly,Z?.sessionId]);s$.useEffect(()=>{let
     j$=_J.isRemoteMode?_J:null,r$=_J.isRemoteMode&&_J.kind==="ccr"?"ccr-api":"local-jsonl",_8=uMH();if(_8.remote!==j$|
     |_8.transcriptSource!==r$)zJ8({..._8,remote:j$,transcriptSource:r$})},[_J]);let[FA,DL]=s$.useState({}),[XR,mKH]=s$
 9247 `)+1)||null:null,[xv,Us]=s$.useState(0),[gs,Ku]=s$.useState(!1),[lOH,Qs]=s$.useState(void 0),[ds,pKH]=s$.useState
 :   (!1),[nOH,AN]=s$.useState(mOH.randomUUID()),[SF,VG]=s$.useState(null),Bc=s$.useCallback((j$)=>{let
     r$=XD4(j$,ZX);if(r$)VG(r$)},[]),BKH=s$.useRef(xv);BKH.current=xv;let[cs]=s$.useState(()=>({current:eEK(K,z)})),[RF
     ]=s$.useState(()=>({current:XdK(K??[])})),[Fc,AJ]=s$.useState(h$().hasAcknowledgedCostThreshold),[Uc,wL]=s$.useSta
     te(!1),[E$,i8]=s$.useState(!1),Lq=s$.useRef("INSERT");s$.useEffect(()=>{if(s&&Uc)wL(!1)},[s,Uc]);let
     j9=xY(),A9=s$.useRef(j9);A9.current=j9;let[A1]=wK(),Xz=s$.useRef(!1),Bw=s$.useCallback(()=>{if(Xz.current)return;X
     z.current=!0;let j$=f5.current.slice(Qc.current);for(let r$ of o_6(j$))QKH.current.add(r$);Qc.current=f5.current.l
     ength,J04({theme:A1,readFileState:CF.current,bashTools:QKH.current}).then(async(r$)=>{if(r$){let _8=await
     r$.content({theme:A1});e((Hq)=>({...Hq,spinnerTip:_8})),L04(r$)}else e((_8)=>{if(_8.spinnerTip===void 0)return
     _8;return{..._8,spinnerTip:void 0}})})},[e,A1]),PA=s$.useCallback(()=>{dO(!1),NP(void
     0),E0.current=0,oE.current=[],EF.current++,bv(null),w9([]),d36(),Pf$("responding"),Bw(),ir(),ro$()},[Bw]),jL=s$.us
     eMemo(()=>ZWH(fH).some((j$)=>j$.status==="running"),[fH]);s$.useEffect(()=>{if(!jL&&tY.current!==null){let
     j$=Date.now()-tY.current,r$=RD.current;tY.current=null,RD.current=void
     0,F7((_8)=>[..._8,F26(j$,r$,q6(_8,eqH))])}},[jL,F7]);let A2=s$.useRef(!1);s$.useEffect(()=>{{if(F.mode!=="auto"){A
     2.current=!1;return}if(A2.current)return;if((h$().autoPermissionsNotificationCount??0)>=3)return;let
     _8=setTimeout((Hq,Eq)=>{Hq.current=!0,a$((OK)=>{let qK=OK.autoPermissionsNotificationCount??0;if(qK>=3)return
     OK;return{...OK,autoPermissionsNotificationCount:qK+1}}),Eq((OK)=>[...OK,Az(MM8,"warning")])},800,A2,F7);return()=
     >clearTimeout(_8)}},[F.mode,F7]);let
     glH=s$.useRef(!1),iOH=s$.useRef(!1);s$.useEffect(()=>{if(iOH.current)return;let j$=$z();if(!j$?.creationDurationMs
     ||j$.usedSparsePaths)return;if(j$.creationDurationMs<15000)return;iOH.current=!0;let
     r$=Math.round(j$.creationDurationMs/1000);F7((_8)=>[..._8,Az(`Worktree creation took ${r$}s. For large repos, set
     \`worktree.sparsePaths\` in .claude/settings.json to check out only the directories you need \u2014 e.g.
     \`{"worktree": {"sparsePaths": ["src",
     "packages/foo"]}}\`.`,"info")])},[F7]);let{onBeforeQuery:FKH,onTurnComplete:vvH,onSessionRestored:UKH,render:sJ$,o
     wnsInput:VvH}=RW4({enabled:I,setMessages:F7,setInputValue:G_,setToolJSX:oK,resultDedupState:RF.current}),rOH=(!P8|
     |P8.showSpinner===!0)&&y4.length===0&&n9.length===0&&(B7||jA||jL||Zc$()>0)&&!r&&(!vG||vH),ls=y4.length>0||n9.lengt
     h>0||cK.length>0||XH.queue.length>0||YH.queue.length>0;yD4({sandboxHost:cK[0]?.hostPattern.host,promptTitle:n9[0]?
     .title,elicitationServer:XH.queue[0]?.serverName,workerSandboxHost:YH.queue[0]?.host});let
     oOH=LZ4({hasActivePrompt:ls,otherSurveyActive:!1}),gKH=GZ4(S9,B7,ls,{enabled:!h}),h0=XZ4(S9,B7,ls,{enabled:!h,othe
     rSurveyActive:oOH.state!=="closed"||gKH.state!=="closed"}),kvH=fZ4(S9,B7,XR,"session",ls,oOH.state!=="closed"||gKH
     .state!=="closed"||h0.state!=="closed"),uv=Nv4(S9,XR),QlH=s$.useMemo(()=>({...kvH,handleSelect:(j$)=>{if(hvH.curre
     nt=!1,kvH.handleSelect(j$),j$==="bad"&&Lv4("feedback_survey_bad"))dKH("feedback_survey_bad"),hvH.current=!0}}),[kv
     H]),tJ$=Yv5(S9,B7,ls,oOH.state!=="closed"||QlH.state!=="closed"||gKH.state!=="closed"||h0.state!=="closed");lG4({a
     utoConnectIdeFlag:D,ideToInstallExtension:FH,setDynamicMcpConfig:sH,setShowIdeOnboarding:W$,setIDEInstallationStat
     e:oH}),R04(A,(j$)=>e((r$)=>({...r$,fileHistory:j$})));let eJ$=s$.useCallback(async(j$,r$,_8)=>{let
     Hq=performance.now();try{let Eq=Rf$(r$.messages),OK=UM$();await
     A0H("resume",{getAppState:()=>DH.getState(),setAppState:e,signal:AbortSignal.timeout(OK)});let{agentDefinition:qK}
     =_vH(r$.agentSetting,G,i);S(qK),e((U1)=>({...U1,agent:qK?.agentType}));let lK=await
     Sb("resume",{sessionId:j$,agentType:qK?.agentType,model:ZH});if(Eq.push(...lK),_8==="fork")XFK(r$,LW(j$));else
     fr$(r$,LW(j$));if(r$.fileHistorySnapshots)q68(r$);if(e((U1)=>({...U1,standaloneAgentContext:MJ$(r$.agentName,r$.ag
     entColor)})),LV(r$.agentName),$L$(Eq,r$.projectPath??K6()),_8!=="fork")tOH.current.current=u3$(Eq,U6);PA(),pA(null
     ),AN(j$);let $q=D46(j$);s1$(),SVH(),b0(LW(j$),r$.fullPath?cD8.dirname(r$.fullPath):null);let{renameRecordingForSes
     sion:Y7}=await Promise.resolve().then(() => (YJ$(),SG4));if(await Y7(),await
     oB(),OJ$(r$,e),FM$(),Ps(r$),CD.current=!0,gj(void 0),_8!=="fork")CG4(r$.worktreeSession===void 0?r$.projectPath:r$
     .worktreeSession?.worktreePath),DJ$(r$.worktreeSession,r$.projectPath),Ls(),yO6({abortController:new
     AbortController,taskRegistry:OH}),Kl(DN().map((U1)=>U1.id)),eR6(Eq);else{let
     U1=$z();if(U1)FS(U1)}if($q)lnH($q);if(cs.current&&_8!=="fork")cs.current=Bl$(Eq,r$.contentReplacements??[]);if(F7(
     ()=>Eq),oK(null),G_(""),_8!=="fork")Bc(Eq);d("tengu_session_resumed",{entrypoint:_8,success:!0,resume_duration_ms:
     Math.round(performance.now()-Hq)})}catch(Eq){throw
     d("tengu_session_resumed",{entrypoint:_8,success:!1,failure_reason:"processing_error",error_name:n8(Eq).name}),Eq}
     },[PA,e,OH,Bc]),[gc]=s$.useState(()=>wb(Np)),CF=s$.useRef(gc),QKH=s$.useRef(new
     Set),Qc=s$.useRef(0),dlH=s$.useRef(new Set),clH=s$.useRef(new Map),NvH=s$.useRef(new Set),aOH=s$.useRef(new
     Map),yvH=s$.useRef(void
     0),sOH=s$.useRef(AAH()),HL$=s$.useRef(X5$()),tOH=s$.useRef($gH()),$L$=s$.useCallback((j$,r$)=>{let
     _8=MpH(j$,r$,Np);CF.current=zxH(CF.current,_8);for(let Hq of
     o_6(j$))QKH.current.add(Hq)},[e]);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)},[]);let{status:qL$,reverify:E
     vH}=q24(),[_u,dKH]=s$.useState(null),hvH=s$.useRef(!1),[llH,nlH]=s$.useState(null),[ilH,rlH]=s$.useState(!1),olH=!
     B7&&ds;function
     eOH(){if(ilH||llH)return;if(gs)return"message-selector";if(JA)return;if(cK[0])return"sandbox-permission";let
     j$=!P8||P8.shouldContinueAnimation;if(j$&&y4[0])return"tool-permission";if(j$&&n9[0])return"prompt";if(j$&&YH.queu
     e[0])return"worker-sandbox-permission";if(j$&&XH.queue[0])return"elicitation";if(j$&&olH)return"cost";if(j$&&SF)re
     turn"resume-return";if(j$&&!B7&&s)return"ultraplan-choice";if(j$&&!B7&&a)return"ultraplan-launch";if(k4()){if(j$&&
     uH)return"remote-callout";return}if(j$&&M$)return"ide-onboarding";if(j$&&uH)return"remote-callout";if(j$&&SH)retur
     n"lsp-recommendation";if(j$&&D$)return"plugin-hint";if(j$&&bH)return"desktop-upsell";return}let Jz=eOH(),KL$=JA&&(
     cK[0]||y4[0]||n9[0]||YH.queue[0]||XH.queue[0]||olH);fY.current=Jz,s$.useEffect(()=>{if(!B7)return;let
     j$=Jz==="tool-permission",r$=Date.now();if(j$&&sY.current===null)sY.current=r$;else
     if(!j$&&sY.current!==null)z5.current+=r$-sY.current,sY.current=null},[Jz,B7]);let
     alH=s$.useRef(Jz),UA=s$.useRef(null);s$.useLayoutEffect(()=>{let
     j$=alH.current==="tool-permission",r$=Jz==="tool-permission";if(alH.current=Jz,j$===r$)return;let
     _8=N3.current;if(r$)UA.current=_8&&!_8.isSticky()?_8.getScrollTop():null,U$(!0,"permissionDialogAppear");else
     if(UA.current!==null)_8?.scrollTo(UA.current),UA.current=null;else U$(!0,"permissionDialogDismiss")},[Jz,U$]);let
     ns=P8?.jsx!=null,_L$=s$.useRef(ns);s$.useLayoutEffect(()=>{if(_L$.current!==ns&&(N3.current?.isSticky()??!0))U$(!1
     ,`toolJsxDialog\u2192${ns}`);_L$.current=ns},[ns,U$]);function IvH(){if(Jz==="elicitation")return;if(E(`[onCancel]
      focusedInputDialog=${Jz} streamMode=${Pd.getState().mode}`),wA.forceEnd(),JR?.trim())F7((j$)=>[...j$,Pw({content:
     JR})]);if(PA(),Jz==="tool-permission")y4[0]?.onAbort(),GK([]);else if(Jz==="prompt"){for(let j$ of
     n9)j$.reject(Error("Prompt cancelled by user"));yY([]),f4?.abort("user-cancel")}else
     if(_J.isRemoteMode)_J.cancelRequest();else f4?.abort("user-cancel");pA(null),vvH(f5.current,!0)}let
     AL$=s$.useCallback(()=>{let
     j$=vc$(M7.current,0);if(!j$)return;if(G_(j$.text),nM("prompt"),j$.images.length>0)DL((r$)=>{let _8={...r$};for(let
      Hq of j$.images)_8[Hq.id]=Hq;return _8})},[G_,nM,DL]),zL$={setToolUseConfirmQueue:GK,onCancel:IvH,getConnectionSu
     mmary:()=>SD.current?.summary(),onAgentsKilled:()=>F7((j$)=>[...j$,ZB7()]),isMessageSelectorVisible:gs||!!Uc,scree
     n:f$,abortSignal:f4?.signal,isExternalLoading:A5,popCommandFromQueue:AL$,isLocalJSXCommand:P8?.isLocalJSXCommand,i
     sInputOverlayActive:E$,inputMode:ff,isInputEmpty:i9};s$.useEffect(()=>{if(h)return;if(LL()>=5&&!ds&&!Fc){if(d("ten
     gu_cost_threshold_reached",{}),AJ(!0),YS$())pKH(!0)}},[S9,ds,Fc]);let hw8=s$.useCallback(async(j$)=>{let
     r$=DH.getState(),{mode:_8,isBypassPermissionsModeAvailable:Hq}=r$.toolPermissionContext;switch(GV$(_8,Hq)){case"al
     low":return!0;case"deny":return!1;case"classify":return
     C68(j$.host,j$.port,f5.current,X6.current,r$.toolPermissionContext,new
     AbortController().signal);case"ask":break}if(yK()&&R_$()){let OK=vQK(),qK=await VQK(j$.host,OK);return new
     Promise((lK)=>{if(!qK){BA(($q)=>[...$q,{hostPattern:j$,resolvePromise:lK}]);return}EQK({requestId:OK,host:j$.host,
     resolve:lK}),e(($q)=>({...$q,pendingSandboxRequest:{requestId:OK,host:j$.host}}))})}return new Promise((OK)=>{let
     qK=!1;function lK($q){if(qK)return;qK=!0,OK($q)}BA(($q)=>[...$q,{hostPattern:j$,resolvePromise:lK}]);{let
     $q=DH.getState().replBridgePermissionCallbacks;if($q){let
     Y7=mOH.randomUUID();$q.sendRequest(Y7,yD8,{host:j$.host},mOH.randomUUID(),`Allow network connection to
     ${j$.host}?`);let U1=$q.onResponse(Y7,(Lz)=>{U1();let _O=Lz.behavior==="allow";BA((Fw)=>{return
     Fw.filter((Uw)=>Uw.hostPattern.host===j$.host).forEach((Uw)=>Uw.resolvePromise(_O)),Fw.filter((Uw)=>Uw.hostPattern
     .host!==j$.host)});let NG=pw.current.get(j$.host);if(NG){for(let Fw of
     NG)Fw();pw.current.delete(j$.host)}}),iM=()=>{U1(),$q.cancelRequest(Y7)},R9=pw.current.get(j$.host)??[];R9.push(iM
     ),pw.current.set(j$.host,R9)}}})},[e,DH]);if(s$.useEffect(()=>{let
     j$=E6.getSandboxUnavailableReason();if(!j$)return;if(E6.isSandboxRequired()){process.stderr.write(`

 9248: Error: sandbox required but unavailable: ${j$}
 9249: `+`  sandbox.failIfUnavailable is set \u2014 refusing to start without a working sandbox.
 9250:

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

Steps to Reproduce

  1. Create a session on Claude Code 2.1.97 (or earlier)
  2. Allow the auto-updater to update to 2.1.120
  3. Attempt to resume the session: claude --resume <session-id>
  4. Observe crash

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.120

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Xterm

Additional Information

Workaround

Resume using the previous binary directly:

~/.local/share/claude/versions/2.1.97 --resume <session-id>

To prevent the auto-updater from breaking sessions in the meantime:

export DISABLE_AUTOUPDATER=1

View original on GitHub ↗

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