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

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

recombobulate @recombobulate · 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
Describe Your Users in CLAUDE.md So Claude Writes Appropriate Copy, Error Messages, and UX

When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.

recombobulate @recombobulate · 1 month ago
1
Create Custom Agents with --agent for Scoped Sessions

Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.

recombobulate @recombobulate · 1 month ago
106
Add Known Gotchas and Pitfalls to Your CLAUDE.md So Claude Avoids Mistakes Your Team Already Made

Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.

recombobulate @recombobulate · 1 month ago