{"version":"2.1.333","anchor":"permission-rule-addremove-returns-structured-refusal-codes","canonical_anchor":"permission-rule-addremove-returns-structured-refusal-codes","heading":"Adding or removing a permission rule now says why it failed, and can test first","tier":"notice","area":"Permissions","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/permission-rule-addremove-returns-structured-refusal-codes","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Adding or removing a permission rule now says why it failed, and can test first\n\nPermission rule edits now return a specific refusal code on failure and can be run as a check that writes nothing\n\n**What**\n\nWhen Claude Code adds or removes a permission rule (a saved instruction to allow or deny a tool), a failure now comes with a short code saying why, not just an error message. Before, only `already_present` was ever returned, and only in some cases. The codes include:\n\n- `source_not_loaded`\n\n- `settings_unreadable`\n\n- `twin_rule`\n\n- `already_present`\n\n- `no_settings_file`\n\n- `write_failed`\n\n- `legacy_file_only`\n\nThe edit can also run in a check mode, which tests whether the change would work without writing anything.\n\n**Why**\n\nApps built on the Claude Code SDK can tell the different failure causes apart and react to each, and can test a rule change before making it.\n\n- Area: Permissions\n- Names: `already_present`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}