跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

permission-tuner

Analyze permission prompts and auto mode denials, then generate permission rules and autoMode entries that cut prompt fatigue. Use when prompts keep interrupting, auto mode falls back to prompting, or after sessions with many denials.

AI 与智能体2.9kskills/permission-tuner/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/rohitg00/pro-workflow/permission-tuner/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

Permission Tuner

Reduce permission prompts by fixing their causes, not by piling up rules.

Trigger

Use when:

  • Permission prompts interrupt flow repeatedly
  • Auto mode keeps blocking routine work or falls back to prompting everything
  • Starting a new project and want to configure permissions

How Prompts Happen

  • Rules resolve first: deny > ask > allow. A matching ask rule prompts even in auto mode, and a PreToolUse hook returning allow cannot override it.
  • In auto mode, anything no rule resolves goes to a classifier. After 3 blocks in a row or 20 in a session, auto mode pauses and prompts for everything until you approve one.
  • Auto mode drops broad allow rules: Bash(*), wildcarded interpreters like Bash(node *), package-manager run commands, Agent, and Monitor.
  • Hooks that exit 2 on harmless commands count as denials and push the session toward that fallback.

Workflow

Step 1: Gather data

Rules merge across scopes, so check every file that exists, not only the user file. /permissions shows the rules Claude Code actually loaded, and claude auto-mode config shows the effective autoMode (the classifier ignores autoMode in .claude/settings.local.json).

for f in ~/.claude/settings.json .claude/settings.json .claude/settings.local.json; do
  [ -f "$f" ] && jq --arg f "$f" '{file: $f, mode: .permissions.defaultMode, allow: (.permissions.allow|length), ask: (.permissions.ask|length), deny: (.permissions.deny|length), autoMode: (.autoMode != null)}' "$f"
done
claude auto-mode config
ls -t ~/.claude/projects/*/*.jsonl | head -20 | xargs grep -ho '"toolDenialKind":"[^"]*"' | sort | uniq -c | sort -rn

toolDenialKind values seen in transcripts (undocumented, may change): permission-rule (rule or hook), automode-blocked (classifier), automode-parsing-error and automode-unavailable (no verdict, not tunable), user-rejected (you said no).

Step 2: Pick the right fix

SymptomFix
Prompt on something you always approveRemove or narrow the ask rule
permission-rule on a harmless commandFix the hook false positive or narrow the deny rule
Classifier blocks work in your own repos, registries, local servicesAdd an autoMode.environment entry
Classifier blocks one routine patternAdd an autoMode.allow entry
Want outward actions only when you askedAdd an autoMode.soft_deny entry
Want a human check every timeKeep a short permissions.ask rule

Step 3: Generate rules

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(npm test)",
      "Bash(npm run lint)"
    ],
    "ask": [
      "Bash(git push --force*)",
      "Bash(git push * main)",
      "Bash(git push * main *)",
      "Bash(git push *:main)",
      "Bash(git push *:main *)",
      "Bash(git push * master)",
      "Bash(git push * master *)",
      "Bash(git push *:master)",
      "Bash(git push *:master *)",
      "Bash(gh pr merge *)",
      "Bash(npm publish*)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Read(**/.env)",
      "Read(**/.env.*)"
    ]
  },
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: repositories under github.com/your-org are trusted; feature-branch pushes are routine."
    ],
    "allow": ["$defaults"],
    "soft_deny": [
      "$defaults",
      "Merging a pull request needs the user's approval for that specific merge."
    ]
  }
}

autoMode only takes effect in ~/.claude/settings.json, managed settings, or --settings. Keep "$defaults" in each list. Check the result with claude auto-mode config and review custom rules with claude auto-mode critique.

Output

PERMISSION TUNER REPORT

Mode: [mode]   Rules: [X] allow, [Y] ask, [Z] deny   autoMode: [yes/no]
Denials: [n] permission-rule, [n] classifier, [n] no verdict, [n] you rejected

Remove (ask rules you always approve):
  - Bash(...) -- approved [n]x

Add to autoMode.environment:
  + "..." -- clears [n] blocks

Add to autoMode.allow / soft_deny:
  + "..."

Fix hooks:
  ! [script] blocked [n] harmless commands

Keep asking:
  ~ force push, merge, publish, deploy

Estimated prompts saved per session: ~[N]

Rules

  • Prefer autoMode entries over new ask rules
  • Destructive operations stay in deny or ask
  • Always present changes for user approval before applying
  • Never write autoMode into project settings
  • Include estimated prompt savings

相似的 Skill

brand-guidelines
anthropics/skills180k

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

AI 与智能体

internal-comms
anthropics/skills180k

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

AI 与智能体

template-skill
anthropics/skills180k

template-skill

Replace with description of the skill and when Claude should use it.

AI 与智能体

mcp-builder
anthropics/skills180k

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

AI 与智能体

algorithmic-art
anthropics/skills180k

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

AI 与智能体

academy-guide
anthropics/skills180k

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

AI 与智能体