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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user