Add CLAUDE_SKIP_VSCODE_SETTINGS opt-out for postprovision hook#26
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonwhen the user doesn't want it. The activator at the repo root and.claude/settings.jsonare still written, soclaudefrom 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 byazd upis 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 upOr pass
-SkipVsCodeSettings/--skip-vscode-settingswhen re-running the script standalone (those flags already existed).When the opt-out fires the script prints:
Changes
scripts/configure-claude-code.ps1$env:CLAUDE_SKIP_VSCODE_SETTINGS(matches1/true/yes/on, case-insensitive); skip the.vscode/settings.jsonblock with a friendly note when set.scripts/configure-claude-code.sh$CLAUDE_SKIP_VSCODE_SETTINGS; same matching rules. KeepSKIP_VSCODE_SETTINGSas a deprecated alias for backward compat..github/copilot-instructions.mdCLAUDE_SKIP_VSCODE_SETTINGSrow to the env-var contract table.README.mdskills/claude-on-foundry/SKILL.mdVerification
Local tests on Windows / pwsh and Windows / git-bash:
.vscode/settings.jsonwritten as before. ✅CLAUDE_SKIP_VSCODE_SETTINGS=1(pwsh): skip message printed, no.vscode/folder created, activator +.claude/settings.jsonstill written, exit 0. ✅CLAUDE_SKIP_VSCODE_SETTINGS=1(bash): same as above. ✅SKIP_VSCODE_SETTINGS=1(bash, legacy alias): still works. ✅