Terminal: MCP tool permission prompt loops endlessly when user accepts
Summary
In the terminal (CLI) version of Claude Code, when an MCP tool requires a permission prompt, accepting the prompt causes another prompt to appear again immediately. This creates an endless accept loop that requires pressing Escape to exit.
Steps to Reproduce
- Use Claude Code in terminal mode (not desktop app)
- Attempt to call an MCP tool that requires permission confirmation (e.g., a destructive operation on an MCP server)
- The permission prompt appears
- Select "Yes, allow" or "Yes, allow for this session"
- Another prompt appears immediately — repeat 10+ times with no end
Expected Behavior
Selecting "Yes, allow for this session" should grant the tool permission for the remainder of the session and not prompt again for the same tool.
Actual Behavior
Each acceptance causes a new prompt to appear. The user is fully aware they are accepting distinct prompts — this is not a UX confusion issue. After 10+ accepts the prompts continue. The tool ultimately returns "User did not confirm" despite repeated acceptance. The only escape is pressing Escape to break out of the loop.
The excess prompts were caused by Claude retrying the tool call across multiple conversation turns each time the result came back as User did not confirm. Each retry generated a fresh permission prompt, creating a compounding loop:
tool returnsUser did not confirm→ Claude retries → new prompt → user accepts → tool still returnsUser did not confirm→ Claude retries again
The core bug: accepting the permission prompt does not result in the tool executing successfully — it still returns User did not confirm. This causes any retry loop to be unbounded.
Additional Context
- The
permissions.allowarray insettings.jsondoes not suppress the prompts even after session restart. - Workaround: invoke the underlying CLI tool directly via Bash (e.g.
mongoshfor MongoDB operations), which bypasses the MCP permission layer entirely.
Environment
- Claude Code CLI (terminal mode)
- macOS
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗