Permission Model

Clew Code provides 7 permission modes with granular allow/deny rules for safe AI-assisted development.

Permission Modes

ModeDescription
defaultAsk for every tool execution. Maximum safety.
askPrompt for confirmation on each action.
planFull-access planning with bypass permissions. Read, write, edit freely during planning.
autoAuto-approve safe tools (read, grep, glob). Ask for destructive operations.
acceptEditsAuto-approve file edits within allowed patterns.
bypassPermissionsFull access — all tools approved automatically.
dontAskExecute everything without prompting. Use with caution.

Switching Modes

Use the /permissions command in the REPL:

❯ /permissions plan     # enter full-access plan mode
❯ /permissions auto     # auto-approve safe operations
❯ /permissions default  # back to asking for each action

Allow/Deny Rules

Configure granular rules in .clew/settings.json:

{
  "allow": [
    "bash: npm run dev",
    "bash: git status",
    "write: src/**"
  ],
  "deny": [
    "bash: rm -rf",
    "bash: git push --force"
  ]
}

Rules support glob pattern matching against tool names and arguments.

Safety Gates

The safetyGate system validates:

Plan Mode

Plan mode is a special full-access mode for architectural work: