-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Problem
When passing --add-dir flags to happy, they are not forwarded to the underlying Claude Code process. Claude Code starts but only has access to the primary working directory.
# Works — Claude sees all dirs:
claude --add-dir /path/to/other-repo "prompt"
# Broken — Claude only sees cwd:
happy --add-dir /path/to/other-repo "prompt"The agent confirms only the primary working directory is configured:
"I don't see any extra directories configured in this session — only api is in my working context."
Additional finding
Positional prompt arguments are also not working:
happy --add-dir /tmp "test"
# → Error: Input must be provided either through stdin or as a prompt argument when using --printRoot cause
Traced through the source:
index.ts—--add-diris correctly captured inunknownArgs→options.claudeArgs✅runClaude.ts→loop()→Session—claudeArgsflows through ✅claudeLocalLauncher.ts→claudeLocal.ts—args.push(...opts.claudeArgs)✅claudeRemote.ts—claudeArgsare NOT passed to the SDKquery()call ❌
The SDK's QueryOptions in query.ts has no additionalDirs or equivalent option. When happy switches to remote mode (which happens when the message queue has items), --add-dir is silently dropped.
Even in local mode, the positional prompt arg appears to not reach Claude correctly through the launcher chain.
Proposed fix
- Add
additionalDirs?: string[]toQueryOptionsinquery.ts, mapping to--add-dirflags - In
claudeRemote.ts, extract--add-dirvalues fromclaudeArgsand pass them asadditionalDirs - Ensure positional prompt args work through the local launcher path
Environment
- happy: latest (npm)
- Claude Code: v2.1.63 (Homebrew)
- OS: macOS + Ubuntu (same behavior on both)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels