feat(spawn): configurable CLAUDE_CONFIG_DIR for hands-free multi-account claude launch#634
Open
tkt028 wants to merge 2 commits into
Open
feat(spawn): configurable CLAUDE_CONFIG_DIR for hands-free multi-account claude launch#634tkt028 wants to merge 2 commits into
tkt028 wants to merge 2 commits into
Conversation
kunchenguid#599) On a multi-account machine the default ~/.claude can be empty or unauthenticated, so a bare-`claude` crewmate lands on the login wall and never starts. Add a local, gitignored config/crew-config-dir knob naming the Claude config dir a claude crewmate authenticates with; when set, fm-spawn prefixes the claude launch command with CLAUDE_CONFIG_DIR=<dir>. The prefix is claude-harness only and scoped to the firstmate-launched agent, so it never mutates the captain's global config. An absent or empty knob is byte-identical to prior behavior (bare `claude`, default config dir). A backward-compat test drives the launch-string construction in both directions.
…d#599) Describe the local, gitignored config/crew-config-dir file in the harness support section: it names the Claude config dir a spawned claude crewmate authenticates with, is claude-harness only, and is byte-identical to prior behavior when absent or empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #599
Problem
bin/fm-spawn.sh's claude launch template runs bareclaude, which resolves to the default config dir (~/.claude). On a machine with multiple Claude accounts — where auth lives in alternate config dirs and the default~/.claudeis empty/unauthenticated — a spawned crewmate lands on the "Select login method" wall and can never start. There was no way to tell fm-spawn which authenticated config dir a claude crewmate should use.Change
Add a local, gitignored
config/crew-config-dirknob naming the Claude config dir (CLAUDE_CONFIG_DIR) a spawnedclaudecrewmate authenticates with. When set,fm-spawnprefixes the claude launch command withCLAUDE_CONFIG_DIR=<dir>, while still appending its own autonomy and brief args unchanged.__CLAUDECONFIGDIR__placeholder lives solely in the claude launch template; every other harness ignores the knob.claudeon its default config dir — so single-account machines are unaffected.Tests
tests/fm-spawn-claude-config-dir.test.shdrives a real claude ship spawn throughfm-spawn.shwith a fake tmux that records the literal launch string, and asserts both directions:config/crew-config-dirset → the launch gains theCLAUDE_CONFIG_DIR=<value>prefix in the correct position.CLAUDE_CONFIG_DIRprefix (the byte-identical prior launch).The behavioral assertion drives the launch-string construction rather than grepping for a token, and was negative-tested (it fails when the substitution is removed).
Validation
bin/fm-lint.sh(full shellcheck set, pinned version) — clean.bash -non the wholebin/toolbelt — clean.tasks-axi, optional backends absent) unchanged by this diff.Docs
docs/configuration.mddocuments the knob in the harness support section: what it names, claude-harness-only scope, and the absent-knob backward-compat guarantee.