Direct answer
Run/permissions in Claude Code to view and manage permission rules. To persist them, put allow, ask, and deny in settings.json. Hooks use the same settings files and run formatting, tests, or safety checks around tool calls. Permission precedence is deny → ask → allow, so an allow rule cannot override a deny rule.
These settings control local tools on your computer. BetterToken changes the model API Base URL, API Key, and routing only; it does not bypass local permissions or run hooks for you.
Choose permissions or hooks
Choose the correct scope
Configure minimal permission rules
1
Inspect existing rules with /permissions
In Claude Code, run:The UI shows allow, ask, and deny rules with their source files. Check for existing team or managed rules before choosing a user or project setting.
2
Add narrow rules
This project-level example allows common tests and lint, asks before every Replace the commands with scripts that exist in your project. Do not enable
git push, and blocks .env reads:bypassPermissions only to remove prompts; the official documentation limits that mode to isolated containers or VMs.3
Verify in /permissions
Save the file and run
/permissions again. Confirm each rule appears under the expected source, then trigger one allow, ask, and deny case to verify the behavior.Add a copyable formatting hook
This example runs the project formatter after Claude Code usesEdit or Write:
permissions, merge hooks into the same top-level JSON object. Do not create a standalone .claude/hooks.json. Run npm run format manually first to confirm it succeeds.
Verify the hook
- Run
/hooksin Claude Code. - Open PostToolUse and confirm it lists
Edit|Writeandnpm run format. - Ask Claude to modify a test file.
- Check the hook output and file format, and confirm the hook ran once without errors.
Common errors
BetterToken boundaries
BetterToken handles Claude Code model API access, model routing, balance, and usage. Claude Code still controls:- File read and write access
- Bash confirmation behavior
- When hooks run and which scripts they execute
- Sandbox, MCP, and project rules
401, Base URL, or model mapping errors, see the Claude Code setup guide. For command prompts and automation, troubleshoot permissions and hooks here.
Related docs
- Claude Code setup with BetterToken
- What is CLAUDE.md in Claude Code?
- Why Claude Code uses many tokens
- Claude Code MCP vs API Key and Base URL