Skip to main content
Configuration management tools help you maintain, validate, and switch between different Claude Code configurations, ensuring your rules and settings work correctly across projects.

Available Tools

claude-rules-doctor

CLI that detects dead .claude/rules/ files by checking if glob patterns match actual files in your repo

ClaudeCTX

Switch your entire Claude Code configuration with a single command

claude-rules-doctor

Validate your Claude Code rules configuration to catch silent failures and ensure rules apply correctly.

Key Features

Dead Rule Detection

Identifies rules with paths: globs that don’t match any files in your repository

CI Integration

CI mode exits with code 1 when dead rules are found, perfect for automated checks

JSON Output

Machine-readable output format for integration with other tools

Verbose Mode

Show which files are matched by each rule for debugging

Common Issues Detected

When you rename a directory but forget to update the glob patterns in your rules:
# .claude/rules/frontend.md
paths:
  - src/client/**  # Directory was renamed to src/app/
claudeclaude-rules-doctor will detect this rule never applies.
Typographical errors in path specifications:
paths:
  - src/compnents/**  # Typo: should be "components"
The rule silently fails to apply, but claude-rules-doctor catches it.
Rules pointing to files or directories that no longer exist:
paths:
  - legacy/api/**  # This directory was removed

Usage Examples

clauderules-doctor

Workflow Integration

Integrate claude-rules-doctor into your development workflow:
1

Pre-commit Hook

Add to .git/hooks/pre-commit to validate rules before committing
2

CI Pipeline

Run with --ci flag in your GitHub Actions or GitLab CI pipeline
3

Regular Audits

Schedule periodic checks, especially after refactoring directory structures

ClaudeCTX

Quickly switch between different Claude Code configurations for different projects or contexts.

Key Features

Single Command

Switch entire configuration with one command

Configuration Sets

Manage multiple complete configuration sets

Fast Switching

Instant context changes without manual file editing

Project Isolation

Keep configurations separate per project or workflow

Use Cases

Switch between different project configurations:
  • Frontend project with React-specific rules
  • Backend project with API development rules
  • Data science project with notebook-specific settings
Each project can have its own complete configuration set.
Adapt your configuration to your current task:
  • Development mode: Full features enabled
  • Review mode: Focused on code review rules
  • Documentation mode: Writing and editing docs
  • Debugging mode: Specialized debugging tools
Share and switch between team-standardized configurations:
  • Team A’s coding standards
  • Team B’s workflow preferences
  • Company-wide defaults
  • Personal customizations
Test new configurations without losing your working setup:
  • Create experimental configuration
  • Switch to test new rules/commands
  • Easily revert to stable configuration

Typical Workflow

1

Create Configuration Sets

Set up different complete configurations for various contexts
2

Name Your Configs

Give each configuration a descriptive name (e.g., “frontend”, “backend”, “docs”)
3

Switch as Needed

Use ClaudeCTX to instantly switch between configurations
4

Update Independently

Maintain and update each configuration set separately

Best Practices

Regular Validation

Run claude-rules-doctor regularly, especially after:
  • Directory restructuring
  • Large refactoring
  • Adding new rules
  • Merging branches

Configuration Versioning

Keep your configuration sets in version control:
  • Track changes over time
  • Share with team members
  • Rollback if needed

Documentation

Document your configuration sets:
  • What each config is for
  • When to use it
  • Special considerations

Automated Checks

Automate configuration validation:
  • CI pipeline checks
  • Pre-commit hooks
  • Scheduled audits

Integration Example

Combine both tools for robust configuration management:
#!/bin/bash
# .git/hooks/pre-commit

# Validate rules before committing
claude-rules-doctor --ci

if [ $? -ne 0 ]; then
  echo "❌ Dead rules detected. Fix before committing."
  exit 1
fi

echo "✅ All rules are valid"

Troubleshooting

Use claude-rules-doctor to check if:
  • Glob patterns match actual files
  • File paths are correct
  • Rules are in the right location
When switching with ClaudeCTX:
  • Ensure configurations don’t overlap unexpectedly
  • Check for conflicting rules
  • Verify MCP server compatibility
Common causes detected by claude-rules-doctor:
  • Renamed directories
  • Typos in paths
  • Deleted files
  • Case sensitivity issues

Build docs developers (and LLMs) love