Skip to content

fix(permissions): skip enforceAnthropicSignIn and four env variables Claude Code ignores - #3962

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2664-claudecode-managed-env
Nov 25, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2664-claudecode-managed-env

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Closes the two gaps in the 2026-11-25 upstream re-check on #2664. Both are in the Claude Code permissions generator (src/features/permissions/claudecode-permissions.ts).

What changed

  • enforceAnthropicSignIn is managed-only. The settings reference gives its scope as Managed (Claude Code v2.1.329+), and Claude Code reads it only from a managed settings file or an MDM policy. It is now in the managed-only key map, so rulesync skips it in both scopes and prints the existing per-key warning. Before this change it was written to .claude/settings.json and ~/.claude/settings.json, where Claude Code does not read it.
  • env filter, following the list of variables Claude Code ignores in env:
    • OTEL_RESOURCE_INCLUDE_HOST (v2.1.326+, part of the telemetry group) and CLAUDE_CODE_EXPERIMENTAL_CODE_MODE are skipped at project scope. Code Mode reads this variable only from the shell, user settings or a --settings file, so a project value does nothing, a 0 included. Both are still written under --global, because user settings honor them.
    • CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT and CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK are skipped in every settings file, because Claude Code reads them from the launch environment only.
  • Tests are extended to cover each new name. The claudecode env notes in docs/reference/file-formats.md and src/generated/docs-content.ts are updated to match.

Skipped

Refs #2664

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 2 commits November 25, 2026 10:32
…Claude Code ignores

- Treat enforceAnthropicSignIn (v2.1.329+, scope Managed) as managed-only,
  so it is skipped with a warning in both scopes.
- Skip OTEL_RESOURCE_INCLUDE_HOST (v2.1.326+) and
  CLAUDE_CODE_EXPERIMENTAL_CODE_MODE at project scope; user settings
  (--global) still honor them.
- Skip CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT and
  CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK in every settings file,
  since Claude Code reads them from the launch environment only.
- Update the claudecode env notes in docs/reference/file-formats.md.

Refs #2664

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…audecode-managed-env

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit eeb3b5d into main Nov 25, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2664-claudecode-managed-env branch November 25, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant