@@ -107,10 +107,10 @@ async function initToolContext(): Promise<ToolContext> {
107107 status : indexExists ? 'ready' : 'idle'
108108 } ;
109109
110- const performIndexing = async ( incrementalOnly ?: boolean ) : Promise < void > => {
110+ const performIndexing = async ( incrementalOnly ?: boolean , reason ?: string ) : Promise < void > => {
111111 indexState . status = 'indexing' ;
112112 const mode = incrementalOnly ? 'incremental' : 'full' ;
113- console . error ( `Indexing (${ mode } ): ${ rootPath } ` ) ;
113+ console . error ( `Indexing (${ mode } )${ reason ? ` — ${ reason } ` : '' } : ${ rootPath } ` ) ;
114114
115115 try {
116116 let lastLoggedProgress = { phase : '' , percentage : - 1 } ;
@@ -324,9 +324,9 @@ export async function handleCliCommand(argv: string[]): Promise<void> {
324324 }
325325 case 'reindex' : {
326326 const usage = 'codebase-context reindex [--incremental] [--reason <r>]' ;
327- optionalStringFlag ( flags , 'reason' , usage ) ;
327+ const reason = optionalStringFlag ( flags , 'reason' , usage ) ;
328328 const incremental = booleanFlag ( flags , 'incremental' , usage ) ;
329- await ctx . performIndexing ( incremental ) ;
329+ await ctx . performIndexing ( incremental , reason ) ;
330330 const statusResult = await dispatchTool ( 'get_indexing_status' , { } , ctx ) ;
331331 formatJson ( extractText ( statusResult ) , useJson ) ;
332332 return ;
0 commit comments