Official agent skill

Settings Precedence

by microsoft in microsoft/vscode-python-environments

VS Code settings precedence rules and common pitfalls. An agent skill from microsoft/vscode-python-environments.

OfficialMITAuto-check passedTesting & QA

Install Settings Precedence

skills CLI
$ npx skills add microsoft/vscode-python-environments --skill settings-precedence -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/vscode-python-environments settings-precedence --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/vscode-python-environments.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/settings-precedence .claude/skills/settings-precedence && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
settings-precedence
GitHub stars
141
Token cost
~2.2k tokens
SKILL.md length
202 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

VS Code settings precedence rules and common pitfalls. An agent skill from microsoft/vscode-python-environments.

  • Works in 4 steps: Workspace folder value - Per-folder in… → Workspace value - .vscode/settings.json… → User/global value - User settings.json → …
  • Testing & QA work in your project
  • SKILL.md covers Precedence Order (Highest to…, Core Rules, Multi-Root Workspace Handling and Common Issues, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Settings Precedence is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. VS Code settings precedence rules and common pitfalls. Essential for any code that reads or writes settings. Covers getConfiguration scope, inspect() vs get(), and multi-workspace handling.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA. It works with Visual Studio Code and npm. The repository describes itself as: VS Code extension for Python environment and package management. The licence is MIT.

When your agent uses it

  • Testing & QA work in your project

Example prompts

  • “/settings-precedence”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Workspace folder value - Per-folder in multi-root workspace
  2. Workspace value - .vscode/settings.json or .code-workspace
  3. User/global value - User settings.json
  4. Default value - From extension's package.json (⚠️ may come from other extensions!)

What it can do on your machine

Read from SKILL.md and the folder at commit 7c894fc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Settings Precedence loads about 2.2k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 202 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/vscode-python-environments at commit 7c894fc, republished under its MIT licence (© microsoft). 202 words, ~2,171 tokens.

Download SKILL.mdSave it as .claude/skills/settings-precedence/SKILL.md (or your agent's skills folder).
name
settings-precedence
description
VS Code settings precedence rules and common pitfalls. Essential for any code that reads or writes settings. Covers getConfiguration scope, inspect() vs get(), and multi-workspace handling.
argument-hint
Review settings handling in [file or component]
user-invocable
false

VS Code Settings Precedence

Settings precedence bugs corrupt user configurations. This skill documents the correct patterns.

Precedence Order (Highest to Lowest)

  1. Workspace folder value - Per-folder in multi-root workspace
  2. Workspace value - .vscode/settings.json or .code-workspace
  3. User/global value - User settings.json
  4. Default value - From extension's package.json (⚠️ may come from other extensions!)

Core Rules

Rule 1: Always Pass Scope to getConfiguration()
typescript
// ❌ WRONG: Missing scope
const config = vscode.workspace.getConfiguration('python-envs');
const value = config.get('pythonProjects');
// workspaceFolderValue will be UNDEFINED because VS Code doesn't know which folder!

// ✅ RIGHT: Pass scope (workspace folder or document URI)
const config = vscode.workspace.getConfiguration('python-envs', workspaceFolder);
const value = config.get('pythonProjects');

When to pass scope:

  • Reading per-resource settings (scope: "resource" in package.json)
  • Any multi-workspace scenario
  • When you need workspaceFolderValue from inspect()
Rule 2: Use inspect() to Check Explicit Values
typescript
// ❌ WRONG: get() returns defaultValue even from other extensions!
const config = vscode.workspace.getConfiguration('python');
if (config.get('useEnvironmentsExtension')) {
    // May return true from another extension's package.json default!
}

// ✅ RIGHT: Use inspect() and check explicit values only
const config = vscode.workspace.getConfiguration('python', scope);
const inspected = config.inspect('useEnvironmentsExtension');

const hasExplicitValue =
    inspected?.globalValue !== undefined ||
    inspected?.workspaceValue !== undefined ||
    inspected?.workspaceFolderValue !== undefined;

if (hasExplicitValue) {
    // User explicitly set this value
    const effectiveValue = inspected?.workspaceFolderValue ?? inspected?.workspaceValue ?? inspected?.globalValue;
}
Rule 3: Don't Overwrite User's Explicit Values
typescript
// ❌ WRONG: Unconditionally writing to settings
await config.update('pythonPath', detectedPath, ConfigurationTarget.Workspace);
// Overwrites user's explicit choice!

// ✅ RIGHT: Check for existing explicit values first
const inspected = config.inspect('pythonPath');
const hasUserValue = inspected?.workspaceValue !== undefined;

if (!hasUserValue) {
    // Only set if user hasn't explicitly chosen
    await config.update('pythonPath', detectedPath, ConfigurationTarget.Workspace);
}
Rule 4: Update at the Correct Scope
typescript
// Configuration targets (least to most specific)
ConfigurationTarget.Global; // User settings.json
ConfigurationTarget.Workspace; // .vscode/settings.json or .code-workspace
ConfigurationTarget.WorkspaceFolder; // Per-folder in multi-root

// To remove a setting, update with undefined
await config.update('pythonPath', undefined, ConfigurationTarget.Workspace);

Multi-Root Workspace Handling

The workspace Property

For multi-root workspaces, pythonProjects settings need a workspace property:

json
{
    "python-envs.pythonProjects": [
        {
            "path": ".",
            "workspace": "/path/to/workspace-folder",
            "envManager": "ms-python.python:venv"
        }
    ]
}

Without the workspace property, settings get mixed up between folders.

Getting the Right Workspace Folder
typescript
// ❌ WRONG: Always using first workspace folder
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];

// ✅ RIGHT: Get folder for specific document/file
const workspaceFolder = vscode.workspace.getWorkspaceFolder(documentUri) ?? vscode.workspace.workspaceFolders?.[0];

// When you have a path but not a URI
const uri = vscode.Uri.file(filePath);
const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);

Common Issues

Issue: workspaceFolderValue is undefined

Cause: Missing scope parameter in getConfiguration()

typescript
// This returns undefined for workspaceFolderValue!
const config = vscode.workspace.getConfiguration('python-envs');
const inspected = config.inspect('pythonProjects');
console.log(inspected?.workspaceFolderValue); // undefined!

// Fix: Pass scope
const config = vscode.workspace.getConfiguration('python-envs', workspaceFolder.uri);
const inspected = config.inspect('pythonProjects');
console.log(inspected?.workspaceFolderValue); // Now works!
Issue: defaultValue from other extensions

Cause: Using get() instead of inspect() for boolean checks

The defaultValue in inspect() may come from ANY extension's package.json, not just yours:

typescript
// Another extension might have in their package.json:
// "python.useEnvironmentsExtension": { "default": true }

// Your check will be wrong:
config.get('python.useEnvironmentsExtension') // true from other extension!

// Fix: Only check explicit values
const inspected = config.inspect('python.useEnvironmentsExtension');
if (inspected?.globalValue === true || ...) { }
Issue: Settings overwritten on reload

Cause: Not checking for existing values before writing

typescript
// During extension activation, this overwrites user's config!
await config.update('defaultEnvManager', 'venv', ConfigurationTarget.Global);

// Fix: Only write defaults if no value exists
const current = config.inspect('defaultEnvManager');
if (current?.globalValue === undefined && current?.workspaceValue === undefined) {
    await config.update('defaultEnvManager', 'venv', ConfigurationTarget.Global);
}
Issue: Settings mixed up in multi-root

Cause: Not including workspace identifier in settings

typescript
// Without workspace identifier, can't tell which folder this belongs to
{
    "python-envs.pythonProjects": [
        { "path": ".", "envManager": "venv" }  // Which workspace?
    ]
}

// Fix: Always include workspace when saving
const project = {
    path: projectPath,
    workspace: workspaceFolder.uri.fsPath,
    envManager: selectedManager
};

Complete Example: Safe Settings Read/Write

typescript
import * as vscode from 'vscode';

async function getProjectConfig(projectUri: vscode.Uri): Promise<ProjectConfig | undefined> {
    const workspaceFolder = vscode.workspace.getWorkspaceFolder(projectUri);
    if (!workspaceFolder) {
        return undefined;
    }

    // Always pass scope!
    const config = vscode.workspace.getConfiguration('python-envs', workspaceFolder.uri);

    // Use inspect() to understand where values come from
    const inspected = config.inspect<ProjectConfig[]>('pythonProjects');

    // Prefer most specific value
    const projects = inspected?.workspaceFolderValue ?? inspected?.workspaceValue ?? inspected?.globalValue ?? []; // Don't use defaultValue!

    // Find project matching the URI
    return projects.find((p) => path.resolve(workspaceFolder.uri.fsPath, p.path) === projectUri.fsPath);
}

async function saveProjectConfig(projectUri: vscode.Uri, projectConfig: ProjectConfig): Promise<void> {
    const workspaceFolder = vscode.workspace.getWorkspaceFolder(projectUri);
    if (!workspaceFolder) {
        return;
    }

    const config = vscode.workspace.getConfiguration('python-envs', workspaceFolder.uri);

    const inspected = config.inspect<ProjectConfig[]>('pythonProjects');

    // Get existing projects (not including defaults!)
    const existingProjects = inspected?.workspaceFolderValue ?? inspected?.workspaceValue ?? [];

    // Ensure workspace property for multi-root
    const configToSave: ProjectConfig = {
        ...projectConfig,
        workspace: workspaceFolder.uri.fsPath,
    };

    // Update or add
    const projectIndex = existingProjects.findIndex(
        (p) => path.resolve(workspaceFolder.uri.fsPath, p.path) === projectUri.fsPath,
    );

    const updatedProjects = [...existingProjects];
    if (projectIndex >= 0) {
        updatedProjects[projectIndex] = configToSave;
    } else {
        updatedProjects.push(configToSave);
    }

    // Write to workspace folder scope in multi-root
    const target =
        vscode.workspace.workspaceFolders?.length > 1
            ? vscode.ConfigurationTarget.WorkspaceFolder
            : vscode.ConfigurationTarget.Workspace;

    await config.update('pythonProjects', updatedProjects, target);
}

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/settings-precedence of microsoft/vscode-python-environments.

Open the folder on GitHubat commit 7c894fc

Compare with similar skills

Settings Precedence next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Settings Precedence compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Settings Precedence this skillmicrosoft/vscode-python-environments141—~2.2kAutomated safety check: PassMIT
Blockless Extension E2EFreakStudioCN/mpy-hardware-extension146—~1.2kAutomated safety check: NotesCustom licence
Trust Vscode QualityjohannesPettersson80/trust-platform222—~633Automated safety check: PassApache-2.0
Verificationforcedotcom/salesforcedx-vscode1k—~458Automated safety check: PassBSD-3-Clause
Prepare Rslint npm Releaseweb-infra-dev/rslint461—~1.5kAutomated safety check: PassMIT
Releasesignageos/vscode-sops122—~2.2kAutomated safety check: NotesMIT

Similar skills

  • Blockless Extension E2E

    FreakStudioCN/mpy-hardware-extension

    Run and debug the Blockless VS Code extension release gate: CI-equivalent API and extension tests, V0 protocol smoke, live DeepSeek full-stack e2e, VSIX packaging, local reinstall, direct…

    146 GitHub stars~1.2k tokensUpdated 11 days ago
    Testing & QAAuto-check: notes
  • Trust Vscode Quality

    johannesPettersson80/trust-platform

    Implement and verify trust-platform VS Code extension quality gates.

    222 GitHub stars~633 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Verification

    forcedotcom/salesforcedx-vscode

    Verification steps for code changes. An agent skill from forcedotcom/salesforcedx-vscode.

    1k GitHub stars~458 tokensUpdated today
    Testing & QAAuto-check passed
  • Prepare Rslint npm Release

    web-infra-dev/rslint

    Prepare a stable release PR for the unified rslint npm packages by updating package versions and rule/TypeScript release metadata.

    461 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Release

    signageos/vscode-sops

    Releases the vscode-sops extension end-to-end: determines the next version from the bump history, updates CHANGELOG.md and package.json/package-lock.json, builds via vscode:prepublish, publishes to…

    122 GitHub stars~2.2k tokensUpdated 6 mo ago
    DevelopmentAuto-check: notes
  • ccwf Workflow CLI

    breaking-brake/cc-wf-studio

    Teaches the agent to use the ccwf command line tool to validate, preview, render, export and run cc-wf-studio workflow JSON files without opening VS Code.

    5.4k GitHub stars~3.3k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

More from microsoft/vscode-python-environments

All 9 skills in this repo
  • Cross Platform Paths

    microsoft/vscode-python-environments

    Official

    Critical patterns for cross-platform path handling in this VS Code extension.

    141 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Python Manager Discovery

    microsoft/vscode-python-environments

    Official

    Environment manager-specific discovery patterns and known issues.

    141 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Run E2E Tests

    microsoft/vscode-python-environments

    Official

    Run E2E tests to verify complete user workflows like environment discovery, creation, and selection.

    141 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Run Integration Tests

    microsoft/vscode-python-environments

    Official

    Run integration tests to verify that extension components work together correctly.

    141 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Run Smoke Tests

    microsoft/vscode-python-environments

    Official

    Run smoke tests to verify extension functionality in a real VS Code environment.

    141 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Debug Failing Test

    microsoft/vscode-python-environments

    Official

    Debug a failing test using an iterative logging approach, then clean up and document the learning.

    141 GitHub stars~780 tokensUpdated today
    Auto-check passed

Categories

Questions about Settings Precedence

What does Settings Precedence do?

VS Code settings precedence rules and common pitfalls. An agent skill from microsoft/vscode-python-environments. Settings Precedence is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. VS Code settings precedence rules and common pitfalls.

When should I use Settings Precedence?

Settings Precedence fits situations like: testing & QA work in your project.

How do I install Settings Precedence in Claude Code?

Run `npx skills add microsoft/vscode-python-environments --skill settings-precedence -a claude-code`. Or copy the skill folder (.github/skills/settings-precedence in microsoft/vscode-python-environments) into .claude/skills/settings-precedence in your project. Claude Code loads it when a task matches its description.

How do I install Settings Precedence in Codex?

Run `npx skills add microsoft/vscode-python-environments --skill settings-precedence -a codex`. Or copy the skill folder (.github/skills/settings-precedence in microsoft/vscode-python-environments) into .agents/skills/settings-precedence in your project. Codex loads it when a task matches its description.

Can I use Settings Precedence in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/vscode-python-environments --skill settings-precedence -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/settings-precedence, .gemini/skills/settings-precedence, .github/skills/settings-precedence and .opencode/skills/settings-precedence in your project.

What does Settings Precedence need to run?

SKILL.md names no scripts, command-line tools or credentials: Settings Precedence is instructions for the agent only.

Does Settings Precedence access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Settings Precedence safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Settings Precedence use?

Settings Precedence is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Settings Precedence use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Settings Precedence?

Skills that share tags, products or a category with Settings Precedence: Blockless Extension E2E (FreakStudioCN/mpy-hardware-extension, 146 stars), Trust Vscode Quality (johannesPettersson80/trust-platform, 222 stars), Verification (forcedotcom/salesforcedx-vscode, 1k stars) and Prepare Rslint npm Release (web-infra-dev/rslint, 461 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Settings Precedence?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/vscode-python-environments, which has 141 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/vscode-python-environments on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.