Fix: Add -p flag when spawning Claude with a prompt

Without -p flag, Claude expects input from stdin and fails with:
"Input must be provided either through stdin or as a prompt argument"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
RichardDillman
2025-12-07 16:21:36 -05:00
parent 0ce65d7120
commit 93d65d9a34

View File

@@ -78,7 +78,9 @@ export async function spawnClaude(
const projectEnv = loadEnvFile(project.path);
// Spawn Claude Code
const claudeProcess = spawn('claude', initialPrompt ? [initialPrompt] : [], {
// Use -p flag to pass prompt, otherwise Claude expects stdin
const args = initialPrompt ? ['-p', initialPrompt] : [];
const claudeProcess = spawn('claude', args, {
cwd: project.path,
stdio: ['ignore', 'pipe', 'pipe'],
detached: true,