-
-
Notifications
You must be signed in to change notification settings - Fork 296
Add support for CLAUDE_CONFIG_DIR environment variable #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add support for CLAUDE_CONFIG_DIR environment variable #112
Conversation
This adds support for the CLAUDE_CONFIG_DIR environment variable used by Claude Code (Anthropic's official CLI), enabling claude-monitor to work with Claude Code's configuration directory structure. The changes: - Add import os for environment variable access - Modify get_standard_claude_paths() to check CLAUDE_CONFIG_DIR first - Support running from within a .claude directory - Add Claude Code's default ~/.claude location to search paths - Maintain backward compatibility with existing paths This enables users to monitor multiple Claude Code instances in a tmux dashboard by setting different CLAUDE_CONFIG_DIR values. Tested with multiple Claude Code configurations and confirmed backward compatibility. Co-authored-by: Steve Antonakakis <[email protected]>
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (6)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Additional Context on CLAUDE_CONFIG_DIRFor reference, here are some official Anthropic Claude Code issues that discuss
The environment variable is actively used by the Claude Code community for managing multiple installations, though it appears to have some implementation quirks (requiring full paths instead of relative paths). This PR makes claude-monitor compatible with this Claude Code feature, allowing users to monitor different Claude Code configurations as intended. |
Add support for CLAUDE_CONFIG_DIR environment variable
Summary
This PR adds support for the
CLAUDE_CONFIG_DIRenvironment variable used by Claude Code (Anthropic's official CLI), enabling claude-monitor to work with Claude Code's configuration directory structure.Problem
Currently, claude-monitor only looks for data in:
~/.claude/projects~/.config/claude/projectsHowever, Claude Code uses a different structure where:
CLAUDE_CONFIG_DIR.claudedirectory is directly used, not aprojectssubdirectorySolution
Modified the
get_standard_claude_paths()function to:CLAUDE_CONFIG_DIRenvironment variable first.claudedirectory~/.claudelocation to the search pathsChanges
Testing
Tested with multiple Claude Code configurations:
CLAUDE_CONFIG_DIR=$HOME/ccmax.pdi01 claude-monitor✓CLAUDE_CONFIG_DIR=$HOME/cc_pers claude-monitor✓cd ~/.claude && claude-monitor✓Use Case
This enables users to monitor multiple Claude Code instances in a tmux dashboard:
Author
Steve Antonakakis ([email protected]) on behalf of AeyeOps
Backward Compatibility
All existing functionality is preserved. The changes only add new search paths and do not modify the behavior for users not using Claude Code.
Summary by CodeRabbit
New Features
Chores