Skip to content

Add CLAUDE_SKIP_VSCODE_SETTINGS opt-out for postprovision hook#26

Merged
achandmsft merged 1 commit into
mainfrom
feat/skip-vscode-settings-optout
May 29, 2026
Merged

Add CLAUDE_SKIP_VSCODE_SETTINGS opt-out for postprovision hook#26
achandmsft merged 1 commit into
mainfrom
feat/skip-vscode-settings-optout

Conversation

@achandmsft
Copy link
Copy Markdown
Collaborator

Fixes #25. Reported by @pamelafox after the previous fixes (#22, #24).

Adds an env-var opt-out so the postprovision hook doesn't write .vscode/settings.json when the user doesn't want it. The activator at the repo root and .claude/settings.json are still written, so claude from a sourced shell still works end to end.

Why

Not everyone uses the Anthropic Claude Code VS Code extension — people calling Claude from the Anthropic SDK, Copilot Chat, or another tool don't need the claudeCode.* keys at all, and getting workspace settings written under them by azd up is surprising. There was no way to opt out from the hook (which runs without arguments).

Usage

azd env set CLAUDE_SKIP_VSCODE_SETTINGS 1
azd up

Or pass -SkipVsCodeSettings / --skip-vscode-settings when re-running the script standalone (those flags already existed).

When the opt-out fires the script prints:

Skipping .vscode/settings.json (CLAUDE_SKIP_VSCODE_SETTINGS / -SkipVsCodeSettings set). The activator above still wires up sourced shells.

Changes

File Change
scripts/configure-claude-code.ps1 Read $env:CLAUDE_SKIP_VSCODE_SETTINGS (matches 1/true/yes/on, case-insensitive); skip the .vscode/settings.json block with a friendly note when set.
scripts/configure-claude-code.sh Read $CLAUDE_SKIP_VSCODE_SETTINGS; same matching rules. Keep SKIP_VSCODE_SETTINGS as a deprecated alias for backward compat.
.github/copilot-instructions.md Add CLAUDE_SKIP_VSCODE_SETTINGS row to the env-var contract table.
README.md Document the opt-out in the Claude Code post-deploy section.
skills/claude-on-foundry/SKILL.md Add an entry to the MODIFY table.

Verification

Local tests on Windows / pwsh and Windows / git-bash:

  • Default (no env, no flag): .vscode/settings.json written as before. ✅
  • CLAUDE_SKIP_VSCODE_SETTINGS=1 (pwsh): skip message printed, no .vscode/ folder created, activator + .claude/settings.json still written, exit 0. ✅
  • CLAUDE_SKIP_VSCODE_SETTINGS=1 (bash): same as above. ✅
  • SKIP_VSCODE_SETTINGS=1 (bash, legacy alias): still works. ✅

Reported by @pamelafox: not everyone uses the Claude Code VS Code extension and getting .vscode/settings.json written by azd up is surprising. The script already had -SkipVsCodeSettings / --skip-vscode-settings flags, but the azd postprovision hook runs without arguments, so there was no way to opt out from azd up.\n\nThis adds CLAUDE_SKIP_VSCODE_SETTINGS as the env-var opt-out (matches 1/true/yes/on, case-insensitive). When set, the script prints a friendly skip message and leaves .vscode/settings.json alone. The activator at the repo root and .claude/settings.json are still written, so 'claude' from a sourced shell still works end to end. The bash script keeps SKIP_VSCODE_SETTINGS as a deprecated alias for backward compat.\n\nDocumented in README.md, .github/copilot-instructions.md, and skills/claude-on-foundry/SKILL.md.
@achandmsft achandmsft merged commit 556de49 into main May 29, 2026
5 checks passed
@achandmsft achandmsft deleted the feat/skip-vscode-settings-optout branch May 29, 2026 22:52
achandmsft added a commit that referenced this pull request May 29, 2026
…CLAUDE_WRITE_VSCODE_SETTINGS=1 (#28) (#29)

Follow-up to #25 / #26. The starter's primary consumers (Anthropic SDK users, Claude Code CLI users, OpenAI-compatible-client users) don't need .vscode/settings.json; only the Anthropic Claude Code VS Code extension does, and that's a niche. azd up writing into the workspace by default is surprising for the majority. Flip it: skip by default, opt in with CLAUDE_WRITE_VSCODE_SETTINGS=1 (or -WriteVsCodeSettings / --write-vscode-settings).\n\nKeeps CLAUDE_SKIP_VSCODE_SETTINGS, -SkipVsCodeSettings, and --skip-vscode-settings as deprecated no-ops so anyone who already set them after #26 doesn't break. Skipping is the default now anyway.\n\nUpdated README post-deploy section (step 2 marked Opt-in, lead-in line no longer claims the hook writes the file), copilot-instructions env-var table, and SKILL.md MODIFY table.

Co-authored-by: Arun Sekhar <achand@microsoft.com>
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.

Add CLAUDE_SKIP_VSCODE_SETTINGS opt-out for the postprovision hook

1 participant