Skip to content

feat: make Claude config directory configurable via CLAUDE_CONFIG_DIR - #14

Open
langburd wants to merge 1 commit into
alexmt:mainfrom
langburd:feat/make-claude-directory-configurable
Open

feat: make Claude config directory configurable via CLAUDE_CONFIG_DIR#14
langburd wants to merge 1 commit into
alexmt:mainfrom
langburd:feat/make-claude-directory-configurable

Conversation

@langburd

Copy link
Copy Markdown

Closes #13

Summary

  • Add ClaudeDir() helper in internal/store/config.go that returns CLAUDE_CONFIG_DIR if set, otherwise ~/.claude
  • Replace all 7 hardcoded filepath.Join(home, ".claude", ...) call sites across 5 files with ClaudeDir()
  • Remove now-unnecessary os.UserHomeDir() calls and their error handling from each affected function
  • Add ## Configuration section to README documenting CLAUDE_CONFIG_DIR

Implementation notes

  • ClaudeDir() is the single source of truth for the config directory path; all store and TUI functions call it instead of resolving home + .claude themselves
  • No function signatures changed — this is a drop-in replacement at each call site
  • internal/store/settings.go is unaffected (uses ~/.config/claude-ls/, not the Claude config dir)
  • README also gets minor code-block language tag fixes (bash, text) as incidental cleanup

Centralize config directory resolution into a new ClaudeDir() function
that honors the CLAUDE_CONFIG_DIR environment variable, falling back to
~/.claude/. Replace scattered os.UserHomeDir() calls across reader,
preview, rename, move, and delete operations with ClaudeDir(). Propagate
resolution errors instead of silently falling back. Update README with
configuration docs and fix markdown code fence languages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support CLAUDE_CONFIG_DIR environment variable to override ~/.claude base path

1 participant