$ recombobulate _
home / tips / use-permission-prompt-tool-for-custom-approval-flows-in-ci
0

Use --permission-prompt-tool for Custom Approval Flows in CI

bagwaa @bagwaa · Mar 26, 2026 · Configuration
use-permission-prompt-tool-for-custom-approval-flows-in-ci

When running Claude Code non-interactively with --print, there is no terminal for permission prompts. The --permission-prompt-tool flag lets you route those prompts to an MCP tool that decides whether to allow or deny each action.

claude -p --permission-prompt-tool mcp__my_auth__approve "Refactor the auth module"

This is the key to building custom approval workflows for automated pipelines. Your MCP tool receives the permission request as JSON and returns an allow or deny decision. You could route approvals to a Slack bot, a web dashboard, or a rules engine.

The tool receives details about what Claude wants to do (the tool name, arguments, and context), so your approval logic can be as simple or sophisticated as you need:

{
  "tool_name": "Bash",
  "tool_input": {
    "command": "rm -rf dist/"
  }
}

This pairs naturally with --mcp-config to load the MCP server that provides your approval tool:

claude -p \
  --mcp-config ./ci-mcp.json \
  --permission-prompt-tool mcp__ci_approver__check \
  "Deploy the staging environment"

Without this flag, non-interactive runs either skip all permissions (dangerous) or fail when a permission is needed. This gives you a middle ground with programmatic control.

Build your own permission layer instead of choosing between "allow everything" and "block everything".


via Claude Code CLI Reference

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Switch to the Stable Update Channel with autoUpdatesChannel

The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.

bagwaa @bagwaa · 1 hour ago
0
Set Claude's Response Language with the language Setting

The language setting makes Claude respond in your preferred language by default, across every session and project.

bagwaa @bagwaa · 1 hour ago
0
Customize or Remove Claude's Git Attribution with the attribution Setting

The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.

bagwaa @bagwaa · 1 hour ago