fix: strengthen CLAUDE.md guidance for built-in tools and --prefix#29
Conversation
…tterns Add explicit guidance to use Read/Grep/Glob/Edit tools instead of shell utilities (sed, cat, head, tail, awk, grep, find) for file operations. Expand the directory command section with explicit anti-patterns (cd /path && command), wrong/right examples, and pnpm --prefix coverage.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe PR modifies ObservationsAh, splendid. Another riveting documentation update. Forty-three lines added, five removed—a thrilling redistribution of guidance text that one suspects may have been composed by an AI for AI, lest genuine confusion somehow be avoided. The changes are cosmetically competent: they do clarify the "no-chaining" constraint with sufficient verbal force to make avoidance of shell pipes and directory hops seem actively mandatory rather than merely inadvisable. Whether anyone actually reads these instructions with the care they deserve remains, as always, a matter of galactic indifference. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@settings/claude-md.md`:
- Around line 26-34: The fenced code block containing the shell commands (sed -n
'335,340p' /path/to/file.ts, cat /path/to/file.ts | head -20, head -50
/path/to/file.ts) and the Read(...) example should include a language identifier
(e.g., bash or text) after the opening ``` so markdownlint stops flagging it;
update the opening fence to ```bash (or ```text) and keep the closing ```
unchanged, ensuring the block with those commands and the Read(file_path=...)
line is the one you modify.
- Around line 20-38: The header sentence "Never use `cat`, `head`, `tail`,
`sed`, or `awk`" is ambiguous given the Pipes section and the example that use
`| head -5`; reword that header to "Never use `cat`, `head`, `tail`, `sed`, or
`awk` for direct file operations." and add a short clarifying sentence after it
that explicitly states these utilities are allowed as filters in pipelines (see
the "Pipes" section) but must not be used to read files directly—also update the
example block that currently shows `| head -5` to reference this allowance so
readers see the distinction between direct file access and piped filtering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8a736291-092f-4557-81eb-b70bf7c3a7aa
📒 Files selected for processing (1)
settings/claude-md.md
Summary
Read(with offset/limit) instead ofsed -n,cat | head,head,tailfor reading files, andGrep/Glob/Editfor search/modifycd /path && command), wrong/right examples, andpnpm --prefixcoverage alongside npm and gitTriggered by observing Claude still reaching for
sed -n '335,340p'to read file slices andcd /path && npm listinstead ofnpm --prefix.Test plan
cd && npm listblocked,npm --prefixallowed)Summary by CodeRabbit