Skip to content

/spawn + /new Workflow Audit, 2026-06-11

URL: https://mkdocs.justinsforge.com/memory/handoffs/spawn-new-workflow-audit-2026-06-11/

You are a Fable 5 worker. Justin wants a deep audit of the /spawn and /new remote-worker spawning workflow: what it is trying to achieve, whether it is wired effectively, and how to improve it. This is a think-hard + research + recommend job, not a code-it-now job. Produce a written audit with concrete, prioritized recommendations. Do NOT change any production code without flagging it first; you may write the audit doc and a proposed-changes section.

What the workflow is trying to achieve

Justin spawns Claude Code sessions on Console (the dev VM) as remote workers he can drive from anywhere (CLI + Remote Control web UI + Telegram remote-bridge bot). Goals: near-instant worker startup, reliable prompt delivery, correct model selection, a working claude.ai/code URL, and clean lifecycle (no orphans, no poisoned tmux sockets). /new is the warm-pool fast path (~1s claim of a pre-booted Opus). /spawn is the full boot with model/name/prompt.

Source material to read first

  • Skill: forge/.claude/skills/spawn/SKILL.md (the canonical lessons-learned list, read every bullet)
  • Skill: forge/.claude/skills/new/ (warm-pool claim)
  • Skill: forge/.claude/skills/sessions/ (lifecycle: list/kill/status/log/budget)
  • Script: forge/scripts/forge_spawn_session.sh (the shared implementation, also called by the remote-bridge bot)
  • Supporting: forge_tmux_socket_sweep.sh, the warm-pool seeder, the orphan-claude reaper, /rebridge, /resume
  • Memory: reference_spawn_pool, reference_orphan_claude_reaper.md, reference_rebridge_skill.md, reference_tmux_focus_events_required.md, reference_console_sandbox_drift.md, reference_console_binary_avx2_constraint.md, feedback_reboot_preflight_tmux_socket_wipe.md, feedback_remote_session_spawning.md, project_spawn_cgroup_migration_2026_05_04.md
  • Known live pain point (observed today 2026-06-11): on a loaded Console the prompt-typing step races the TUI redraw and stacks the prompt 3x without submitting (the C-u retry path), forcing a manual clear-and-resend. The paste-chip detection refinement from 2026-06-08 did not fully fix it. Treat this as a priority bug to root-cause.

Research mandate (use Claude's own current capabilities)

Justin specifically wants you to research NEW things and tools from Claude itself and check we are wiring this effectively. Investigate whether the current tmux-send-keys-into-a-TUI approach is still the right primitive, or whether newer first-party mechanisms make it obsolete or more robust. Look into (via WebFetch/WebSearch on official Anthropic docs): - Claude Agent SDK (headless/programmatic session spawning, claude -p pipe mode) vs driving the interactive TUI with send-keys - Claude Code SDK / headless mode, background tasks, and any official session/resume APIs - Remote Control / web session internals: is there a supported way to create a bridged session without screen-scraping the TUI - Any first-party MCP or hooks mechanism that would replace the brittle "type prompt, verify prefix, press Enter" dance - Warm-pool best practices and whether Anthropic ships anything that makes pre-booting unnecessary

Cite official sources. Flag where Forge is fighting the tool vs working with it.

Deliverable

Write forge/memory/handoffs/spawn-new-workflow-audit-findings-2026-06-11.md containing: 1. What we're achieving (restate the goal + current architecture in your words) 2. What works well (keep list) 3. Failure modes + root causes (the typing race first, plus sockets, orphans, boot timeouts, cgroup migration loose ends) 4. First-party alternatives (SDK / headless / supported APIs) with a recommendation on whether to migrate off send-keys, partially or fully 5. Prioritized improvements (P0/P1/P2, each with the exact file to touch and a one-line rationale) 6. Open questions for Justin

Append the mkdocs URL line at the top of that file. When done, push a one-line notify with the file path. Do not edit production scripts in this pass; recommend, don't ship.

Start

Read the source material, run the research, write the findings doc, notify. Think hard about the typing-race root cause specifically; it bit Justin today.