| name | setperms |
| description | Set tool permissions for Claude Code. Configures allowed commands, rules, and preferences in .claude/ directory. Triggers on: setperms, init tools, configure permissions, setup project, set permissions, init claude. |
| license | MIT |
| compatibility | Creates project-local .claude/ configuration. |
| allowed-tools | Read Write Bash |
| metadata | {"author":"claude-mods"} |
/setperms
Initialize Claude Code with modern dev-shell-tools for a comfortable development experience.
What This Does
Installs complete dev environment setup:
- Permissions (
.claude/settings.local.json) - Pre-approved CLI tools
- Rules (
.claude/rules/cli-tools.md) - Instructions to prefer modern tools
Tools from dev-shell-tools:
Core Tools:
- Git: Full git access, lazygit, gh (GitHub CLI), delta, difft
- File ops: ls, mkdir, cat, wc, tree, eza, bat, chmod
- Search: rg (ripgrep), fd, fzf, ast-grep/sg
- Navigation: zoxide/z, broot/br
- Data processing: jq, yq, sd, xargs
- Analysis: tokei, procs, hyperfine, dust
Dev Tools:
- Package managers: npm, npx, node, pnpm, yarn, bun, python, uv, pip, cargo, go, brew
- Build tools: just, make, bash, rustc
- Network: curl, http (httpie), firecrawl, markitdown
- Containers: docker, docker-compose
- Archives: tar, zip, unzip
- Testing: pytest
- Data: sort, uniq, cut, tr, xargs, tee, head, tail, diff
- Documentation: tldr
- Windows: powershell
AI CLI Tools:
- gemini: Google Gemini CLI (2M context)
- claude: Anthropic Claude CLI
- codex: OpenAI Codex CLI
- perplexity: Perplexity CLI (web search)
Execution Flow
/setperms
|
+-- Check for existing .claude/ files
| +-- If exists: Ask to overwrite or skip
| +-- If not: Proceed
|
+-- Create .claude directory
+-- Create .claude/rules directory
|
+-- Write settings.local.json (permissions)
+-- Ensure .gitignore excludes settings.local.json (secret-safety)
+-- Write rules/cli-tools.md (tool preferences)
Instructions
Step 1: Check for existing settings
ls -la .claude/settings.local.json 2>/dev/null
ls -la .claude/rules/cli-tools.md 2>/dev/null
If files exist, ask user:
- Overwrite: Replace entirely
- Skip: Keep existing, do nothing
Step 2: Create directories
mkdir -p .claude/rules
Step 3: Write permissions file
Write to .claude/settings.local.json:
{
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(ls:*)",
"Bash(mkdir:*)",
"Bash(cat:*)",
"Bash(wc:*)",
"Bash(tree:*)",
"Bash(curl:*)",
"Bash(rg:*)",
"Bash(fd:*)",
"Bash(fzf:*)",
"Bash(z:*)",
"Bash(zoxide:*)",
"Bash(br:*)",
"Bash(broot:*)",
"Bash(ast-grep:*)",
"Bash(sg:*)",
"Bash(bat:*)",
"Bash(eza:*)",
"Bash(delta:*)",
"Bash(difft:*)",
"Bash(jq:*)",
"Bash(yq:*)",
"Bash(sd:*)",
"Bash(lazygit:*)"
Step 3b: Protect settings.local.json from git (mandatory)
settings.local.json is user-specific and frequently accumulates secrets in
permission rules (an API key baked into a Bash(...) allow entry, a token in a
custom command). It must never reach a remote. Before finishing, ensure the repo
root .gitignore excludes it:
grep -qxF '.claude/settings.local.json' .gitignore 2>/dev/null \
|| printf '\n# Local settings (user-specific; may contain API keys)\n.claude/settings.local.json\n' >> .gitignore
git ls-files --error-unmatch .claude/settings.local.json >/dev/null 2>&1 \
&& git rm --cached .claude/settings.local.json
Skip silently if the project has no git repo. This pairs with the git-ops
push-safety gate, which also refuses any push that adds .claude/settings.local.json
— defense in depth so a leaked key can't recur.
Step 4: Write rules file
Write to .claude/rules/cli-tools.md:
# CLI Tool Preferences (dev-shell-tools)
ALWAYS prefer modern CLI tools over traditional alternatives.
## File Search & Navigation
| Instead of | Use | Why |
|------------|-----|-----|
| `find` | `fd` | 5x faster, respects .gitignore |
| `grep` | `rg` (ripgrep) | 10x faster, respects .gitignore |
| `ls` | `eza` | Git status, tree view |
| `cat` | `bat` | Syntax highlighting |
| `cd` + manual | `z`/`zoxide` | Frecent directories |
| `tree` | `eza --tree` | Interactive |
## Data Processing
| Instead of | Use |
|------------|-----|
| `sed` | `sd` |
| Manual JSON | `jq` |
| Manual YAML | `yq` |
## Git Operations
| Instead of | Use |
|------------|-----|
| `git diff` | `delta` or `difft` |
| Manual git | `lazygit` |
| GitHub web | `gh` |
## Code Analysis
- Line counts: `tokei`
- AST search: `ast-grep` / `sg`
- Benchmarks: `hyperfine`
- Disk usage: `dust`
## System Monitoring
| Instead of | Use |
|------------|-----|
| `du -h` | `dust` |
| `top`/`htop` | `btm` (bottom) |
## Documentation
| Instead of | Use |
|------------|-----|
| `man <cmd>` | `tldr <cmd>` |
## Python
| Instead of | Use |
|------------|-----|
| | |
| | |
Prefer over Makefiles.
| Priority | Tool | When to Use |
|----------|------|-------------|
| 1 | | First attempt - fast, built-in |
| 2 | | JS-rendered pages, cleaner extraction |
| 3 | | Anti-bot bypass, blocked sites |
For multi-model analysis:
| Tool | Model | Best For |
|------|-------|----------|
| | Gemini 2.5 | 2M context, large codebases |
| | Claude | Coding, analysis |
| | OpenAI | Deep reasoning |
| | Perplexity | Web search, current info |
Destructive commands require confirmation (in "ask" list):
| Command | Risk | Safe Alternative |
|---------|------|------------------|
| | Loses uncommitted changes | first |
| | Discards file changes | or first |
| | Deletes untracked files | (dry run) first |
| | Permanently deletes stash | Check first |
| | Overwrites remote history | |
| | Deletes unmerged branch | (safe delete) |
Check status:
Check for uncommitted changes:
Consider stashing:
Use dry-run flags when available
Reference: https://github.com/0xDarkMatter/dev-shell-tools
Step 5: Confirm
Report to user:
Initialized Claude Code with dev-shell-tools:
Created:
.claude/settings.local.json (74 tool permissions, 11 guardrails)
.claude/rules/cli-tools.md (modern tool preferences)
Claude will now:
- Auto-approve dev-shell-tools commands
- Prefer fd over find, rg over grep, bat over cat, etc.
- Use AI CLIs for multi-model analysis
- Ask before destructive git commands (reset --hard, push --force, etc.)
To customize: edit files in .claude/
To add to git: git add .claude/
Options
| Flag | Effect |
|---|
--force | Overwrite existing without asking |
--perms-only | Only install permissions, skip rules |
--rules-only | Only install rules, skip permissions |
--minimal | Minimal permissions (git, ls, cat, mkdir only) |
--full | Add cloud/container tools (docker, kubectl, terraform, etc.) |
--no-guardrails | Skip git safety guardrails (empty "ask" list) |
Full Template (--full)
Adds to permissions:
"Bash(podman:*)",
"Bash(kubectl:*)",
"Bash(helm:*)",
"Bash(terraform:*)",
"Bash(pulumi:*)",
"Bash(aws:*)",
"Bash(gcloud:*)",
"Bash(az:*)",
"Bash(wrangler:*)",
"Bash(flyctl:*)",
"Bash(railway:*)"
Notes
- Permissions are project-local (don't affect other projects)
- Rules instruct Claude to prefer modern tools
- Global settings in
~/.claude/ still apply
- Changes take effect on next tool use (no restart needed)
- Tools from: https://github.com/0xDarkMatter/dev-shell-tools