opencode
opencode copied to clipboard
feat: support CLAUDE_CONFIG_DIR environment variable
Summary
- Adds support for
CLAUDE_CONFIG_DIRenvironment variable - Falls back to
~/.config/claude(new Claude Code default) then~/.claude(legacy) - Fixes ENOTDIR error when
~/.claudeis a file instead of directory
Fixes #6551
Changes
- Added
CLAUDE_CONFIG_DIRto Flag namespace - Added
Global.claudeConfigDir()function with proper fallback logic - Updated
system.tsto use dynamic path for CLAUDE.md - Updated
skill.tsto use dynamic path for skills directory - Added unit tests for the new logic
Testing
- Added unit tests covering all fallback scenarios (8 tests, all passing)
- Manually tested with
CLAUDE_CONFIG_DIRset to custom path