What feature would you like to see?
Add a persisted claudeCodePath field to ~/.hapi/settings.json, resolved by getDefaultClaudeCodePath() alongside the existing HAPI_CLAUDE_PATH env var.
Additional information
HAPI_CLAUDE_PATH is read from process.env, which is frozen at process startup. The runner is a long-lived daemon, so its env is fixed at the time it was first spawned — updating the variable in a shell after the fact never reaches it. This is the source of #425 and #229, and forces users to hapi runner stop + start + manually kill stale child sessions. Setting it once in shell rc avoids the issue, but switching binaries or onboarding mid-flow is awkward.
Proposal:
-
Add claudeCodePath?: string to Settings in cli/src/persistence.ts.
-
In getDefaultClaudeCodePath() (cli/src/claude/sdk/utils.ts), resolve in order env override → settings → PATH probe:
export function getDefaultClaudeCodePath(): string {
if (process.env.HAPI_CLAUDE_PATH) return process.env.HAPI_CLAUDE_PATH;
const settings = readSettingsSync();
if (settings.claudeCodePath) return settings.claudeCodePath;
// existing PATH probing...
}
-
(Optional) hapi config set claude-path <path> for ergonomic writes.
Because getDefaultClaudeCodePath() runs per claude spawn (per user message in remote mode), settings.json is read fresh — switching binaries takes effect on the next message, no restart, no session kill. HAPI_CLAUDE_PATH stays as the highest-priority override for backward compat. The pattern extends naturally to future HAPI_*_PATH agents.
Happy to send a PR if the direction looks good.
What feature would you like to see?
Add a persisted
claudeCodePathfield to~/.hapi/settings.json, resolved bygetDefaultClaudeCodePath()alongside the existingHAPI_CLAUDE_PATHenv var.Additional information
HAPI_CLAUDE_PATHis read fromprocess.env, which is frozen at process startup. The runner is a long-lived daemon, so its env is fixed at the time it was first spawned — updating the variable in a shell after the fact never reaches it. This is the source of #425 and #229, and forces users tohapi runner stop+ start + manually kill stale child sessions. Setting it once in shell rc avoids the issue, but switching binaries or onboarding mid-flow is awkward.Proposal:
Add
claudeCodePath?: stringtoSettingsincli/src/persistence.ts.In
getDefaultClaudeCodePath()(cli/src/claude/sdk/utils.ts), resolve in order env override → settings → PATH probe:(Optional)
hapi config set claude-path <path>for ergonomic writes.Because
getDefaultClaudeCodePath()runs perclaudespawn (per user message in remote mode), settings.json is read fresh — switching binaries takes effect on the next message, no restart, no session kill.HAPI_CLAUDE_PATHstays as the highest-priority override for backward compat. The pattern extends naturally to futureHAPI_*_PATHagents.Happy to send a PR if the direction looks good.