feat(setup): skip LLM scan on effectively-empty projects#139
Closed
George-iam wants to merge 1 commit into
Closed
Conversation
Reported 2026-05-17 by @geobelsky: running `axme-code setup` in a freshly-created empty folder sits for 1-3 minutes with no progress output, then completes with empty oracle/decisions output anyway. The four LLM scanners (oracle / decision / safety / deploy) round-trip to Claude in parallel, each generating boilerplate text + empty section markers, even when there's nothing in the project to analyse. Fix: a pre-scan check that walks the project tree (capped depth, early exit, skips .git/node_modules/build outputs/etc) and counts non-trivial files. If fewer than 3 non-trivial files exist outside boilerplate (README/LICENSE/.gitignore/CLAUDE.md), we skip the LLM scanner block entirely and fall through to the existing deterministic init paths (presets + initOracleDeterministic), which run instantly. User sees a clear message instead of silent waiting: [project] Project appears empty (< 3 non-trivial files outside .git/node_modules/etc) — skipping LLM scanners, writing presets + deterministic oracle only. Re-run with --force after adding code to get an LLM scan. Trade-offs: - Heuristic, not a sandbox. False positive (real project misidentified as empty) results in presets-only setup — the user can re-run after adding code or with --force. - False negative (truly empty project misidentified as non-empty) means we run the LLM scan unnecessarily — annoying but not broken. - Threshold of 3 is conservative: even a tiny library is usually 5+ files; a fresh `git init` + README is 0-1 non-trivial files. The deterministic-oracle fallback (lines 268-273) already exists for the "no claude CLI installed" path, so the result shape is unchanged — oracle.files = 4, oracle.llm = false, scanners.run = 0, scanners.failed = 0. Telemetry consumers see this as a fast no-LLM setup, same as the no-claude-installed path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Reverting on user feedback — the oracle scanner reads more than just local project files: it pulls in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug: running
axme-code setupin a freshly-created empty folder sits for 1-3 minutes with no progress output, then completes with empty oracle/decisions output anyway. Reported 2026-05-17.Root cause: the four LLM scanners (oracle / decision / safety / deploy) launch in parallel regardless of project content. Each round-trips to Claude generating boilerplate text + empty section markers, even when there's literally nothing in the project tree to analyse. The user has zero progress output between "starting scanners" and "scanners complete".
Fix
A pre-scan check
isEffectivelyEmpty(projectPath)that walks the project tree (capped depth 4, early exit at threshold, skips.git/node_modules/build outputs/etc) and counts non-trivial files. If fewer than 3 non-trivial files exist outside boilerplate (README*/LICENSE*/.gitignore/CLAUDE.md/.editorconfigetc), we skip the LLM scanner block entirely and fall through to the existing deterministic init paths (bundlesToDecisionspresets +initOracleDeterministic), which run instantly.User sees a clear message instead of silent waiting:
Trade-offs
--forceafter adding code.git initwith README+.gitignoreis 0-1 non-trivial files.Result-shape stability
The deterministic-oracle fallback at src/tools/init.ts:268-273 already exists for the "no claude CLI installed" path, so the
InitResultshape is unchanged when we skip:oracle: { files: 4, llm: false }scannersRun: 0, scannersFailed: 0Test plan
mkdir /tmp/empty && cd /tmp/empty && axme-code setup— completes in seconds, prints the "Project appears empty" message,.axme-code/populated with presetscd path/to/axme-code && axme-code setup --force— still runs full LLM scan (existing behaviour)npm test) passes🤖 Generated with Claude Code