fix: trim all ruler rules to reduce CLAUDE.md from 10.9k to 1.6k#69
fix: trim all ruler rules to reduce CLAUDE.md from 10.9k to 1.6k#69shunkakinoki merged 3 commits intomainfrom
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR disables the Ruler Skills feature through configuration, removes the global apply step from the build pipeline, and adds comprehensive Ruler-generated artifact patterns to .gitignore to prevent unintended version control tracking. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.gitignore:
- Around line 432-434: The .gitignore contains redundant patterns: remove the
explicit entries "/.claude/CLAUDE.md", "/.claude/CLAUDE.md.bak", and
"/.claude/skills" because the existing ".claude/" pattern already ignores the
entire directory; update the .gitignore by deleting those three lines (or, if
you need selective ignores instead, replace the broad ".claude/" entry and add
only the specific files you want ignored) so the ignore rules are not
duplicated.
🧹 Nitpick comments (1)
rules/tool-search.md (1)
30-30: Make the xargs example more robust.The current example
fd '*.ts' | xargs ast-grep ...could fail with filenames containing spaces, newlines, or other special characters. Using null-terminated strings provides safer piping.🔧 Recommended improvement
-- Combine tools: `fd '*.ts' | xargs ast-grep --lang ts -p 'pattern'` +- Combine tools: `fd -0 '*.ts' | xargs -0 ast-grep --lang ts -p 'pattern'`This ensures filenames with spaces or special characters are handled correctly.
.gitignore
Outdated
| /.claude/CLAUDE.md | ||
| /.claude/CLAUDE.md.bak | ||
| /.claude/skills |
There was a problem hiding this comment.
Redundant ignore patterns already covered by line 393.
These three patterns are redundant because line 393 already contains .claude/ which ignores the entire .claude directory and all its contents recursively. The new patterns for CLAUDE.md, CLAUDE.md.bak, and skills are therefore unnecessary.
🧹 Recommendation
Consider either:
- Removing lines 431-435 entirely (preferred, since line 393 already handles this), or
- Removing the
.claude/pattern at line 393 if you need fine-grained control over which Claude artifacts to ignore
If these lines are auto-generated by Ruler, ensure the generator doesn't conflict with existing patterns.
🤖 Prompt for AI Agents
In @.gitignore around lines 432 - 434, The .gitignore contains redundant
patterns: remove the explicit entries "/.claude/CLAUDE.md",
"/.claude/CLAUDE.md.bak", and "/.claude/skills" because the existing ".claude/"
pattern already ignores the entire directory; update the .gitignore by deleting
those three lines (or, if you need selective ignores instead, replace the broad
".claude/" entry and add only the specific files you want ignored) so the ignore
rules are not duplicated.
There was a problem hiding this comment.
Pull request overview
This PR reduces the size of the generated ~/.claude/CLAUDE.md file by condensing rules/tool-search.md from approximately 6.2k to 1.3k characters. The changes are part of an effort to keep the generated CLAUDE.md file under a 40k character performance threshold. The repository uses the Ruler tool to generate agent instruction files from rule documents in the rules/ directory.
Changes:
- Condensed
rules/tool-search.mdby converting verbose sections into compact tables and bullet points - Added auto-generated .gitignore entries for Ruler-generated files in the
.claude/directory
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rules/tool-search.md | Condensed from 151 lines to 32 lines, converting verbose sections into compact table format while preserving core tool information, language mappings, usage criteria, and best practices |
| .gitignore | Added auto-generated Ruler patterns for .claude/CLAUDE.md, .claude/CLAUDE.md.bak, and .claude/skills |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rules/tool-search.md
Outdated
| | `fd` | File discovery by name/pattern | `fd config.json`, `fd '*.ts'`, `fd -e md` | | ||
| | `rg` | Text search (regex, context) | `rg "function.*export"`, `rg -i "todo" -A 3` | | ||
| | `ast-grep` | AST-based code structure search | `ast-grep --lang ts -p 'function $NAME($ARGS) { $$$ }'` | | ||
| | `fzf` | Interactive selection/filtering | `fd '*.ts' \| fzf`, `rg -l "export" \| fzf` | |
There was a problem hiding this comment.
The pipe characters in the examples column should not be escaped with backslashes. In Markdown tables, pipe characters within cells should be escaped with HTML entities like | or wrapped in code spans (which is already done here with backticks). The backslash escapes \| are unnecessary and will render literally as \| in the output.
| | `fzf` | Interactive selection/filtering | `fd '*.ts' \| fzf`, `rg -l "export" \| fzf` | | |
| | `fzf` | Interactive selection/filtering | `fd '*.ts' | fzf`, `rg -l "export" | fzf` | |
- commit-push: condensed to essential format and guidelines - ruler-apply: removed verbose When to Run/What to Inspect/Troubleshooting - shell-usage: reduced to one-liner syntax reference - tool-search: removed table/examples, kept tool-per-purpose summary - workspace-file-references: removed JSON examples, kept rule as one-liner - .gitignore: updated with full ruler-generated paths
210e1aa to
940d498
Compare
Changes
rules/tool-search.mdfrom 6.2k to ~1.3k charsImpact
~/.claude/CLAUDE.mddrops from 42.7k to 37.9k chars (under the 40k performance threshold)Generated with Claude Code
Summary by cubic
Trimmed tool-search and other Ruler rules (commit-push, ruler-apply, shell-usage, workspace-file-references) to cut ~/.claude/CLAUDE.md’s rules from ~6.1k to ~1.6k, keeping it under 40k. Disabled Ruler skill expansion, removed the redundant global apply from sync, and expanded .gitignore to cover all Ruler-generated files.
Written for commit 940d498. Summary will update on new commits.