{"version":"2.1.334","anchor":"claude-code-plugin-rules-env-var-and-plugin-rules-attachment","canonical_anchor":"claude-code-plugin-rules-env-var-and-plugin-rules-attachment","heading":"New CLAUDE_CODE_PLUGIN_RULES variable for remote and container sessions","tier":"use","area":"Plugins","scope":"both","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/claude-code-plugin-rules-env-var-and-plugin-rules-attachment","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### New `CLAUDE_CODE_PLUGIN_RULES` variable for remote and container sessions\n\nSetting `CLAUDE_CODE_PLUGIN_RULES` in a remote or container session changes how Claude Code treats the attachment and simple-mode variables\n\n**Unclear.** It is not clear whether the check switches those two modes on for such sessions or exempts those sessions from them.\n\n**What**\n\nClaude Code now recognizes an environment variable named `CLAUDE_CODE_PLUGIN_RULES`. Environment variables are named values handed to Claude Code when it starts.\n\nIf it is set together with either of the variables below, one internal check treats `CLAUDE_CODE_DISABLE_ATTACHMENTS` and `CLAUDE_CODE_SIMPLE` as if they were set:\n\n- `CLAUDE_CODE_REMOTE_SESSION_ID`\n\n- `CLAUDE_CODE_CONTAINER_ID`\n\nThere is also a new kind of attachment called plugin rules. Attachments are extra pieces of context that Claude Code adds alongside your messages, such as the list of available skills or output style instructions.\n\n**Why**\n\nSessions that run remotely or in a container can now be given plugin rules. This variable also changes how those sessions are handled by the no-attachments and simple modes.\n\n- Area: Plugins\n- Names: `CLAUDE_CODE_PLUGIN_RULES`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: no"}