Permission Denied
Understanding and fixing permission errors.
Common Scenarios
Reading Sensitive Files
> Read .env
❌ Permission Denied: .env matches blocked pattern1
2
3
2
3
Solutions:
- One-time access:
/allow read .env - Pattern access:
/allow read *.env - Switch mode:
/mode ReadOnly(can read anything)
Writing to System Directories
> Write /etc/config "data"
❌ Permission Denied: /etc/* is blocked1
2
3
2
3
Solutions:
- Use user directory instead
- Switch to DangerFullAccess (not recommended)
- Use sudo manually outside claude-code-Go
Executing Dangerous Commands
> Bash rm -rf /
⚠️ Permission Required: DangerFullAccess needed1
2
3
2
3
Solutions:
- Confirm you want to do this
- Use
/allowfor one-time - Switch mode if automation needed
Permission Levels
| Level | Can Read | Can Write | Can Execute |
|---|---|---|---|
| ReadOnly | ✅ All | ❌ None | ❌ None |
| WorkspaceWrite | ✅ All | ✅ Workspace | ✅ Safe |
| DangerFullAccess | ✅ All | ✅ All | ✅ All |
Custom Rules
Add to ~/.go-code/settings.json:
json
{
"rules": [
{"pattern": "*.secret", "allowed": false},
{"pattern": "docs/*", "allowed": true},
{"pattern": "*.tmp", "allowed": true}
]
}1
2
3
4
5
6
7
2
3
4
5
6
7
Session Memory
Remember permissions:
> /remember allow read *.log
> /remember allow bash go test1
2
2
Debugging
Check current permissions:
> /mode
Current: WorkspaceWrite
> /rules
Active rules:
- *.env → DENY
- *.go → ALLOW
- * → ASK1
2
3
4
5
6
7
8
2
3
4
5
6
7
8