sessions
microsoft/vscode
Core principles and workflow router for VS Code Agents Window development under src/vs/sessions.
What is sessions?
This skill provides architectural guidance and workflow routing for implementing, reviewing, or designing changes to the Agents Window in VS Code. It establishes core principles around layer direction, state management with observables, provider-neutral shared code, and specification-driven development to maintain a stable architecture.
- Routes changes to the correct owning area using a specification map (LAYERS, SESSIONS, AUTOMATIONS, LAYOUT, etc.)
- Enforces core principles: layer direction, provider neutrality, observable state, menu registration, and contribution entry points
- Guides inspection workflow: tracing implementation, searching for shared helpers, confirming layer ownership before changes
- Defines implementation contracts for ISessionsManagementService, ISessionsService, ISession, and IChat interfaces
- Establishes specification edit gates to distinguish between bug fixes, contract changes, and documentation updates
- Validates changes proportionally with focused unit tests, layer checks, and targeted type checking
How to install sessions
npx skills add https://github.com/microsoft/vscode --skill sessionsHow to use sessions
- 1.Start with src/vs/sessions/README.md to understand the overall structure
- 2.Identify the owning area using the specification map in section 2 (LAYERS, SESSIONS, AUTOMATIONS, LAYOUT, etc.)
- 3.Read only the focused specification relevant to your change, not the entire learning inbox
- 4.Inspect the current implementation, tests, and existing shared helpers before making changes
- 5.Apply the core principles and implement the contract using the appropriate service interfaces and entry points
- 6.Validate with focused unit tests and layer checks; update specifications only when contracts change, not for bug fixes or styling
Use cases
- Implementing new features in the Agents Window while preserving layer boundaries and provider neutrality
- Reviewing pull requests to ensure changes follow core principles and update specifications only when contracts change
- Designing session state management using observables and event notifications instead of parallel state models
- Routing provider-specific behavior to the correct contribution entry point (sessions.*.main.ts)
- Maintaining architectural consistency across Sessions, Workbench, and provider layers
- VS Code contributors working on Agents Window features
- Architects reviewing Sessions-related pull requests
- Developers implementing session state, chat models, or provider integrations
- Teams maintaining provider-specific contributions (Copilot Chat, Agent Host, Remote Agent Host)
sessions FAQ
Update specifications only when component ownership, interface/lifecycle contracts, state machines, persistence, or cross-component invariants change. Bug fixes, styling, copy, action placement, telemetry, settings defaults, and implementation algorithms belong in code and focused tests.
Preserve layer direction (vs/sessions imports vs/workbench, never reverse); keep shared code provider-neutral; model mutable state with observables; register menus in browser/menus.ts; import contributions from sessions.*.main.ts; prefer Sessions-owned adaptations; put stable architecture in specifications and concrete behavior in tests.
Consult the specification map in section 2: LAYERS.md for folder ownership, SESSIONS.md for session/chat model, AUTOMATIONS.md for automations, LAYOUT.md for UI presentation, and provider-specific specs for Copilot Chat, Agent Host, or Remote Agent Host changes.
Run focused unit tests for affected behavior, npm run valid-layers-check if imports change, targeted type checking for TypeScript changes, and relevant integration/E2E tests for cross-process or UI work. Documentation changes need link and consistency checks.
Invoke accessibility, design, CSS, layout, or theming skills for UI work; invoke specialist skills for agent, LLM, policy, permissions, telemetry, or managed-setting changes before implementation.
Full instructions (SKILL.md)
Source of truth, from microsoft/vscode.
name: sessions description: Core principles and workflow router for changes to the Agents Window under src/vs/sessions.
Agents Window development
Use this skill for implementation, review, or design work under src/vs/sessions/**.
1. Apply the core principles
- Preserve the layer direction:
vs/sessionsmay importvs/workbenchand lower layers;vs/workbenchmust never importvs/sessions. - Keep shared Sessions code provider-neutral. Non-provider contributions must not import provider implementations.
- Model mutable session and chat state with observables. Use events for notifications, not as a parallel state model or for control flow.
- Register Sessions menu IDs in
browser/menus.tsand consumeMenus.*. - Import contributions from the appropriate
sessions.*.main.tsentry point. - Prefer Sessions-owned adaptations over shared workbench changes unless the capability is genuinely shared.
- Put stable architecture in the owning specification and concrete behavior in tests. Do not preserve implementation chronology as development guidance.
2. Identify the owning area
Start with src/vs/sessions/README.md, then read only the specifications relevant to the change:
| Area | Specification |
|---|---|
| Layering, folder ownership, cross-module imports | src/vs/sessions/LAYERS.md |
| Session/chat model, services, provider contract, core data flow | src/vs/sessions/SESSIONS.md |
| Automations ownership, routing, migration, persistence, and run lifecycle | src/vs/sessions/AUTOMATIONS.md |
| Workbench parts, grid, title bar, editor presentation | src/vs/sessions/LAYOUT.md |
| Session-aware layout state and restoration | src/vs/sessions/LAYOUT_CONTROLLER.md |
| Single-pane behavior and expected compositions | src/vs/sessions/SINGLE_PANE_SCENARIOS.md |
| Sessions sidebar list, grouping, filtering, and persistence | src/vs/sessions/SESSIONS_LIST.md |
| Phone layout and mobile components | src/vs/sessions/MOBILE.md |
| AI customizations | src/vs/sessions/AI_CUSTOMIZATIONS.md |
| Copilot customizations | src/vs/sessions/copilot-customizations-spec.md |
| Copilot Chat provider | src/vs/sessions/contrib/providers/copilotChatSessions/COPILOT_CHAT_SESSIONS_PROVIDER.md |
| Agent Host provider | src/vs/sessions/contrib/providers/agentHost/AGENT_HOST_SESSIONS_PROVIDER.md |
| Remote Agent Host provider | src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md |
Do not load the learning inbox by default. Search its headings and scopes, then read only matching entries after the authoritative specification.
3. Inspect before changing
- Trace the current implementation and its existing tests.
- Search for shared helpers, context keys, menu IDs, entry-point imports, and provider abstractions before adding new ones.
- Confirm which layer owns the behavior. Keep provider-specific decisions in the provider and view/layout decisions in Sessions-owned browser code.
- For UI work, also invoke the applicable accessibility, design, CSS, layout, or theming skill.
- For agent, LLM, policy, permissions, telemetry, or managed-setting changes, invoke the applicable specialist skill before implementation.
4. Implement the contract
Apply the core principles and the focused specification. Prefer small changes that preserve these boundaries:
ISessionsManagementServiceowns model orchestration and provider routing.ISessionsServiceowns visible and active session behavior.- Providers expose provider-neutral state through
ISessionandIChat. - Session state is observable; consumers derive UI state reactively.
- Contributions load through the appropriate
sessions.*.main.tsentry point. - Sessions menus use the shared
Menusregistry. - Shared workbench changes represent shared capability, not Sessions-specific policy.
Specification edit gate
Bug fixes do not update specifications when they restore an existing contract. Before editing an authoritative specification, identify all three:
- the existing ownership, interface, lifecycle, state-machine, persistence, or cross-component contract that intentionally changes;
- the implementation surfaces affected by that contract change;
- why a regression test and a brief code comment cannot fully represent it.
If any answer is missing, leave the specification unchanged. Put concrete behavior in a focused test, keep a non-obvious implementation constraint beside the owning code, and preserve investigation history in the issue or pull request.
Update a specification only when component ownership, an interface or lifecycle contract, a state machine, persistence, or a cross-component invariant changes. Do not update specifications for styling, copy, action placement, telemetry fields, settings defaults, implementation algorithms, or individual bug fixes. Those details belong in code and focused tests.
5. Validate proportionally
Run the smallest existing checks that cover the change:
- focused unit tests for affected behavior;
npm run valid-layers-checkwhen imports or module ownership change;- targeted type checking or compilation when TypeScript changes warrant it;
- relevant integration, E2E, or visual validation for cross-process or UI work.
Documentation-only changes require link, path, and consistency checks rather than a full build.
6. Record feedback correctly
When a user explicitly corrects or rejects an approach, invoke the feedback-learning skill unless they use the literal learn! trigger. Literal learn! requests follow .github/instructions/learnings.instructions.md instead. A durable architecture invariant belongs in the owning specification, concrete behavior belongs in a regression test, and unproven reusable guidance belongs temporarily in the scoped learning inbox. Never append every correction to this skill.
7. Maintain this skill
Update this skill only when a principle is stable, cross-cutting, and useful for most Agents Window work, or when the routing/workflow itself changes. Put subsystem contracts in their focused specification and bug behavior in tests.
Keep the core-principles section at no more than ten bullets. Before adding one, merge overlap, remove obsolete guidance, and prefer rewriting an existing principle. Never append incident-specific details or use this skill as a learning log.
Related skills
More from microsoft/vscode and the wider catalog.

tool-rename-deprecation
Preserve backward compatibility when renaming tool references by maintaining legacy name arrays.

update-screenshots
Update VS Code component screenshot baselines when CI hash checks fail.

accessibility
Ensure VS Code features are accessible to all users with keyboard navigation, screen reader support, and ARIA annotations.

agent-sessions-layout
Agents workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agents workbench layout.
microsoft-docs
Agent skill from microsoftdocs/mcp.

ccf-common
Shared preflight controls for CCFA specialist skills: routing, scope, prerequisites, evidence rules, and artifact contracts.