fewer-permission-prompts
Fewer Permission Prompts
Look through my transcripts' MCP and bash tool calls, and based on those, make a prioritized list of patterns that I should add to my permission allowlist to reduce permission prompts. Focus on read-only commands.
The format for permissions is: Bash(foo*), Bash(foo), Bash(foo bar *), mcp__slack__slack_read_thread, etc.
Then, add these to the project .claude/settings.json under permissions.allow.
Steps
-
Locate transcripts. Session transcripts live at
~/.claude/projects/<sanitized-cwd>/*.jsonl. Each line is a JSON object. Tool calls appear asassistantmessages withmessage.content[]entries oftype: "tool_use". Thenamefield identifies the tool (e.g."Bash","mcp__slack__slack_read_thread"); for Bash,input.commandis the shell string.Scan the recent transcripts across the user's projects dir — not just the current project — so the allowlist reflects their actual usage. Cap the scan at a reasonable number of recent sessions (e.g. 50 most-recently-modified JSONL files) so this stays fast.
-
Extract tool-call frequencies.
- For
Bashcalls: parseinput.command, take the leading command token (handlingsudo,timeout, pipes,&&, env-var prefixes). Record the command + first subcommand pair (e.g.git status,gh pr view,ls,cat). - For MCP calls: record the full tool name (e.g.
mcp__slack__slack_read_thread). - Count occurrences across the scanned transcripts.
- For