Understanding Claude Code Permission Requests¶
A beginner's guide to what Claude Code is asking to do when it requests permission.
this is using css snippets to have nice cheatsheet tabular layout in PDF
Safety Levels¶
| Icon | Meaning |
|---|---|
| ✅ | Safe - Read-only, no changes made |
| ⚠️ | Caution - Makes changes, review first |
| 🛑 | Careful - Can delete or modify important things |
File Operations
Reading (✅)
| Command | Does | |---------|------| | `cat file` | View contents | | `head file` | First lines | | `tail file` | Last lines | | `less file` | Browse file |Creating (⚠️)
| Command | Does | |---------|------| | `touch file` | Empty file | | `echo > file` | Overwrite | | `echo >> file` | Append | | `cp a b` | Copy | | `mkdir dir` | New folder |Moving (⚠️)
| Command | Does | |---------|------| | `mv a b` | Rename/move | | `mv f dir/` | Move to dir |Deleting (🛑)
| Command | Does | |---------|------| | `rm file` | Delete | | `rm -r dir` | Delete dir | | `rm -rf dir` | Force delete |rm -rf is PERMANENT!
Navigation
Explore (✅)
| Command | Does | |---------|------| | `ls` | List files | | `ls -la` | List all | | `pwd` | Show path | | `cd dir` | Change dir | | `find` | Search | | `tree` | Structure |Search (✅)
| Command | Does | |---------|------| | `grep text` | Find text | | `grep -r` | Find all | | `rg pattern` | Fast find |Run Code (⚠️)
| Command | Does | |---------|------| | `node x.js` | JavaScript | | `python x.py` | Python | | `./script.sh` | Shell | | `chmod +x` | Executable |Build (⚠️)
| Command | Does | |---------|------| | `npm build` | Build | | `npm test` | Test | | `pytest` | Py tests | | `make` | Makefile |Git
Safe (✅)
| Command | Does | |---------|------| | `git status` | Changes | | `git log` | History | | `git diff` | Diffs | | `git branch` | Branches |Changes (⚠️)
| Command | Does | |---------|------| | `git add .` | Stage all | | `git commit` | Save | | `git checkout` | Switch | | `git stash` | Stash |Network (⚠️)
| Command | Does | |---------|------| | `git pull` | Download | | `git push` | Upload | | `git fetch` | Check | | `git clone` | Clone |Danger (🛑)
| Command | Does | |---------|------| | `reset --hard` | Discard | | `push --force` | Overwrite | | `clean -fd` | Del untracked |You could lose work!
Packages
npm (⚠️)
| Command | Does | |---------|------| | `npm install` | Install | | `npm run x` | Run script | | `npx cmd` | Run once |pip (⚠️)
| Command | Does | |---------|------| | `pip install` | Install | | `pip -r req` | All deps | | `uv pip` | Fast |System (🛑)
| Command | Does | |---------|------| | `sudo apt` | Admin! |Network (⚠️)
| Command | Does | |---------|------| | `curl url` | Fetch | | `wget url` | Download |Process
| Command | Does | |---------|------| | `ps aux` | List (✅) | | `kill PID` | Stop (⚠️) | | `killall` | Stop all (🛑) |Environment (✅)
| Command | Does | |---------|------| | `echo $VAR` | Check var | | `export V=x` | Set var | | `env` | List all |Compound
| Syntax | Meaning | |--------|---------| | `a && b` | b if a ok | | `a \|\| b` | b if a fail | | `a ; b` | Both run | | `a \| b` | Pipe |Red Flags 🚩
| Pattern | Risk | |---------|------| | `sudo` | Admin | | `rm -rf /` | Delete all | | `chmod 777` | Open | | `curl\|bash` | Unknown | | `--force` | Bypass | | `eval` | Arbitrary |You Can Always
- Ask Claude to explain
- Deny & ask alternative
- Modify the command
- Check paths first
Quick Decision Guide¶
┌─────────────────────────────────────────────┐
│ Claude is asking to run a command... │
├─────────────────────────────────────────────┤
│ │
│ READ-ONLY? (ls, cat, grep, git log) │
│ └─► ✅ Usually safe │
│ │
│ CREATE new files? │
│ └─► ⚠️ Check the path │
│ │
│ MODIFY existing files? │
│ └─► ⚠️ Want those changes? │
│ │
│ DELETE anything? │
│ └─► 🛑 Double-check path! │
│ │
│ Uses SUDO? │
│ └─► 🛑 Trust the command? │
│ │
│ DOWNLOAD from internet? │
│ └─► ⚠️ URL trustworthy? │
│ │
│ Not sure? Ask Claude to explain first! │
│ │
└─────────────────────────────────────────────┘