Skip to content

fix: /plan empty-target fast path — stop burning ~5k tokens in empty repos#22

Merged
time-attack merged 2 commits into
mainfrom
time-attack/planfixe
Jul 23, 2026
Merged

fix: /plan empty-target fast path — stop burning ~5k tokens in empty repos#22
time-attack merged 2 commits into
mainfrom
time-attack/planfixe

Conversation

@time-attack

@time-attack time-attack commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Problem

Running /plan in a totally empty repository burned ~5k tokens of reference and specialist-module reading before the agent acknowledged there was nothing on disk. The dispatch protocol mandates reading three reference files plus the full active module before any output, so the empty-tree discovery came last instead of first.

Fix

Dispatcher-level (scripts/gstack2/generate-skill-tree.ts, same gap/supplemental pattern as the Scale header): a plan-only "Empty-target fast path" section. One cheap ls -A probe runs before any reference or module read. An empty tree (or only VCS/tooling metadata) short-circuits to an immediate greenfield header, states the repo is empty in the first sentence, skips decision-store recall and every repo-reading phase, and asks the single what-do-you-want-to-build question when the prompt carries no idea. Codebase vector fixes at greenfield; scale comes from the prompt alone.

No specialist overlay and no EXPECTED_PARITY_CHECKS bump — the fast path runs before modules are read, so it lives in the dispatcher, not the legacy bodies.

Evidence

  • bun run test:gstack2 passes (all 26 files, parity at 5027 checks)
  • bun test passes (exit 0)
  • Regen committed separately per bisection style; only skills/plan/SKILL.md (+4 lines) and the parity transcript hash changed

🤖 Generated with Claude Code


Summary by cubic

Add an empty-target fast path for /plan that probes the repo with a single ls -A before any reads. Empty repos now short-circuit to a greenfield plan, saving ~5k tokens and time.

  • Bug Fixes
    • Dispatcher pre-probes; if empty or only VCS/tooling files, skip decision-store recall, repo scans, and specialist phases.
    • Emit immediate header with Target: <path> (empty repository — greenfield); if no idea in the prompt, ask what to build.
    • Updated scripts/gstack2/generate-skill-tree.ts and skills/plan/SKILL.md; tests pass.

Written for commit 49b8687. Summary will update on new commits.

Review in cubic

Sinabina and others added 2 commits July 23, 2026 10:59
A totally empty repo burned ~5k tokens of reference/module reading before
the agent acknowledged there was nothing on disk. The plan dispatcher now
runs one cheap ls -A probe first; an empty tree short-circuits to an
immediate greenfield header, skips repo-evidence phases, and asks what to
build when the prompt carries no idea.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@time-attack
time-attack merged commit b3e9c58 into main Jul 23, 2026
6 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant