Skip to content

Flip postprovision default: don't write .vscode/settings.json unless CLAUDE_WRITE_VSCODE_SETTINGS=1#29

Merged
achandmsft merged 1 commit into
mainfrom
feat/flip-vscode-settings-default-optin
May 29, 2026
Merged

Flip postprovision default: don't write .vscode/settings.json unless CLAUDE_WRITE_VSCODE_SETTINGS=1#29
achandmsft merged 1 commit into
mainfrom
feat/flip-vscode-settings-default-optin

Conversation

@achandmsft
Copy link
Copy Markdown
Collaborator

Fixes #28. Follow-up to #25 / #26.

Flips the default behavior of the postprovision hook: by default it no longer writes .vscode/settings.json. Users who want the Anthropic Claude Code VS Code extension wired up automatically can opt in with CLAUDE_WRITE_VSCODE_SETTINGS=1.

Why

The starter's primary consumers are people building with the Anthropic SDK, calling Foundry from Copilot Chat / AI Toolkit, or running the Claude Code CLI (which only needs the claude-code.env.{ps1,sh} activator at the repo root — no .vscode/settings.json required). The VS Code extension is a niche layered on top.

azd up writing into the workspace by default is surprising for the majority and only benefits the minority, so flipping the default is the right call.

Usage

azd env set CLAUDE_WRITE_VSCODE_SETTINGS 1
azd up

Or pass -WriteVsCodeSettings / --write-vscode-settings when re-running the script standalone.

When the user has not opted in, the script now prints:

Skipping .vscode/settings.json (opt-in). Set 'azd env set CLAUDE_WRITE_VSCODE_SETTINGS 1' before 'azd up' to wire up the Anthropic Claude Code VS Code extension automatically. The activator above already works for sourced shells.

And the closing banner adapts: if .vscode/settings.json was written, it points the user at the extension. If not, it shows the opt-in command.

Backward compat

CLAUDE_SKIP_VSCODE_SETTINGS, -SkipVsCodeSettings, and --skip-vscode-settings (all from #26) are kept as deprecated no-ops so anyone who already set them doesn't break. Skipping is the default now anyway.

Changes

File Change
scripts/configure-claude-code.ps1 New -WriteVsCodeSettings switch + CLAUDE_WRITE_VSCODE_SETTINGS env var (matches 1/true/yes/on). -SkipVsCodeSettings kept as deprecated no-op. Default flow: skip with opt-in hint.
scripts/configure-claude-code.sh New --write-vscode-settings flag + CLAUDE_WRITE_VSCODE_SETTINGS env var. --skip-vscode-settings / CLAUDE_SKIP_VSCODE_SETTINGS kept as deprecated no-ops.
README.md Step 2 of "Claude Code post-deploy setup" now marked (Opt-in) with opt-in command and rationale; lead-in line no longer claims the hook writes .vscode/settings.json.
.github/copilot-instructions.md Replaced CLAUDE_SKIP_VSCODE_SETTINGS row with CLAUDE_WRITE_VSCODE_SETTINGS row in the env-var contract table.
skills/claude-on-foundry/SKILL.md Replaced "Skip the .vscode/settings.json write" MODIFY-table row with "Wire up the Claude Code VS Code extension".

Verification

Local tests on Windows / pwsh and Windows / git-bash — all 6 paths behave correctly:

Scenario .vscode/settings.json written? Notes
.ps1 default no prints opt-in hint
.ps1 + CLAUDE_WRITE_VSCODE_SETTINGS=1 yes prints "Wrote VS Code settings"
.ps1 + deprecated CLAUDE_SKIP_VSCODE_SETTINGS=1 no no-op (skipping is the default)
.sh default no prints opt-in hint
.sh + CLAUDE_WRITE_VSCODE_SETTINGS=1 yes prints "Wrote VS Code settings"
.sh + deprecated CLAUDE_SKIP_VSCODE_SETTINGS=1 no no-op

-SkipVsCodeSettings / --skip-vscode-settings flags also still parse cleanly (exit 0) so existing CI / docs that pass them don't break.

…CLAUDE_WRITE_VSCODE_SETTINGS=1 (#28)

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.
@achandmsft achandmsft merged commit 30ec2cd into main May 29, 2026
5 checks passed
@achandmsft achandmsft deleted the feat/flip-vscode-settings-default-optin branch May 29, 2026 23:06
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.

Flip postprovision default: don't write .vscode/settings.json unless CLAUDE_WRITE_VSCODE_SETTINGS=1

1 participant