Skip to content

Feat/tool substitution rules#343

Merged
himkt merged 4 commits intomainfrom
feat/tool-substitution-rules
Mar 15, 2026
Merged

Feat/tool substitution rules#343
himkt merged 4 commits intomainfrom
feat/tool-substitution-rules

Conversation

@himkt
Copy link
Owner

@himkt himkt commented Mar 15, 2026

No description provided.

@himkt himkt requested a review from Copilot March 15, 2026 08:34
@himkt himkt self-assigned this Mar 15, 2026
@himkt himkt requested review from Copilot and removed request for Copilot March 15, 2026 08:43
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

Adds explicit tool-substitution guidance and enforces it by expanding the denied Bash command set in Claude Code settings, consolidating previously separate navigation/creation rules into a single rules doc.

Changes:

  • Expanded permissions.deny to block additional common Bash utilities (find/grep/cat/sed/etc.).
  • Removed standalone rule docs for source navigation and directory/file creation.
  • Added a “Tool Substitution” section to bash-command.md documenting which tools to use instead.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
home/modules/claude-code/files/settings.json Expands denied Bash command patterns to encourage dedicated-tool usage.
home/modules/claude-code/files/rules/source-navigation.md Removes now-redundant navigation rule doc.
home/modules/claude-code/files/rules/directory-creation.md Removes now-redundant creation rule doc.
home/modules/claude-code/files/rules/bash-command.md Centralizes tool substitution guidance and exceptions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 59 to 72
"deny": [
"Bash(awk *)",
"Bash(cat *)",
"Bash(echo *)",
"Bash(find *)",
"Bash(grep *)",
"Bash(head *)",
"Bash(ls *)",
"Bash(mkdir *)",
"Bash(printf *)",
"Bash(rg *)",
"Bash(sed *)",
"Bash(tail *)",
"Bash(touch *)",

## Tool Substitution

Use dedicated tools instead of the following Bash commands. These are denied in settings.json.
Comment on lines +17 to +26
| `find` | Glob | Pattern-based file search |
| `ls`, `tree` | Glob | For directory listing. Use Read to inspect a single directory when needed |
| `grep`, `rg` | Grep | Content search across files |
| `cat`, `head`, `tail` | Read | Read supports line offset and limit for partial reads |
| `sed`, `awk` | Edit | Exact string replacement in files |
| `mkdir`, `touch` | Write | Write auto-creates parent directories and can create empty files |
| `echo`, `printf` | Write (files) or direct text output (communication) | Never use shell output redirection |

Additional guidance:
- Use Explore agent (Agent tool with subagent_type=Explore) for broader codebase navigation when simple Glob/Grep is insufficient
@himkt himkt merged commit 695638e into main Mar 15, 2026
3 checks passed
@himkt himkt deleted the feat/tool-substitution-rules branch March 15, 2026 08:49
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