Skip to content

fix: trim all ruler rules to reduce CLAUDE.md from 10.9k to 1.6k#69

Merged
shunkakinoki merged 3 commits intomainfrom
fix/trim-tool-search
Feb 15, 2026
Merged

fix: trim all ruler rules to reduce CLAUDE.md from 10.9k to 1.6k#69
shunkakinoki merged 3 commits intomainfrom
fix/trim-tool-search

Conversation

@shunkakinoki
Copy link
Owner

@shunkakinoki shunkakinoki commented Feb 15, 2026

Changes

  • Condensed rules/tool-search.md from 6.2k to ~1.3k chars
  • Removed verbose examples, installation verification, additional tools, and integration workflow sections
  • Core information (tool table, language mapping, decision criteria, best practices) preserved

Impact

  • ~/.claude/CLAUDE.md drops from 42.7k to 37.9k chars (under the 40k performance threshold)
  • All essential search guidance retained in compact format

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.

Copilot AI review requested due to automatic review settings February 15, 2026 22:12
@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated build configuration and project settings.
    • Modified version control ignore patterns to exclude generated artifacts.
    • Adjusted build process workflow for improved efficiency.

Walkthrough

The 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

Cohort / File(s) Summary
Configuration
.ruler/ruler.toml
Disabled the Skills feature by setting enabled = false with explanatory comments in the [skills] section.
Build Pipeline
Makefile
Removed the ruler-apply-global call from the sync target, streamlining the build flow from mcp-sync directly to ruler-dotdirs-sync.
Source Control
.gitignore
Added a START Ruler Generated Files block with 58 lines of patterns to exclude Ruler and Claude-generated artifacts (e.g., /.aider.conf.yml, /.claude/CLAUDE.md, /.codex/config.json, AGENTS.md, ruler_aider_instructions.md, opencode.json, and related .bak variants).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • dotagents#69: Adds similar START/END block to .gitignore for ignoring Ruler/Claude-generated files, indicating parallel efforts to manage auto-generated artifact tracking across repositories.

Poem

🐰 Hops through configs with glee,
Skills disabled, pipelines freed,
Artifacts tucked in .gitignore's keep,
The Ruler's garden, tidy and clean! 🌿✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (8 files):

⚔️ .gitignore (content)
⚔️ .ruler/ruler.toml (content)
⚔️ Makefile (content)
⚔️ rules/commit-push.md (content)
⚔️ rules/ruler-apply.md (content)
⚔️ rules/shell-usage.md (content)
⚔️ rules/tool-search.md (content)
⚔️ rules/workspace-file-references.md (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the pull request: trimming ruler rules to reduce the size of CLAUDE.md from 10.9k to 1.6k.
Description check ✅ Passed The description clearly explains the changes made (condensed rules, disabled Ruler skill expansion, removed redundant global apply, updated .gitignore) and their impact on CLAUDE.md file size.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/trim-tool-search

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Comment on lines +432 to +434
/.claude/CLAUDE.md
/.claude/CLAUDE.md.bak
/.claude/skills
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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:

  1. Removing lines 431-435 entirely (preferred, since line 393 already handles this), or
  2. 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md by 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.

| `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` |
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
| `fzf` | Interactive selection/filtering | `fd '*.ts' \| fzf`, `rg -l "export" \| fzf` |
| `fzf` | Interactive selection/filtering | `fd '*.ts' | fzf`, `rg -l "export" | fzf` |

Copilot uses AI. Check for mistakes.
@shunkakinoki shunkakinoki changed the title fix: trim tool-search.md to reduce CLAUDE.md size below 40k fix: trim all ruler rules to reduce CLAUDE.md from 10.9k to 1.6k Feb 15, 2026
- 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
@shunkakinoki shunkakinoki merged commit cde5db7 into main Feb 15, 2026
2 of 3 checks passed
@shunkakinoki shunkakinoki deleted the fix/trim-tool-search branch February 15, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants