[PR #6550] feat: support CLAUDE_CONFIG_DIR environment variable #11971

Open
opened 2026-02-16 18:16:54 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6550

State: open
Merged: No


Summary

  • Adds support for CLAUDE_CONFIG_DIR environment variable
  • Falls back to ~/.config/claude (new Claude Code default) then ~/.claude (legacy)
  • Fixes ENOTDIR error when ~/.claude is a file instead of directory

Fixes #6551

Changes

  • Added CLAUDE_CONFIG_DIR to Flag namespace
  • Added Global.claudeConfigDir() function with proper fallback logic
  • Updated system.ts to use dynamic path for CLAUDE.md
  • Updated skill.ts to 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_DIR set to custom path
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6550 **State:** open **Merged:** No --- ## Summary - Adds support for `CLAUDE_CONFIG_DIR` environment variable - Falls back to `~/.config/claude` (new Claude Code default) then `~/.claude` (legacy) - Fixes ENOTDIR error when `~/.claude` is a file instead of directory Fixes #6551 ## Changes - Added `CLAUDE_CONFIG_DIR` to Flag namespace - Added `Global.claudeConfigDir()` function with proper fallback logic - Updated `system.ts` to use dynamic path for CLAUDE.md - Updated `skill.ts` to 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_DIR` set to custom path
yindo added the pull-request label 2026-02-16 18:16:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11971