Help us improve
Share bugs, ideas, or general feedback.
From forge
Runs the autonomous implementation loop to execute tasks from the Forge frontier, with live status, token budgets, git worktrees, checkpoints, and configurable autonomy, iterations, and depth.
npx claudepluginhub lucasduys/forge --plugin forgeHow this command is triggered — by the user, by Claude, or both
Slash command
/forge:execute [--autonomy full|gated|supervised] [--max-iterations N] [--token-budget N] [--depth quick|standard|thorough] [--filter NAME] [--record-baselines]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Forge Execute ## First-Run Wizard (R004.AC3) Before anything else, fire the one-shot token-reduction wizard. Idempotent — prints once on first install, then no-ops forever. Suppressed when `/forge:watch` is rendering its own banner (R004.AC6). Launch the autonomous implementation loop. Reads the frontier, implements tasks one by one, and relies on the Stop hook state machine to drive iteration until all tasks are complete. **Live status header.** Every iteration of `/forge:execute` is automatically prefixed with a compact dashboard-style status block (phase, current task + step, age...
/forgeRuns task through full pipeline: plan → execute → verify. Supports flags like --full, --plan-only, --execute, --park, --resume, --list.
/buildExecutes all specs in specs/ end-to-end in dependency order, running tasks autonomously without pausing between specs, and stops only on terminal state or blockers.
/executeExecutes validated plans using isolated agents for tasks, spec review, code review, and conflict resolution, with human checkpoints between batches. Supports --resume, --status, --dry-run, and other flags.
/fire-autonomousAutonomously plans, executes, verifies, and advances through project build phases after PRD completion, with configurable phase range and retry limits.
/implementExecutes the implementation plan using DAG-based workflow execution, orchestrating via Supervisor that delegates to State Analyst and dispatches domain agents until final validation and completion.
/executeExecutes implementation plans systematically: loads plan, runs tasks in dependency order with checkpoints, validates against criteria, tracks progress, and reports metrics. Supports --task, --resume, --phase options.
Share bugs, ideas, or general feedback.
Before anything else, fire the one-shot token-reduction wizard. Idempotent — prints once on first install, then no-ops forever. Suppressed when /forge:watch is rendering its own banner (R004.AC6).
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-wizard.cjs" --forge-dir .forge
Launch the autonomous implementation loop. Reads the frontier, implements tasks one by one, and relies on the Stop hook state machine to drive iteration until all tasks are complete.
Live status header. Every iteration of /forge:execute is automatically prefixed with a compact dashboard-style status block (phase, current task + step, agent, progress bar, tokens, per-task budget, lock status). You see what forge is doing without leaving Claude Code or running a separate command. The block is generated by scripts/forge-status-block.cjs, called from the Stop hook on every iteration. Opt out by setting execute.status_header: false in .forge/config.json. For a fullscreen ANSI dashboard in a separate terminal window, use /forge:watch instead.
budget_exhausted phase with a handoff doc at .forge/resume.md..forge/worktrees/{task-id}/ and is squash-merged on success.node scripts/forge-tools.cjs headless execute --help for non-interactive usage with exit codes.The Forge workflow is strictly sequential: brainstorm -> plan -> execute. These pre-flight checks enforce that the prior phases completed correctly. If any check fails, stop and tell the user what to run first.
Verify .forge/ exists. If it does not, stop and tell the user:
.forge/not found. Run/forge brainstormfirst to generate specifications, then/forge planto create task frontiers.
Verify .forge/specs/ contains at least one spec file. If not, stop and tell the user:
No specs found. Run
/forge brainstormfirst.
Verify ALL spec files have status: approved in their YAML frontmatter. Read each spec-*.md file and parse its frontmatter. If ANY spec does not have status: approved, stop and tell the user:
Unapproved specs found: {list}. The brainstorm workflow must complete with explicit user approval before execution. Run
/forge brainstormand approve an approach.
This is the critical gate that prevents skipping the interactive brainstorm Q&A. A spec only gets status: approved when the brainstorming skill writes it after the user explicitly approves an approach.
Verify .forge/plans/ contains at least one *-frontier.md file. If not, stop and tell the user:
No task frontiers found. Run
/forge planfirst to decompose specs into tasks.
Verify each approved spec has a corresponding frontier file. For each spec-{domain}.md, check that .forge/plans/{domain}-frontier.md exists. If any spec is missing a frontier, stop:
Spec "{domain}" has no task frontier. Run
/forge planto decompose it into tasks.
Check for Ralph Loop conflict: if .claude/ralph-loop.local.md exists, stop and tell the user:
Ralph Loop is active. Run
/cancel-ralphfirst — only one loop plugin should be active at a time.
Run programmatic validation as a final safety check:
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-tools.cjs" validate-workflow --forge-dir .forge
If this returns errors, stop and report them. This validates the same checks in code, preventing agent-level bypasses.
Parse flags from $ARGUMENTS:
| Flag | Default | Description |
|---|---|---|
--autonomy full|gated|supervised | Value from .forge/config.json (default: gated) | When to pause for human review |
--max-iterations N | Value from config (default: 100) | Maximum stop-hook iterations before forced exit |
--token-budget N | Value from config (default: 500000) | Total token budget for execution |
--depth quick|standard|thorough | Value from config (default: standard) | Quality/ceremony level |
--filter NAME | (all specs) | Only execute tasks for specs whose domain matches NAME |
--record-baselines | false | Mark this run as the first-successful-visual-AC path: visual verifier will save baselines instead of comparing. Consumed by T020 (visual verification gate, R007). When present, setup-state sets record_baselines: true in .forge/state.md frontmatter. |
If a flag is not provided, fall back to .forge/config.json, then to the built-in default.
.forge/config.json for project settings (repos, loop circuit breakers, review settings, etc.)..forge/capabilities.json if it exists, to know which MCP servers and skills are available for execution..forge/plans/ (filtered by --filter if provided).--filter domain if given, otherwise the first frontier file alphabetically.These checks run automatically. Do not skip them.
Design system: Check if DESIGN.md, design.md, or docs/DESIGN.md exists in the project root. If found, read it and store the path in .forge/state.md frontmatter as design_system: {path}. All UI tasks will automatically receive design constraints during execution and review.
Knowledge graph: Check if graphify-out/graph.json exists. If not, check if graphify is installed and build a graph:
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-tools.cjs" graph-status
# If available and no graph exists:
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-tools.cjs" graph-build --project-dir .
If a graph exists (either pre-existing or just built), note it in .forge/state.md frontmatter as knowledge_graph: graphify-out/graph.json. The executor will query it for focused context, the reviewer for blast radius analysis, using the graph-query and graph-dependents CLI commands.
Neither is required. If absent, execution proceeds with standard behavior. If present, they enhance every task automatically without any user action.
Run setup-state to create .forge/.forge-loop.json and prepare .forge/state.md for execution:
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-tools.cjs" setup-state \
--forge-dir .forge \
--spec "{first-spec-domain}" \
--autonomy "{resolved-autonomy}" \
--depth "{resolved-depth}" \
--max-iterations "{resolved-max-iterations}" \
--token-budget "{resolved-token-budget}" \
--completion-promise "FORGE_COMPLETE" \
${RECORD_BASELINES:+--record-baselines}
This sets phase: executing in state.md and creates the loop file that activates the Stop hook. When --record-baselines is passed from /forge:execute, setup-state stamps record_baselines: true into state.md frontmatter; T020's visual verifier reads that flag to switch from compare-mode to record-mode on the first passing visual AC.
When the resolved autonomy is full, the executor spawns a detached TUI session so a long unattended run has live visibility without blocking stdout. This is a no-op for gated and supervised modes, so the manual /forge:watch path is preserved.
Invoke the helper after setup-state runs and before handing off to forge:executing:
node "${CLAUDE_PLUGIN_ROOT}/scripts/forge-tui-attach.cjs" \
--autonomy "{resolved-autonomy}" \
--forge-dir .forge
The helper decides what to do based on the environment (spec R003):
| Condition | Action |
|---|---|
autonomy !== "full" | Silent no-op. Manual flow unchanged. |
.forge/config.json has tui.auto_attach: false | Silent no-op. Opt-out flag respected. Default when absent is true. |
process.platform === "win32" | Print Monitor progress with: /forge:watch to stdout and continue headless. No fork attempt. |
tmux not on $PATH (non-Windows) | Print Monitor progress with: /forge:watch to stdout and continue headless. |
Unix + tmux available | Start a detached session named forge-tui-<pid> running the TUI command, print Attach: tmux attach -t forge-tui-<pid> to stdout. Does not block. |
The helper always exits 0; /forge:execute never stalls waiting on it. If tmux spawn itself fails, the helper writes a diagnostic to stderr and falls back to the headless message so the loop keeps moving.
.forge/plans/{spec-domain}-frontier.md.forge/state.md with current_task: {task-id} and task_status: pending.Before each Agent tool invocation during execution, the orchestrator MUST resolve the per-phase model + effort hint via scripts/forge-router.cjs::writeHandoff and pass the resulting model to the Agent tool.
For every Agent dispatch (executor, researcher, reviewer, verifier, complexity, planner sub-tasks), do this immediately before the call:
writeHandoff(forgeDir, taskId, role, complexityOrTask). Pass either a pre-classified object (from classifyTask) or the raw task object — writeHandoff accepts both. This writes .forge/handoff.{task_id}.json containing { model, effort, max_tokens, role, task_id } (or the legacy 3-field shape { model, role, task_id } when FORGE_TOKEN_OPT=0).model field and pass it to the Agent tool's model parameter where the harness supports it.effort and max_tokens hints are recorded in the handoff file for forward-compat. If the Agent tool does not currently accept an effort parameter, behavior is unchanged from today — when the harness adds support, downstream tooling picks the hint up automatically by reading the handoff file.Do NOT modify agents/forge-*.md, skills/*/SKILL.md, or CLAUDE.md to surface the hint — the handoff JSON is the only plumbing point for this spec. The R003 acceptance criteria explicitly forbid touching those files.
Now invoke the forge:executing skill to begin working on the first task.
Pass to the skill:
The skill handles the per-task implementation cycle: read spec, implement, test, review, commit, update state.
From this point forward, the Stop hook takes over. After each Claude response, the Stop hook in hooks/stop-hook.sh:
.forge/.forge-loop.json and .forge/state.mdforge-tools.cjs route to determine the next actionThe state machine handles all transitions: implementing, testing, reviewing, fixing, debugging, advancing to the next task, verifying specs, and completing the loop. See Section 5.3 and 6.2 in the design spec for the full state machine table.
| Mode | Behavior |
|---|---|
full | Runs unattended until all tasks are complete, blocked, or budget exhausted. Never pauses between tasks or specs. |
gated | Pauses between specs/phases for human review. Runs autonomously within a single spec. |
supervised | Pauses after every task. Human must /forge resume to continue. Good for critical code or first runs. |
When ALL tasks across ALL specs (or the filtered subset) are genuinely complete and verified:
Output the completion promise exactly as shown:
<promise>FORGE_COMPLETE</promise>
CRITICAL: Only output the completion promise when:
complete in state.mdDo NOT output the promise prematurely. If tasks remain, the stop hook will continue driving execution. If you are blocked or uncertain, update state.md with the blocker and let the stop hook handle it.
After starting execution, present a brief launch summary:
Forge Execute — Starting
---
Spec: {domain}
Tasks: {N} total ({M} in first tier)
Depth: {quick|standard|thorough}
Autonomy: {full|gated|supervised}
Token budget: {N}
Max iterations: {N}
Starting task {T001}: {task name}...
Then immediately begin working on the first task. The stop hook handles everything after that.