Repository navigation
Write the Claude Code entry to the directory CLAUDE_CONFIG_DIR names - #173
Open
sohan-bhat wants to merge 2 commits into
Open
sohan-bhat wants to merge 2 commits into
sohan-bhat wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Problem
Claude Code keeps
.claude.jsonin the home directory, or in the directoryCLAUDE_CONFIG_DIRnames. People set that variable to keep two Claude accounts on one computer. 327 public.zshrcfiles on GitHub set the variable.With the variable set,
proofline agent install claude-codewrites nothing and stops.The one-command setup,
curl -fsSL https://proofline.sh/cli | sh -s -- --setup, skips Claude Code for the same reason, so the person has to copy the entry by hand.Change
runinsrc/agent.rspasses the directory an absoluteCLAUDE_CONFIG_DIRnames toinstallin place of the home directory.Layoutthen targets.claude.jsonin that directory, and every check insrc/agent/store.rsapplies there unchanged, including the symlink, Git working tree, size, read-only and drift checks.I checked each case against Claude Code 2.1.337 with
claude mcp add --scope user, in a scratchHOME.CLAUDE_CONFIG_DIR~/.claude.json.claude.jsonin that directory--printis unchanged.CODEX_HOMEis unchanged, because Codex lays the directory out differently and I have no Codex installation to verify against.Testing
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass, 289 tests on macOS.tests/agent_install.rsruns the shipped binary.claude_config_dir_selects_the_file_claude_code_reads. An absolute value receives the entry and keeps the existing settings, the home directory gets no file, an empty value writes to the home directory, and a missing directory is refused and not created.unattended_confirmation_keeps_refusals_and_manual_previewnow uses a relative value and checks the message.On macOS two tests in that file fail on
mainas well (#112), so I ran the suite withTMPDIRon a path without a symlink.End to end with the real Claude Code, in a scratch
HOME($Sis a scratch directory).Proofline review
I ran Proofline on this change in my fork, sohan-bhat#1. The first run reported one finding.
The finding is right about the failure. A missing directory reached
Layout::newand failed with "could not resolve the user home", which names the wrong thing.I disagreed with the suggested fix. Creating the directory means a typo in
CLAUDE_CONFIG_DIRproduces a new profile that Claude Code never reads, and resolving from the nearest ancestor changesLayoutfor every client. Claude Code creates the directory on its first run, so I kept the refusal and made the message say that.The second run, on the updated commit, reported no new findings. The first finding stays open in Proofline, because the install still stops for a missing directory, which is the behaviour I chose.