claude-permissions-optimizer

claude-permissions-optimizer is a skill for Claude Code from gvkhosla/compound-engineering-pi. It costs 104 tokens per session (1,869 once invoked), scanned D, original, MIT.

A tool for reducing repeated permission prompts in Claude Code by finding safe shell commands from past sessions and adding them to Claude Code's settings.

In plain words
What is it for?
Use it to review and optimize Claude Code permissions. It is intended for safe commands and does not approve dangerous commands automatically.
Why use it?
It removes unnecessary approval requests while basing changes on commands that were actually used safely before.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Claude Code.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/tmchow/Code/my-project.

Part of the compound-engineering plugin — 41 skills, 1 MCP server shipped together

Good fit Use it to review and optimize Claude Code permissions. It is intended for safe commands and does not approve dangerous commands automatically.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add gvkhosla/compound-engineering-pi
Claude Code
/plugin install compound-engineering

Made for: Claude Code.

Or install compound-engineering, the plugin that ships this one along with the rest of its 41 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-permissions-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer/github.svg)](https://agentmods.dev/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer)
Your own site
<a href="https://agentmods.dev/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer"><img src="https://agentmods.dev/badge/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for claude-permissions-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer"><img src="https://agentmods.dev/badge/skills/gvkhosla/compound-engineering-pi/claude-permissions-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,869 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.01869
Opus 5 $0.00052 $0.00934
Sonnet 5 $0.00021 $0.00374
Haiku 4.5 $0.00010 $0.00187

Measured 9d ago against content hash 04cc007b510b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade D, and why

claude-permissions-optimizer scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/extract-commands.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. **Apply all to user settings** (`~/.claude/settings.json`)

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

This skill identifies commands safe to auto-allow based on actual session history. It does not handle requests to allowlist specific dangerous commands. If the user asks to allow something destructive (e.g., `rm -rf`, `g
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/compound-engineering/skills/claude-permissions-optimizer/SKILL.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Permissions Optimizer

Find safe Bash commands that are causing unnecessary permission prompts and auto-allow them in settings.json -- evidence-based, not prescriptive.

This skill identifies commands safe to auto-allow based on actual session history. It does not handle requests to allowlist specific dangerous commands. If the user asks to allow something destructive (e.g., rm -rf, git push --force), explain that this skill optimizes for safe commands only, and that manual allowlist changes can be made directly in settings.json.

Pre-check: Confirm environment

Determine whether you are currently running inside Claude Code or a different coding agent (Codex, Gemini CLI, Cursor, etc.).

If running inside Claude Code: Proceed directly to Step 1.

If running in a different agent: Inform the user before proceeding:

"This skill analyzes Claude Code session history and writes to Claude Code's settings.json. You're currently in [agent name], but I can still optimize your Claude Code permissions from here -- the results will apply next time you use Claude Code."

Then proceed to Step 1 normally. The skill works from any environment as long as ~/.claude/ (or $CLAUDE_CONFIG_DIR) exists on the machine.

Step 1: Choose Analysis Scope

Ask the user how broadly to analyze using the platform's blocking question tool (AskUserQuestion in Claude Code, request_user_input in Codex, ask_user in Gemini). If no question tool is available, present the numbered options and wait for the user's reply.

  1. All projects (Recommended) -- sessions across every project
  2. This project only -- sessions for the current working directory
  3. Custom -- user specifies constraints (time window, session count, etc.)

Default to All projects unless the user explicitly asks for a single project. More data produces better recommendations.

Step 2: Run Extraction Script

Run the bundled script. It handles everything: loads the current allowlist, scans recent session transcripts (most recent 500 sessions or last 30 days, whichever is more restrictive), filters already-covered commands, applies a min-count threshold (5+), normalizes into Bash(pattern) rules, and pre-classifies each as safe/review/dangerous.

Read the full file on GitHub · 161 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 161 lines · 104 tokens per session scan D 04cc007b510b

Subscribe to this mod's changes

claude-permissions-optimizer is a skill published in the GitHub repository gvkhosla/compound-engineering-pi (51 stars, last pushed 4mo ago), licensed MIT. It adds 104 tokens to every session and 1,869 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

codex-claude-worker

Translate natural-language user requests into bounded Claude Code worker tasks while Codex or ChatGPT remains the supervisor. Use when the user gives an ordinary prompt and wants Codex to clarify scope, choose a safe work boundary, generate a worker prompt, approve or defer worker execution, read run summaries and…

zhuzai-2007/claude-code-mcp-harness · 86 tokens

write-swift

How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know…

wangmiaozero/pi-harness · 107 tokens

apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading)…

wangmiaozero/pi-harness · 80 tokens

emil-design-eng

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

wangmiaozero/pi-harness · 35 tokens

animate-expo

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and…

wangmiaozero/pi-harness · 112 tokens

animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and…

wangmiaozero/pi-harness · 98 tokens