feat: add configurable working directory and Claude data path#91
Open
heman22union wants to merge 1 commit into
Open
feat: add configurable working directory and Claude data path#91heman22union wants to merge 1 commit into
heman22union wants to merge 1 commit into
Conversation
- working_directory: set where Claude starts (default /config) - prompt_working_directory: prompt user to confirm/change dir on each open - claude_data_path: move ~/.claude data out of /data into a user-specified path (e.g. /config/.claude-data) so sessions are accessible over SMB and survive HA migrations - adds pick-working-dir.sh script for the interactive dir prompt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
4 tasks
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.
Summary
Three new options, all backwards-compatible (defaults preserve existing behaviour):
working_directory— directory Claude starts in (default/config). Useful if your work lives in a subdirectory like/config/ai_repo.prompt_working_directory— whentrue, prompts you to confirm or change the working directory on every session open, showing the last-used path as the default.claude_data_path— relocate~/.claudesession/config data out of/data(container-only, not visible to ha filesystem or over SMB) into a user-specified path such as/config/.claude. Makes sessions accessible over SMB and portable across HA migrations or reinstalls.Adds
scripts/pick-working-dir.shwhich handles the interactive directory prompt and persists the last choice to$ANTHROPIC_HOME/last-working-dir.Motivation
Currently the addon stores all Claude data under
/data, which is the container's private persistent volume. This means session history and project files are invisible over SMB and lost if you migrate or reinstall HA. Moving data to/configsolves both problems.Test notes
Tested on 2.2.x with
claude_data_path: /config/.claudeandworking_directory: /config/ai_repo. A few things discovered during testing worth noting for reviewers:HOME,XDG_*,ANTHROPIC_*) are derived fromclaude_data_pathso they stay consistent — no hardcoded/datapaths remainlast-working-dirstate file is stored under$ANTHROPIC_HOMEso it persists across restarts whenclaude_data_pathpoints to/configTest plan
/config, uses/datafor Claude data)working_directory: /config/ai_repolands Claude in that directory on openprompt_working_directory: trueshows prompt; Enter confirms last-used dir; choice persists across restartsclaude_data_path: /config/.claudecreates directory structure there and Claude stores sessions/config under itclaude_data_pathis under/configclaude_data_pathis set