@eddybean/ccr
v0.1.1
Published
Claude Code rules manager - discover, install, and manage .claude/rules/ files
Readme
claude-code-rules (ccr)
A CLI tool to discover, install, and manage rule files for Claude Code.
Claude Code dynamically loads .md files placed under .claude/rules/ in your workspace. ccr makes it easy to find, install, and organize these rules — both from a curated built-in collection and from any public GitHub repository.
Features
- Interactive mode — browse and install rules with a guided UI
- Direct mode — install rules in a single command with arguments
pathsfilter support — scope a rule to specific file patterns (e.g.src/backend/**)- GitHub integration — pull rules from any public GitHub repository
- Workspace & user level — install rules per-project or globally (
~/.claude/rules/) - Manage rules — copy, move, and delete rules between workspace and user level
- Multilingual — displays in Japanese or English based on your OS locale
Installation
npm install -g @eddybean/ccrRequires Node.js 18 or later.
Usage
Commands below use ccr. If you haven't installed globally, you can also run any command with npx @eddybean/ccr instead (e.g. npx @eddybean/ccr add).
ccr add — Add rules
Interactive mode (no arguments):
ccr addWalks you through selecting a source (built-in or GitHub), choosing rules, and optionally setting a paths filter.
Install a built-in rule directly:
ccr add typescript
ccr add react
ccr add security
ccr add testingInstall with a paths filter (rule only applies to matching files):
ccr add typescript --path "src/**"
ccr add react --path "src/frontend/**"Install from a GitHub repository:
# Interactive rule selection from a repo
ccr add --source https://github.com/owner/repo
# Install a specific rule from a repo
ccr add --source https://github.com/owner/repo my-ruleInstall to user level (~/.claude/rules/) instead of the workspace:
ccr add security --user
ccr add --source https://github.com/owner/repo --userpaths filter
When a rule is installed with a paths filter, ccr prepends a YAML frontmatter block:
---
paths: src/backend/**
---
# Your rule content hereClaude Code will then apply the rule only when working with files matching the glob pattern.
ccr list — List installed rules
ccr listShows all installed rules at both the workspace and user level, including their paths filter and source.
Workspace rules (.claude/rules/)
─────────────────────────────────
✓ typescript [paths: src/**] (bundled)
✓ react (https://github.com/owner/repo)
User rules (~/.claude/rules/)
──────────────────────────────
✓ security (bundled)Show available bundled rules with --bundled (-b):
ccr list --bundledBundled rules
─────────────
• typescript [paths: **/*.{ts,tsx}]
• react
• nextjs
• go [paths: **/*.go]
• security
• testing
...ccr manage — Manage installed rules
ccr manageOpens an interactive UI to:
- Copy a rule from workspace to user level (or vice versa)
- Move a rule between workspace and user level
- Edit the
pathsfilter of an installed rule - Delete a rule
Built-in rules
The following rules are bundled with ccr and available out of the box:
| Rule | Description |
|---|---|
| typescript | TypeScript best practices |
| react | React / JSX patterns |
| nextjs | Next.js 15 / App Router best practices |
| python | Python best practices |
| go | Go best practices |
| rust | Rust best practices |
| security | Security guidelines |
| testing | Testing best practices |
| tdd | Test-Driven Development (Red-Green-Refactor) |
| ddd | Domain-Driven Design |
| clean-architecture | Clean Architecture and SOLID principles |
| documentation | Documentation best practices |
| rest-api | REST API design guidelines |
| graphql | GraphQL best practices |
| git-workflow | Git branching, commits, and PR guidelines |
| playwright | Playwright MCP usage rules |
GitHub repository format
When using --source, ccr fetches .md files from the rules/ directory of the specified public GitHub repository via the GitHub REST API (no git clone required).
ccr add --source https://github.com/owner/repoIf you hit GitHub API rate limits, set a personal access token:
export GITHUB_TOKEN=your_token_hereLocale
ccr displays messages in Japanese when your system locale starts with ja (e.g. LANG=ja_JP.UTF-8), and in English otherwise.
LANG=ja_JP.UTF-8 ccr list # Japanese
LANG=en_US.UTF-8 ccr list # EnglishLicense
MIT
