When dispatching a TT launch-prompt .md file as an autopilot session via claude -p, the prompt content alone is NOT enough — claude -p runs Claude in agent-loop mode only while responses trigger tool calls. Piping just the launch-prompt content leaves Claude with no explicit execute-intent → it responds with a clarifying question → -p exits to shell. The fix: append an execution directive at the END of the piped stdin stream so Claude’s first response is execution (tool calls), keeping the -p agent loop running.
Working pattern (validated 2026-05-23T~10:30 BST for R8-Q + Sprint 1 server dispatches):
cd <worktree> && ( cat <launch-prompt.md>; echo; echo "---"; echo "Execute the launch-prompt above verbatim. Start at §0 PRECONDITION GATE. Apply §4 Decision Matrix + §6 anti-patterns + §7 banned permission-grab phrasing + §8 phase transitions automatic + §9 redirect uncertainty to artifacts. ntfy heartbeats every 15 min to ntfy.sh/davieshq2026 per §8. This message IS the trigger — do not ask permission, do not summarise — execute now."; ) | claude --dangerously-skip-permissions -pTwo prior failure modes (both diagnosed in the 2026-05-23T~10:00-10:30 BST debug sequence):
-
claude -p "$(cat file.md)"— fails when launch-prompt starts with---frontmatter. CLI argument parser sees---title:...as a malformed long-option flag. Error:error: unknown option '---. Fix: use stdin pipe instead of positional arg. -
cat file.md | claude --dangerously-skip-permissions -p— fixes the---parsing error but Claude reads the launch-prompt as a document presented for discussion → first response is “What’s the ask?” / “I’ll wait for your direction” →-pexits one-shot. The launch-prompt’s §7 banned-permission-grab phrasing applies to the EXECUTING session’s runtime behaviour, not to its dispatched session-open response — without explicit execute-intent in stdin, Claude defaults to a clarifying question. Fix: append execution directive as shown above.
How to apply:
- Any autopilot dispatch of a TT launch-prompt file via
claude -pmust use the subshell-concatenation pattern with execution directive as the LAST stdin content. - The
cd <worktree>upfront preserves the per-batch worktree-isolation discipline perfeedback_worktree_isolation_under_concurrent_stormmemory. - Storage of the dispatch command itself is Rich’s concern (per
feedback_keep_meta_prompts_short_for_paste_workflows— do not speculate about his personal tooling). - The execution directive can be tightened or expanded per batch but MUST include: (a) “execute the launch-prompt above verbatim”, (b) “start at §0 PRECONDITION GATE”, (c) “do not ask permission, do not summarise — execute now”. The §-references map to whichever sections the launch-prompt actually carries.
Anti-pattern to avoid: trying to “unstick” a claude -p session that has already returned to shell — that session is gone. Re-dispatch with the working pattern.
Related: feedback-keep-meta-prompts-short-for-paste-workflows (don’t bloat dispatch commands; the directive line is the only thing that matters beyond the launch-prompt content).