Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/claude/claudeLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,20 @@ export async function claudeLocal(opts: {
args.push('--allowedTools', opts.allowedTools.join(','));
}

// Add custom Claude arguments
if (opts.claudeArgs) {
args.push(...opts.claudeArgs)
}

// Add hook settings for session tracking (when available)
// IMPORTANT: This must come BEFORE claudeArgs so that positional arguments
// (like prompts) in claudeArgs are placed at the end
if (opts.hookSettingsPath) {
args.push('--settings', opts.hookSettingsPath);
logger.debug(`[ClaudeLocal] Using hook settings: ${opts.hookSettingsPath}`);
}

// Add custom Claude arguments
// These go LAST so positional arguments (prompts) are at the end
if (opts.claudeArgs) {
args.push(...opts.claudeArgs)
}

if (!claudeCliPath || !existsSync(claudeCliPath)) {
throw new Error('Claude local launcher not found. Please ensure HAPPY_PROJECT_ROOT is set correctly for development.');
}
Expand Down
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ ${chalk.bold('To clean up runaway processes:')} Use ${chalk.cyan('happy doctor c
console.error(chalk.red(`Invalid --claude-env format: ${envArg}. Expected KEY=VALUE`))
process.exit(1)
}
} else if (arg === '--claude-arg') {
// Pass specific argument to Claude CLI
if (i + 1 >= args.length) {
console.error(chalk.red(`Missing value for --claude-arg`))
process.exit(1)
}
const claudeArg = args[++i]
options.claudeArgs = options.claudeArgs || []
options.claudeArgs.push(claudeArg)
} else {
// Pass unknown arguments through to claude
unknownArgs.push(arg)
Expand Down