start-build

A command for starting a development phase with recorded coordination and an isolated Git worktree. A Git worktree is a separate working directory linked to the same repository, useful for parallel changes.

In plain words
What is it for?
Use it to start a phase, optionally load a specification, claim files or branches, create a worktree, and check active sessions for conflicts.
Why use it?
It helps multiple coding sessions avoid stepping on each other's files and checks for stale sessions or conflicts before work begins.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rajconnects/founder-stack/start-build
Clone the repo
git clone --depth 1 https://github.com/rajconnects/founder-stack
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,221 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.01221
Opus 5 $0.00021 $0.00611
Sonnet 5 $0.00008 $0.00244
Haiku 4.5 $0.00004 $0.00122

Measured 2d ago against content hash 58c4a55b893a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

start-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workflow/commands/start-build.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are starting a phase build. This command makes parallel-session coordination mechanical.

Arguments: $ARGUMENTS

Steps

  1. Parse arguments. First positional = phase id (e.g., 7a, docs-cleanup). Optional flags:

    • --severity major|minor (default: ask the user — major = siblings pause; minor = siblings proceed with caution)
    • --spec <path> (optional — if given, run /spec-intake <path> first; otherwise ask the user for plan summary)

    If phase id missing, fail fast: /start-build requires a phase id. Example: /start-build 7a --severity major.

  2. Pre-sweep stale rows. Read .claude/coordination.json. For each row with status: active:

    • Compute heartbeat age. If older than _doc.staleness_threshold_minutes (default 10), flip to completed_unclean, set completed timestamp, and note worktree path for cleanup.
    • For each completed_unclean row whose worktree path still exists on disk: run git worktree remove --force <path>. If removal fails, log the path so the user can investigate.
  3. Conflict check. Among remaining status: active rows:

    • If any row has severity: majorsurface to the user with the row's plan_summary, branch, and claims. Ask: "Session <id> is running a major build on <branch>. Pause this build or proceed with caution?" — let the user decide.
    • If any row has severity: minor and its claims.files glob-overlap your intended claims → surface the overlap and ask the user how to proceed.
    • If no overlap and no major sibling → proceed silently.
  4. Run intake (if not done).

    • If --spec provided: invoke /spec-intake <spec> and use its plan as the basis.
    • Otherwise: ask the user for a one-line plan_summary, plus rough claims (files as globs, branches that will be pushed, remote ops like migration or deploy:staging).
  5. Capture session id.

    • Read $CLAUDE_SESSION_ID from environment. If unset, ask the user to paste the resume id from the most recent /resume output (they can run /resume and copy the uuid).
    • Generate a new short id for id (e.g., sess- + first 8 chars of a uuid).
  6. Create the worktree.

    • Branch name: phase id (e.g., phase-7a-app-shell) or as user specifies.
    • Worktree path: sibling to the repo root, named ../<repo-basename>-<branch-slug>.
    • Run: git worktree add <worktree-path> -b <branch-name> (or without -b if branch already exists).
    • If git worktree add fails (branch exists in another worktree, dirty state, etc.), surface the error and stop — do not write the session row until the worktree exists.
  7. Write the session row to .claude/coordination.json:

    {
      "id": "sess-<id>",
      "resume_id": "<CLAUDE_SESSION_ID>",
      "status": "active",
      "severity": "<major|minor>",
      "phase": "<phase-id>",
      "branch": "<branch-name>",
      "worktree": "<absolute-worktree-path>",
      "plan_summary": "<one-line>",
      "claims": { "files": [...], "branches": [...], "remote_ops": [...] },
      "started": "<ISO-8601 now>",
      "heartbeat": "<ISO-8601 now>"
    }
    

    Append to sessions array. Preserve all other rows untouched.

  8. Print handoff to the user:

    ✅ Build claim recorded: sess-<id> (severity: <major|minor>)
    Worktree: <absolute path>
    Branch:   <branch>
    Plan:     <summary>
    
    Next: cd '<worktree path>' and continue work there.
    To close this build: /handoff <phase-id>
    

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 77 lines · 42 tokens per session scan A 58c4a55b893a

Subscribe to this mod's changes

start-build is a command published in the GitHub repository rajconnects/founder-stack (2 stars, last pushed 1mo ago), licensed MIT. It adds 42 tokens to every session and 1,221 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.