sessions
Skill175 starsChanged 8 months agoMITView on GitHub
Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.
24 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- EthanLLL/loomtheir own version, first seen Nov 8, 2026
- Mereithhh/very-happytheir own version, first seen Nov 6, 2026
- microsoft/vscodetheir own version, first seen Nov 2, 2026
- griffinhilly/claude-code-synthesistheir own version, first seen Nov 1, 2026
- phnx-labs/agi-clitheir own version, first seen Oct 26, 2026
- phnx-labs/.agentstheir own version, first seen Oct 11, 2026
Used with
Projects with it also use metrics-graphana, control-flow and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
slopusSkillmetrics-graphana
Query and manage Grafana dashboards and Prometheus metrics for Happy infrastructure. Covers grafanactl CLI usage, direct Prometheus queries through Grafana proxy, and dashboard-as-code workflows. Use when user asks about metrics, dashboards, monitoring, Grafana, Prometheus, or wants to add/modify panels.
Also in 3 projects that use this
slopusSkillcontrol-flow
Analyze and design control flows and data structures. Produces compact ASCII tree diagrams showing triggers, call chains, payload shapes, state mutations, and re-render effects. Use when user asks to diagram, trace, visualize, or design a flow or data structure.
Also in 3 projects that use this
TheKREATORSSkillrefactor-clean
No description
Also in 3 projects that use this
AnthropicSkilloffice-hours
Set up and run Claude Code office hours, including the calendar event when the champion's own calendar connector allows it. Use when a champion wants a regular time for teammates to bring problems.
Also in 3 projects that use this
MicrosoftSkilldev
Development workflows for the playwright-cli repository. Use when the user asks about rolling dependencies, releasing, or other repo maintenance tasks.
Also in 3 projects that use this
ryu111Skillbrowser
agent-browser CLI 瀏覽器自動化指南。E2E 測試、UI 調試、設計驗證。適用於需要實際操作瀏覽器的場景。
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 1
- cpkt9762/opencode-vscode-ide★ 17100% same
Edited · 2
- gitpod-io/openvscode-server★ 6.2k75% same
- xAmirHamza77/OmniCode★ 1211% same
Wrote their own version · 21
- microsoft/vscode★ 195ksame name
- slopus/happy★ 25ksame name
- posit-dev/positron★ 4.3ksame name
- NeuralInverse/neuralinverse★ 221same name
- Altman-conquer/agentrejoin★ 75same name
- griffinhilly/claude-code-synthesis★ 67same name
- elijahmuraoka/skills★ 58same name
- phnx-labs/agi-cli★ 26same name
- last9/mithai★ 20same name
- jiten-singh-shahi/salesforce-claude-code★ 15same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- launchSkill
- accessibilitySkill
- add-policySkill
- agent-sessions-layoutSkill
- author-contributionsSkill
- auto-perf-optimizeSkill
- azure-pipelinesSkill
- chat-customizations-editorSkill
- chat-perfSkill
- component-fixturesSkill
- cpu-profile-analysisSkill
- fix-ci-failuresSkill
- fix-errorsSkill
- heap-snapshot-analysisSkill
- hygieneSkill
- integration-testsSkill
- memory-leak-auditSkill
- tool-rename-deprecationSkill
- unit-testsSkill
- update-screenshotsSkill
- vscode-dev-workbenchSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 4 are distinctive, and 19 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 6
When working on the Agents window (src/vs/sessions/), always follow these guidelines:
- Very specific: line 19
If you modify the implementation, you must update the corresponding spec to keep it in sync.
- Very specific: line 40
Run npm run valid-layers-check to verify layering
- Very specific: line 118
Use the agent-sessions-layout skill for detailed guidance on the layout.
- Very specific: line 165
Read browser/widget/AGENTS_CHAT_WIDGET.md for the full architecture.
- Very specific: line 266
Use Menus.* from browser/menus.ts for menu registrations — never shared MenuId.*
- Very specific: line 267
Use separate storage keys prefixed with workbench.agentsession.* or workbench.chatbar.*
- Distinctive: line 268
Use agent session part classes, not standard workbench parts
- Very specific: line 273
Run npm run compile-check-ts-native to run a repo-wide TypeScript compilation check (including src/vs/sessions/).
- Very specific: line 274
Run npm run valid-layers-check to verify layering rules are not violated.
- Very specific: line 275
Use scripts/test.sh (or scripts\test.bat on Windows) for unit tests (add --grep <pattern> to filter tests)
- Very specific: line 277
Important: do not run tsc to check for TypeScript errors always use above methods to validate TypeScript changes in src/vs/.
- Very specific: line 282
Use the agent-sessions-layout skill for detailed implementation guidance
- Very specific: line 284
Update LAYOUT.md and its Revision History after any changes
- Very specific: line 291
Prefer composition over modifying core ChatWidget — add behavior in the wrapper
- Very specific: line 292
Use IAgentChatTargetConfig observable for target state, not direct session creation
- Very specific: line 293
Ensure initialSessionOptions travel atomically with the first request
- Distinctive: line 294
Test both first-load (extension not yet activated) and new-session flows
- Very specific: line 305
Check VS Code - Build task output for compilation errors before declaring work complete
- Very specific: line 306
Run npm run valid-layers-check for layering violations
- Very specific: line 307
Verify part visibility toggling (show/hide/maximize)
- Distinctive: line 308
Test editor modal open/close behavior
- Distinctive: line 309
Test sidebar footer renders with account widget
“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When working on the Agents window (src/vs/sessions/), always follow these guidelines:
1. Read the Specification Documents First
The src/vs/sessions/ directory contains authoritative specification documents. Always read the relevant spec before making changes.
| Document | Path | Covers |
| Layer spec | src/vs/sessions/README.md | Layering rules, dependency constraints, folder conventions |
| Layout spec | src/vs/sessions/LAYOUT.md | Grid structure, part positions, sizing, CSS classes, API reference |
| AI Customizations | src/vs/sessions/AI_CUSTOMIZATIONS.md | AI customization editor and tree view design |
| Chat Widget | src/vs/sessions/browser/widget/AGENTS_CHAT_WIDGET.md | Chat widget wrapper architecture, deferred session creation, option delivery |
If you modify the implementation, you must update the corresponding spec to keep it in sync. Update the Revision History table at the bottom of LAYOUT.md with a dated entry.
2. Architecture Overview
2.1 Layering
vs/base ← Foundation utilities
vs/platform ← Platform services
vs/editor ← Text editor core
vs/workbench ← Standard VS Code workbench
vs/sessions ← Agent Sessions window (this layer)Key constraint: vs/sessions may import from vs/workbench and all layers below it. vs/workbench must never import from vs/sessions.
2.2 Dependency Rules
- ✅ Import from
vs/base,vs/platform,vs/editor,vs/workbench - ✅ Import within
vs/sessions(internal) - ❌ Never import
vs/sessionsfromvs/workbench - Run
npm run valid-layers-checkto verify layering
2.3 How It Differs from VS Code
| Aspect | VS Code Workbench | Agents Window |
| Layout | Configurable part positions | Fixed layout, no settings customization |
| Chrome | Activity bar, status bar, banner | Simplified — none of these |
| Primary UX | Editor-centric | Chat-first (Chat Bar is a primary part) |
| Editors | In the grid layout | Modal overlay above the workbench |
| Titlebar | Menubar, editor actions, layout controls | Agent picker, run script, toggle sidebar/panel |
| Navigation | Activity bar with viewlets | Sidebar (views) + sidebar footer (account) |
| Entry point | vs/workbench workbench class | vs/sessions/browser/workbench.ts Workbench class |
3. Folder Structure
src/vs/sessions/
├── README.md # Layer specification (read first)
├── LAYOUT.md # Authoritative layout specification
├── AI_CUSTOMIZATIONS.md # AI customization design document
├── sessions.common.main.ts # Common (browser + desktop) entry point
├── sessions.desktop.main.ts # Desktop entry point (imports all contributions)
├── common/ # Shared types, context keys, and theme
│ ├── categories.ts # Command categories
│ ├── contextkeys.ts # ChatBar and welcome context keys
│ └── theme.ts # Theme contributions
├── browser/ # Core workbench implementation
│ ├── workbench.ts # Main Workbench class (implements IWorkbenchLayoutService)
│ ├── menus.ts # Agent sessions menu IDs (Menus export)
│ ├── layoutActions.ts # Layout toggle actions (sidebar, panel, auxiliary bar)
│ ├── paneCompositePartService.ts # AgenticPaneCompositePartService
│ ├── widget/ # Agent sessions chat widget
│ │ └── AGENTS_CHAT_WIDGET.md # Chat widget architecture doc
│ ├── parts/ # Workbench part implementations
│ │ ├── parts.ts # AgenticParts enum
│ │ ├── titlebarPart.ts # Titlebar (3-section toolbar layout)
│ │ ├── sidebarPart.ts # Sidebar (with footer for account widget)
│ │ ├── chatBarPart.ts # Chat Bar (primary chat surface)
│ │ ├── auxiliaryBarPart.ts # Auxiliary Bar
│ │ ├── panelPart.ts # Panel (terminal, output, etc.)
│ │ ├── projectBarPart.ts # Project bar (folder entries)
│ │ └── media/ # Part CSS files
│ └── media/ # Layout-specific styles
├── electron-browser/ # Desktop-specific entry points
│ ├── sessions.main.ts # Desktop main bootstrap
│ ├── sessions.ts # Electron process entry
│ ├── sessions.html # Production HTML shell
│ ├── sessions-dev.html # Development HTML shell
│ ├── titleService.ts # Desktop title service override
│ └── parts/
│ └── titlebarPart.ts # Desktop titlebar part
├── services/ # Service overrides
│ ├── configuration/browser/ # Configuration service overrides
│ └── workspace/browser/ # Workspace service overrides
├── test/ # Unit tests
│ └── browser/
│ └── layoutActions.test.ts
└── contrib/ # Feature contributions
├── accountMenu/browser/ # Account widget for sidebar footer
├── agentFeedback/browser/ # Agent feedback attachments, overlays, hover
├── aiCustomizationTreeView/browser/ # AI customization tree view sidebar
├── applyToParentRepo/browser/ # Apply changes to parent repo
├── changesView/browser/ # File changes view
├── chat/browser/ # Chat actions (run script, branch, prompts)
├── configuration/browser/ # Configuration overrides
├── files/browser/ # File-related contributions
├── fileTreeView/browser/ # File tree view (filesystem provider)
├── gitSync/browser/ # Git sync contributions
├── logs/browser/ # Log contributions
├── sessions/browser/ # Sessions view, title bar widget, active session service
├── terminal/browser/ # Terminal contributions
├── welcome/browser/ # Welcome view contribution
└── workspace/browser/ # Workspace contributions4. Layout
Use the agent-sessions-layout skill for detailed guidance on the layout. Key points:
4.1 Visual Layout
┌─────────┬───────────────────────────────────────────────────────┐
│ │ Titlebar │
│ ├────────────────────────────────────┬──────────────────┤
│ Sidebar │ Chat Bar │ Auxiliary Bar │
│ ├────────────────────────────────────┴──────────────────┤
│ │ Panel │
└─────────┴───────────────────────────────────────────────────────┘- Sidebar spans full window height (root grid level)
- Titlebar is inside the right section
- Chat Bar is the primary interaction surface
- Panel is hidden by default (terminal, output, etc.)
- Editor appears as a modal overlay, not in the grid
4.2 Parts
| Part | Default Visibility | Notes |
| Titlebar | Always visible | 3-section toolbar (left/center/right) |
| Sidebar | Visible | Sessions view, AI customization tree |
| Chat Bar | Visible | Primary chat widget |
| Auxiliary Bar | Visible | Changes view, etc. |
| Panel | Hidden | Terminal, output |
| Editor | Hidden | Main part hidden; editors open via MODAL_GROUP into ModalEditorPart |
Not included: Activity Bar, Status Bar, Banner.
4.3 Editor Modal
The main editor part is hidden (display:none). All editors open via MODAL_GROUP into the standard ModalEditorPart overlay (created on-demand by EditorParts.createModalEditorPart). The sessions configuration sets workbench.editor.useModal to 'all', which causes findGroup() to redirect all editor opens to the modal. Click backdrop or press Escape to dismiss.
5. Chat Widget
The Agents chat experience is built around AgentSessionsChatWidget — a wrapper around the core ChatWidget that adds:
- Deferred session creation — the UI is interactive before any session resource exists; sessions are created on first message send
- Target configuration — observable state tracking which agent provider (Local, Cloud) is selected
- Welcome view — branded empty state with mascot, target buttons, option pickers, and input slot
- Initial session options — option selections travel atomically with the first request
- Configurable picker placement — pickers can appear in welcome view, input toolbar, or both
Read browser/widget/AGENTS_CHAT_WIDGET.md for the full architecture.
Key classes:
AgentSessionsChatWidget(browser/widget/agentSessionsChatWidget.ts) — main wrapperAgentSessionsChatTargetConfig(browser/widget/agentSessionsChatTargetConfig.ts) — reactive target stateAgentSessionsChatWelcomePart(browser/parts/agentSessionsChatWelcomePart.ts) — welcome viewAgentSessionsChatInputPart(browser/parts/agentSessionsChatInputPart.ts) — standalone input adapter
6. Menus
The agents window uses its own menu IDs defined in browser/menus.ts via the Menus export. Never use shared MenuId.* constants from vs/platform/actions for agents window UI — use the Menus.* equivalents instead.
| Menu ID | Purpose |
Menus.ChatBarTitle | Chat bar title actions |
Menus.CommandCenter | Center toolbar with agent picker widget |
Menus.CommandCenterCenter | Center section of command center |
Menus.TitleBarContext | Titlebar context menu |
Menus.TitleBarLeftLayout | Left layout toolbar |
Menus.TitleBarSessionTitle | Agent title in titlebar |
Menus.TitleBarSessionMenu | Agent menu in titlebar |
Menus.TitleBarRightLayout | Right layout toolbar |
Menus.PanelTitle | Panel title bar actions |
Menus.SidebarTitle | Sidebar title bar actions |
Menus.SidebarFooter | Sidebar footer (account widget) |
Menus.SidebarCustomizations | Sidebar customizations menu |
Menus.AuxiliaryBarTitle | Auxiliary bar title actions |
Menus.AuxiliaryBarTitleLeft | Auxiliary bar left title actions |
Menus.AgentFeedbackEditorContent | Agent feedback editor content menu |
7. Context Keys
Defined in common/contextkeys.ts:
| Context Key | Type | Purpose |
activeChatBar | string | ID of the active chat bar panel |
chatBarFocus | boolean | Whether chat bar has keyboard focus |
chatBarVisible | boolean | Whether chat bar is visible |
sessionsWelcomeVisible | boolean | Whether the agents welcome overlay is visible |
8. Contributions
Feature contributions live under contrib/<featureName>/browser/ and are registered via imports in sessions.desktop.main.ts (desktop) or sessions.common.main.ts (browser-compatible).
8.1 Key Contributions
| Contribution | Location | Purpose |
| Sessions View | contrib/sessions/browser/ | Agents list in sidebar, agent picker, active session service |
| Title Bar Widget | contrib/sessions/browser/sessionsTitleBarWidget.ts | Agent picker in titlebar center |
| Account Widget | contrib/accountMenu/browser/ | Account button in sidebar footer |
| Chat Actions | contrib/chat/browser/ | Chat actions (run script, branch, prompts, customizations debug log) |
| Changes View | contrib/changesView/browser/ | File changes in auxiliary bar |
| Agent Feedback | contrib/agentFeedback/browser/ | Agent feedback attachments, editor overlays, hover |
| AI Customization Tree | contrib/aiCustomizationTreeView/browser/ | Sidebar tree for AI customizations |
| Apply to Parent Repo | contrib/applyToParentRepo/browser/ | Apply changes to parent repo |
| Files | contrib/files/browser/ | File-related contributions |
| File Tree View | contrib/fileTreeView/browser/ | File tree view (filesystem provider) |
| Git Sync | contrib/gitSync/browser/ | Git sync contributions |
| Logs | contrib/logs/browser/ | Log contributions |
| Terminal | contrib/terminal/browser/ | Terminal contributions |
| Welcome | contrib/welcome/browser/ | Welcome view contribution |
| Workspace | contrib/workspace/browser/ | Workspace contributions |
| Configuration | contrib/configuration/browser/ | Configuration overrides |
8.2 Service Overrides
The agents window registers its own implementations for:
IPaneCompositePartService→AgenticPaneCompositePartService(creates agent-specific parts)IPromptsService→AgenticPromptsService(scopes prompt discovery to active session worktree)IActiveSessionService→ActiveSessionService(tracks active session)
Service overrides also live under services/:
services/configuration/browser/- configuration service overridesservices/workspace/browser/- workspace service overrides
8.3 WindowVisibility.Sessions
Views and contributions that should only appear in the agents window (not in regular VS Code) use WindowVisibility.Sessions in their registration.
9. Entry Points
| File | Purpose |
sessions.common.main.ts | Common entry; imports browser-compatible services, workbench contributions |
sessions.desktop.main.ts | Desktop entry; imports desktop services, electron contributions, all contrib/ modules |
electron-browser/sessions.main.ts | Desktop bootstrap |
electron-browser/sessions.ts | Electron process entry |
electron-browser/sessions.html | Production HTML shell |
electron-browser/sessions-dev.html | Development HTML shell |
electron-browser/titleService.ts | Desktop title service override |
electron-browser/parts/titlebarPart.ts | Desktop titlebar part |
10. Development Guidelines
10.1 Adding New Features
- Core workbench code (layout, parts, services) →
browser/ - Feature contributions (views, actions, editors) →
contrib/<featureName>/browser/ - Register by importing in
sessions.desktop.main.ts(orsessions.common.main.tsfor browser-compatible) - Use
Menus.*frombrowser/menus.tsfor menu registrations — never sharedMenuId.* - Use separate storage keys prefixed with
workbench.agentsession.*orworkbench.chatbar.* - Use agent session part classes, not standard workbench parts
- Mark views with
WindowVisibility.Sessionsso they only appear in this window
10.2 Validating Changes
- Run
npm run compile-check-ts-nativeto run a repo-wide TypeScript compilation check (includingsrc/vs/sessions/). This is a fast way to catch TypeScript errors introduced by your changes. - Run
npm run valid-layers-checkto verify layering rules are not violated. - Use
scripts/test.sh(orscripts\test.baton Windows) for unit tests (add--grep <pattern>to filter tests)
Important do not run tsc to check for TypeScript errors always use above methods to validate TypeScript changes in src/vs/**.
10.3 Layout Changes
- Read
LAYOUT.mdfirst — it's the authoritative spec - Use the
agent-sessions-layoutskill for detailed implementation guidance - Maintain fixed positions — no settings-based customization
- Update
LAYOUT.mdand its Revision History after any changes - Preserve no-op methods for unsupported features (zen mode, centered layout, etc.)
- Handle pane composite lifecycle when hiding/showing parts
10.3 Chat Widget Changes
- Read
browser/widget/AGENTS_CHAT_WIDGET.mdfirst - Prefer composition over modifying core
ChatWidget— add behavior in the wrapper - Use
IAgentChatTargetConfigobservable for target state, not direct session creation - Ensure
initialSessionOptionstravel atomically with the first request - Test both first-load (extension not yet activated) and new-session flows
10.4 AI Customization Changes
- Read
AI_CUSTOMIZATIONS.mdfirst — it covers the management editor and tree view design - Lean on existing VS Code services (
IPromptsService,IMcpService,IChatService) - Browser compatibility required — no Node.js APIs
- Active worktree comes from
IActiveSessionService
10.5 Validation
- Check
VS Code - Buildtask output for compilation errors before declaring work complete - Run
npm run valid-layers-checkfor layering violations - Verify part visibility toggling (show/hide/maximize)
- Test editor modal open/close behavior
- Test sidebar footer renders with account widget
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

