@@ -117,6 +117,10 @@ export function createSessionActionMethods(options = {}) {
117117 if ( ! session ) return false ;
118118 const source = String ( session . source || '' ) . trim ( ) . toLowerCase ( ) ;
119119 const sessionId = typeof session . sessionId === 'string' ? session . sessionId . trim ( ) : '' ;
120+ if ( source === 'claude' ) {
121+ const filePath = typeof session . filePath === 'string' ? session . filePath . trim ( ) : '' ;
122+ return ! ! sessionId || ! ! this . extractClaudeResumeKeyFromFilePath ( filePath ) ;
123+ }
120124 return ( source === 'codex' || source === 'codebuddy' || source === 'gemini' ) && ! ! sessionId ;
121125 } ,
122126
@@ -140,19 +144,38 @@ export function createSessionActionMethods(options = {}) {
140144 buildResumeCommand ( session ) {
141145 const source = session && session . source ? String ( session . source ) . trim ( ) . toLowerCase ( ) : '' ;
142146 const sessionId = session && session . sessionId ? String ( session . sessionId ) . trim ( ) : '' ;
143- const arg = this . quoteResumeArg ( sessionId ) ;
147+ const filePath = session && session . filePath ? String ( session . filePath ) . trim ( ) : '' ;
148+ const resumeKey = source === 'claude'
149+ ? ( sessionId || this . extractClaudeResumeKeyFromFilePath ( filePath ) )
150+ : sessionId ;
151+ const arg = this . quoteResumeArg ( resumeKey ) ;
144152 if ( source === 'codebuddy' ) {
145153 return `codebuddy -r ${ arg } ` ;
146154 }
147155 if ( source === 'gemini' ) {
148156 return `gemini -r ${ arg } ` ;
149157 }
158+ if ( source === 'claude' ) {
159+ return `claude -r ${ arg } ` ;
160+ }
150161 if ( this . sessionResumeWithYolo ) {
151162 return `codex --yolo resume ${ arg } ` ;
152163 }
153164 return `codex resume ${ arg } ` ;
154165 } ,
155166
167+ extractClaudeResumeKeyFromFilePath ( filePath ) {
168+ const value = typeof filePath === 'string' ? filePath . trim ( ) : '' ;
169+ if ( ! value ) return '' ;
170+ const normalized = value . replace ( / \\ / g, '/' ) ;
171+ const base = normalized . split ( '/' ) . pop ( ) || '' ;
172+ if ( ! base ) return '' ;
173+ if ( base . toLowerCase ( ) . endsWith ( '.jsonl' ) ) {
174+ return base . slice ( 0 , - 5 ) ;
175+ }
176+ return base ;
177+ } ,
178+
156179 quoteShellArg ( value ) {
157180 const text = typeof value === 'string' ? value : String ( value || '' ) ;
158181 if ( ! text ) return "''" ;
0 commit comments