@@ -183,7 +183,7 @@ function configureHooks(projectPath: string): void {
183183 settings . hooks . PreToolUse . push ( {
184184 hooks : [ {
185185 type : "command" ,
186- command : `npx -y @ axme/ code hook pre-tool-use --workspace ${ projectPath } ` ,
186+ command : `axme- code hook pre-tool-use --workspace ${ projectPath } ` ,
187187 timeout : 5 ,
188188 } ] ,
189189 } ) ;
@@ -195,7 +195,7 @@ function configureHooks(projectPath: string): void {
195195 matcher : "Edit|Write|NotebookEdit" ,
196196 hooks : [ {
197197 type : "command" ,
198- command : `npx -y @ axme/ code hook post-tool-use --workspace ${ projectPath } ` ,
198+ command : `axme- code hook post-tool-use --workspace ${ projectPath } ` ,
199199 timeout : 10 ,
200200 } ] ,
201201 } ) ;
@@ -205,7 +205,7 @@ function configureHooks(projectPath: string): void {
205205 settings . hooks . SessionEnd . push ( {
206206 hooks : [ {
207207 type : "command" ,
208- command : `npx -y @ axme/ code hook session-end --workspace ${ projectPath } ` ,
208+ command : `axme- code hook session-end --workspace ${ projectPath } ` ,
209209 timeout : 120 ,
210210 } ] ,
211211 } ) ;
@@ -248,7 +248,7 @@ function usage(): void {
248248 console . log ( `AXME Code - Persistent memory, decisions, and safety guardrails for Claude Code
249249
250250Usage:
251- axme-code setup [path] Initialize project (LLM scan + .mcp.json + CLAUDE.md)
251+ axme-code setup [path] [--force] Initialize project (LLM scan + .mcp.json + CLAUDE.md)
252252 axme-code serve Start MCP server (stdio transport)
253253 axme-code status [path] Show project status
254254 axme-code cleanup legacy-artifacts [--dry-run] Remove pre-PR#7 sessions/logs
@@ -263,7 +263,9 @@ After setup, run 'claude' as usual. AXME tools are available automatically.`);
263263async function main ( ) {
264264 switch ( command ) {
265265 case "setup" : {
266- const projectPath = resolve ( args [ 1 ] || "." ) ;
266+ const forceSetup = args . includes ( "--force" ) ;
267+ const setupArgs = args . filter ( a => a !== "--force" ) ;
268+ const projectPath = resolve ( setupArgs [ 1 ] || "." ) ;
267269 const hasGitDir = existsSync ( join ( projectPath , ".git" ) ) ;
268270 const ws = detectWorkspace ( projectPath ) ;
269271 const isWorkspace = hasGitDir ? false : ws . type !== "single" ;
@@ -299,13 +301,18 @@ async function main() {
299301 }
300302 generateWorkspaceYaml ( projectPath , ws ) ;
301303 } else {
302- const result = await initProjectWithLLM ( projectPath , { onProgress : console . log } ) ;
303- console . log ( ` Oracle: ${ result . oracle . files } files (${ result . oracle . llm ? "LLM scan" : "deterministic fallback" } )` ) ;
304- console . log ( ` Decisions: ${ result . decisions . count } (${ result . decisions . fromScan } LLM + ${ result . decisions . fromPresets } presets)` ) ;
305- console . log ( ` Memories: ${ result . memories . count } (${ result . memories . fromPresets } from presets)` ) ;
306- console . log ( ` Safety: ${ result . safety . llm ? "LLM scan" : "defaults + presets" } ` ) ;
307- if ( result . cost . costUsd > 0 ) console . log ( ` Cost: $${ result . cost . costUsd . toFixed ( 2 ) } , ${ ( result . durationMs / 1000 ) . toFixed ( 1 ) } s` ) ;
308- for ( const e of result . errors ) console . log ( ` Warning: ${ e } ` ) ;
304+ const result = await initProjectWithLLM ( projectPath , { onProgress : console . log , force : forceSetup } ) ;
305+ if ( ! result . created && result . durationMs === 0 ) {
306+ console . log ( ` Already initialized (skipped LLM scan). Use --force to re-scan.` ) ;
307+ console . log ( ` Decisions: ${ result . decisions . count } , Memories: ${ result . memories . count } ` ) ;
308+ } else {
309+ console . log ( ` Oracle: ${ result . oracle . files } files (${ result . oracle . llm ? "LLM scan" : "deterministic fallback" } )` ) ;
310+ console . log ( ` Decisions: ${ result . decisions . count } (${ result . decisions . fromScan } LLM + ${ result . decisions . fromPresets } presets)` ) ;
311+ console . log ( ` Memories: ${ result . memories . count } (${ result . memories . fromPresets } from presets)` ) ;
312+ console . log ( ` Safety: ${ result . safety . llm ? "LLM scan" : "defaults + presets" } ` ) ;
313+ if ( result . cost . costUsd > 0 ) console . log ( ` Cost: $${ result . cost . costUsd . toFixed ( 2 ) } , ${ ( result . durationMs / 1000 ) . toFixed ( 1 ) } s` ) ;
314+ for ( const e of result . errors ) console . log ( ` Warning: ${ e } ` ) ;
315+ }
309316 }
310317
311318 // Create or update .mcp.json (workspace root + each child repo)
0 commit comments