Agent skill
permission-fix
Write operations for fixing and managing Claude Code permissions - add, remove, consolidate, ensure, apply-fixes.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/permission-fix
SKILL.md
Permission Fix Skill
PURPOSE: Write operations for fixing and managing Claude Code permissions.
COMPLEMENTARY SKILL: Use plan-marshall:permission-doctor for read-only analysis before applying fixes.
Script Reference
| Script | Notation | Purpose |
|---|---|---|
| permission-fix | plan-marshall:permission-fix:permission-fix |
Write operations for permissions |
Operations
apply-fixes - Apply Safe Fixes
Normalize paths, remove duplicates, sort, and add default permissions.
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix apply-fixes \
--settings ~/.claude/settings.json \
--dry-run
Output (JSON):
{
"duplicates_removed": 2,
"paths_fixed": 1,
"defaults_added": ["Edit(.plan/**)", "Write(.plan/**)"],
"sorted": true,
"changes_made": true,
"dry_run": true
}
add - Add Permission
Add a single permission to settings.
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix add \
--permission "Bash(docker:*)" \
--target project
Output (JSON):
{
"success": true,
"action": "added",
"settings_file": "/path/to/.claude/settings.json"
}
remove - Remove Permission
Remove a single permission from settings.
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix remove \
--permission "Bash(docker:*)" \
--target project
Output (JSON):
{
"success": true,
"action": "removed",
"settings_file": "/path/to/.claude/settings.json"
}
ensure - Ensure Permissions Exist
Ensure multiple permissions exist (add missing, skip existing).
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix ensure \
--permissions "Bash(git:*),Bash(npm:*),Bash(docker:*)" \
--target global
Output (JSON):
{
"success": true,
"added": ["Bash(docker:*)"],
"already_exists": ["Bash(git:*)", "Bash(npm:*)"],
"added_count": 1,
"total_permissions": 45
}
consolidate - Consolidate Timestamped Permissions
Replace timestamped permissions with wildcards.
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix consolidate \
--settings ~/.claude/settings.json \
--dry-run
Output (JSON):
{
"consolidated": 5,
"removed": ["Read(target/output-2024-01-01.log)", "..."],
"wildcards_added": ["Read(target/output-*.log)"],
"dry_run": true
}
ensure-wildcards - Ensure Marketplace Wildcards
Ensure all marketplace bundle wildcards exist in settings.
python3 .plan/execute-script.py plan-marshall:permission-fix:permission-fix ensure-wildcards \
--settings ~/.claude/settings.json \
--marketplace-json marketplace/.claude-plugin/marketplace.json \
--dry-run
Output (JSON):
{
"added": ["Skill(new-bundle:*)", "SlashCommand(/new-bundle:*)"],
"already_present": 14,
"total": 16,
"dry_run": true
}
Target Selection
Both add, remove, and ensure support --target:
| Target | File |
|---|---|
global |
~/.claude/settings.json |
project |
.claude/settings.json or .claude/settings.local.json |
Dry Run
All write operations support --dry-run to preview changes without modifying files.
Integration with Permission Doctor
Recommended workflow:
- Analyze first: Use
permission-doctor detect-redundantordetect-suspicious - Review findings: Check the analysis output
- Apply fixes: Use
permission-fix apply-fixesor specific operations - Verify: Re-run analysis to confirm fixes
Default Permissions
apply-fixes automatically adds these if missing:
| Permission | Reason |
|---|---|
Edit(.plan/**) |
Plan file modifications |
Write(.plan/**) |
Plan file creation |
Read(~/.claude/plugins/cache/**) |
Skills reference files via relative paths |
Error Handling
All operations return JSON with error details:
{
"error": "Settings file not found: /path/to/settings.json",
"success": false
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?