vscode / copilot
Copilot instructions196k starsChanged 17 days agoMITView on GitHub
This is the GitHub Copilot Chat extension for Visual Studio Code - a VS Code extension that provides conversational AI assistance, a coding agent with many tools, inline editing capabilities, and advanced AI-powered features for VS Code. Choose validation based on the scope and risk of the change. Prefer existing diagnostics and the smallest targeted tests that cover the changed behavior. Do not start start-watch-tasks, run a full build, or make type checking a prerequisite for targeted tests solely as…
Trending
More talk lately.about the whole repository
Who's talking about microsoft/vscode
- A Hacker News story“VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage”Hacker News · May 2, 2026 · 1.5k points
- microsoft/TypeScript“Convert the codebase to modules”GitHub · Nov 2, 2022 · 1.3k reactions
- A Hacker News story“VS Code uses 13% CPU when idle due to blinking cursor rendering”Hacker News · Mar 23, 2017 · 899 points
- A Hacker News story“VS Code Roadmap 2018”Hacker News · Nov 1, 2017 · 360 points
- microsoft/vscode-python“Fix environment-dependent git pre-commit hooks”GitHub · Feb 18, 2020 · 338 reactions
The biggest 5 of 96 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 96
Talked about on Bluesky, Hacker News and GitHub (96 times).
On Bluesky · 48
- Jan 18, 2026Decided to quit being hard headed and just do what everyone else is doing/has done. — @advanced-eschatonics.com12 likes and reposts · 1 reply
- Jul 12, 2026📦 microsoft / vscode ⭐ 187,428 (+52) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social3 likes and reposts
- Jul 2, 2026📦 microsoft / vscode ⭐ 186,897 (+73) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social3 likes and reposts
- Nov 2, 2025📦 microsoft / vscode ⭐ 178,121 (+34) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social3 likes and reposts
- Jan 15, 2025📦 microsoft / vscode ⭐ 166,156 (+43) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social3 likes and reposts
43 more on Bluesky
- Jul 8, 2023📦 microsoft / vscode ⭐ 147,967 (+41) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social3 likes and reposts
- Apr 5, 2026📦 microsoft / vscode ⭐ 183,440 (+45) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Jul 18, 2025Sorry to hear you are hitting this problem! We would love to help you out over at github.com/microsoft/vs... and if you assign your issue… — @eleanor-py.bsky.social2 likes and reposts
- May 21, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 171,731 (+283) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social2 likes and reposts
- May 20, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 171,513 (+253) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Mar 30, 2025📦 microsoft / vscode ⭐ 169,312 (+41) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Mar 7, 2025📦 microsoft / vscode ⭐ 168,219 (+82) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social2 likes and reposts
- Feb 12, 2025📦 microsoft / vscode ⭐ 167,217 (+56) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Feb 8, 2025📦 microsoft / vscode ⭐ 167,047 (+49) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Jan 24, 2025📦 microsoft / vscode ⭐ 166,533 (+32) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Jan 15, 2025📦 microsoft / vscode ⭐ 166,156 (+43) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social2 likes and reposts
- Sep 1, 2024📦 microsoft / vscode ⭐ 162,015 (+32) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Jun 10, 2024📦 microsoft / vscode ⭐ 159,629 (+49) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social2 likes and reposts
- Aug 26, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / vscode ⭐ 150,079 (+137) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social2 likes and reposts · 1 reply
- Nov 7, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 194,788 (+295) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Nov 6, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 194,788 (+295) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social1 likes and repost · 1 reply
- Sep 26, 2026📦 microsoft / vscode ⭐ 192,963 (+78) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Sep 26, 2026📦 microsoft / vscode ⭐ 192,963 (+78) 🗒 TypeScript Visual Studio Code — @github-trending.bsky.social1 likes and repost
- Jun 25, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / vscode ⭐ 186,883 (+192) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jun 4, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / vscode ⭐ 185,791 (+129) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- May 20, 2026📦 microsoft / vscode ⭐ 185,087 (+57) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Apr 16, 2026📦 microsoft / vscode ⭐ 183,924 (+72) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Mar 5, 2026📦 microsoft / vscode ⭐ 182,312 (+76) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Dec 28, 2025📦 microsoft / vscode ⭐ 180,078 (+53) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jul 2, 2025📦 microsoft / vscode ⭐ 174,099 (+53) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- May 24, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 172,520 (+306) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- May 8, 2025📦 microsoft / vscode ⭐ 170,885 (+85) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Apr 11, 2025📦 microsoft / vscode ⭐ 169,887 (+76) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Apr 7, 2025📦 microsoft / vscode ⭐ 169,634 (+51) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Mar 6, 2025📦 microsoft / vscode ⭐ 168,138 (+89) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Feb 16, 2025📦 microsoft / vscode ⭐ 167,406 (+60) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jan 2, 2025lol yeah vscode is kinda wild tbh github.com/microsoft/vscode is the open source project but the versions you get from… — @benharri.org1 likes and repost · 2 replies
- Nov 1, 2024📦 microsoft / vscode ⭐ 163,956 (+52) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jun 18, 2024📦 microsoft / vscode ⭐ 159,805 (+32) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jun 6, 2024📦 microsoft / vscode ⭐ 159,414 (+58) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Apr 11, 2024📦 microsoft / vscode ⭐ 157,765 (+42) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jan 29, 2024📦 microsoft / vscode ⭐ 155,349 (+36) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Jan 19, 2024📦 microsoft / vscode ⭐ 155,009 (+57) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Dec 24, 2023📦 microsoft / vscode ⭐ 154,283 (+39) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social1 likes and repost
- Mar 17, 2025Something I just realized I want: wikilinks but for any website; kinda like DDG bangs, but for linking to things more easily. Generally… — @blakes.dev0 likes and reposts · 1 reply
- Feb 16, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / vscode ⭐ 156,140 (+203) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Sep 4, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / vscode ⭐ 150,693 (+178) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Aug 26, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / vscode ⭐ 150,078 (+137) 🗒 TypeScript Visual Studio Code — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On Hacker News · 39
- May 2, 2026VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage1.5k points · 850 comments
- Mar 23, 2017VS Code uses 13% CPU when idle due to blinking cursor renderingsays it tested it899 points · 760 comments
- Nov 1, 2017VS Code Roadmap 2018360 points · 230 comments
- Dec 19, 2019Santa hat removed from VS Code after complaint243 points · 157 comments
- Apr 18, 2017Show HN: Visual Studio Code for ARM, submitted to core236 points · 83 comments
34 more on Hacker News
- Feb 8, 2026Billing can be bypassed using a combo of subagents with an agent definition213 points · 122 comments
- Oct 27, 2023Microsoft: Require user consent before sending any telemetry128 points · 122 comments
- May 29, 2020Insider Build of VSCode for Windows/ARM64106 points · 79 comments
- May 6, 2026Update on "Co-authored-by: Copilot" in commit messages102 points · 66 comments
- Dec 20, 2019Visual Studio Code repository is open again87 points · 163 comments
- Jun 19, 2018Want free VS Code? Build it from source84 points · 65 comments
- Oct 21, 2020Issue Grooming81 points · 68 comments
- Sep 25, 2026Bug: Border radius has infected VSCode editor80 points · 53 comments
- Mar 19, 2022Visual Studio Code is randomly erasing included header files with latest update75 points · 44 comments
- Sep 3, 2023VSCode Removes Twitter Integration68 points · 31 comments
- Oct 15, 2017New VS Code icon is ugly66 points · 48 comments
- Feb 4, 2023Microsoft mangles VS Code protected properties to prevent UI customization65 points · 28 comments
- Apr 29, 2020VS Code was lost on shutdown with pending update (2018)64 points · 90 comments
- Oct 27, 2025Severe performance penalty found in VSCode rendering loop63 points · 45 comments
- Nov 24, 2020VSCode memory leak issue marked “out-of-scope”62 points · 71 comments
- Feb 16, 2021Visual Studio Code team considers Vim mode depending on upvotes56 points · 27 comments
- Nov 3, 2023VS Code Introduces Floating Windows Support - The Most Requested Feature Ever46 points · 10 comments
- Jan 29, 2019VS Code Roadmap 201933 points · 3 comments
- Apr 21, 2022VS Code Development Process27 points · 3 comments
- Feb 2, 2024VSCode stopped supporting an old glibc version and near EOL users are in trouble23 points · 8 comments
- Jul 11, 2024VSCode won't start on several Mac OS versions, broken over a week16 points · 3 comments
- Nov 15, 2025Markdown files are not openable because of GitHub Copilot11 points · 1 comment
- Mar 17, 2022VSCode creates many empty file with invalid code automatically8 points · 1 comment
- Dec 19, 2019VS Code Issue Tracker Meltdown8 points · 4 comments
- Aug 31, 2023VSCode, have you collaborated with China?7 points
- Mar 15, 2023VS Code Monitors Full Command Line, CPU, Memory Usage of All Processes7 points · 1 comment
- Nov 20, 2024Thing Deleted 3 Months of Work6 points · 4 comments
- Nov 3, 2024VSCode high CPU usage issue affecting macOS6 points
- Oct 9, 2026VSCode silently switches to Microsoft models, ignoring BYO agent configuration5 points · 1 comment
- May 28, 2026VSCode fires up screen recording5 points
- Oct 5, 2025Microsoft Accidentally removes extensions from VSCode Marketplace5 points · 1 comment
- Nov 2, 2023After 7 years, VS Code finally implements preview support for floating windows5 points · 2 comments
- Feb 27, 2020THIS THING DELETED 3 MONTHS OF WORK!!!!5 points · 5 comments
- Dec 20, 2019VS Code is getting flak for removing Santa hat emoji5 points · 7 comments
On GitHub · 9
- Nov 2, 2022Convert the codebase to modules — microsoft/TypeScript1.3k reactions · 56 comments
- Feb 18, 2020Fix environment-dependent git pre-commit hooks — microsoft/vscode-python338 reactions · 57 comments
- Dec 12, 2025Handle writes to non-blocking pty instead of wrapping via Node's tty api — microsoft/node-pty256 reactions · 5 comments
- Oct 31, 2016Add Windows support and first-class Linux support — vercel/hyper160 reactions · 98 comments
- Sep 11, 2024Proposed expandable hover API — microsoft/TypeScript99 reactions · 15 comments
4 more on GitHub
- Dec 22, 2020LSP 3.16.0 — neoclide/coc.nvim64 reactions · 52 comments
- Mar 8, 2021Import statement completions — microsoft/TypeScript47 reactions · 9 comments
- Aug 13, 2017Feature/simple fullscreen mode — electron/electron43 reactions · 8 comments
- May 30, 2018Add support for grid layout — VSCodeVim/Vim37 reactions · 18 comments
In this repository96 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .eslint-plugin-local/AGENTS.mdAGENTS.md
- extensions/copilot/assets/prompts/skills/agent-customization/references/agents.mdAGENTS.md
- extensions/copilot/src/extension/chatSessions/copilotcli/AGENTS.mdAGENTS.md
- extensions/copilot/src/platform/authentication/common/AGENTS.mdAGENTS.md
- src/vs/platform/agentHost/AGENTS.mdAGENTS.md
- src/vs/platform/agentHost/common/state/AGENTS.mdAGENTS.md
- src/vs/platform/agentHost/node/copilot/prompts/AGENTS.mdAGENTS.md
- src/vs/platform/agentHost/test/node/AGENTS.mdAGENTS.md
- src/vs/workbench/contrib/imageCarousel/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- launchSkill
- github-copilot-upgraderSkill
- launchSkill
- agent-customizationSkill
- chronicleSkill
- create-agentSkill
- create-canvasSkill
- create-hookSkill
- create-instructionsSkill
- create-promptSkill
- create-skillSkill
- initSkill
- migrate-customizationsSkill
- record-videoSkill
- troubleshootSkill
- accessibilitySkill
- agent-host-chat-contributionsSkill
- agent-host-e2e-testsSkill
- agent-host-logsSkill
- author-contributionsSkill
- auto-perf-optimizeSkill
- azure-pipelinesSkill
- build-champ-triageSkill
- chat-customizations-editorSkill
- chat-perfSkill
- chat-pet-sprite-creationSkill
- ci-artifact-testingSkill
- codenotifySkill
- code-oss-logsSkill
- code-reviewSkill
- component-fixturesSkill
- componentSkill
- context-menusSkill
- cpu-profile-analysisSkill
- customizations-in-the-agent-hostSkill
- design-philosophySkill
- doc-commentsSkill
- endgame-statusSkill
- experimentsSkill
- feature-tryoutsSkill
- feedback-learningSkill
- fix-ci-failuresSkill
- fixissuenoSkill
- flaky-smoke-testsSkill
- heap-snapshot-analysisSkill
- hoverSkill
- integrated-browserSkill
- integration-testsSkill
- issue-groupingSkill
- The first 60 shown.
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
38 rules. About 0 are common, 10 are distinctive, and 28 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
vite.config.ts: Test configuration for Vitest unit tests - Very specific: line 49
script/simulate.sh: Test runner for scenario-based testing - Very specific: line 91
testing/: Test generation and execution features - Distinctive: line 182
Indentation: Use tabs, not spaces
- Distinctive: line 186
Use descriptive, whole words in names
- Very specific: line 190
Functions: Use arrow functions => over anonymous function expressions
- Distinctive: line 191
Conditionals: Always use curly braces, opening brace on same line
- Distinctive: line 192
Comments: Use JSDoc style for functions, interfaces, enums, and classes
- Very specific: line 206
Do not import directly from the repository's root src/vs/ tree.
- Very specific: line 207
Use the corresponding implementation under extensions/copilot/src/ or the vendored compatibility code under extensions/copilot/src/util/vs/ …
- Very specific: line 224
Use arrow functions => over anonymous function expressions
- Distinctive: line 225
Only surround arrow function parameters when necessary:
- Distinctive: line 235
Always surround loop and conditional bodies with curly braces
- Very specific: line 252
Do not export types or functions unless you need to share it across multiple components
- Very specific: line 253
Do not introduce new types or values to the global namespace
- Very specific: line 254
Use proper types. Do not use any unless absolutely necessary.
- Very specific: line 255
Use readonly whenever possible.
- Distinctive: line 256
Avoid casts in TypeScript unless absolutely necessary.
- Very specific: line 257
Do not use any or unknown as the type for variables, parameters, or return values unless absolutely necessary.
- Very specific: line 291
Adding new chat features: Start in src/extension/conversation/
- Very specific: line 292
Chat participants and agents: Look in src/extension/conversation/ for participant implementations
- Very specific: line 294
Inline chat improvements: Look in src/extension/inlineChat/ and src/extension/inlineEdits/
- Very specific: line 297
Context resolution changes: Check src/extension/context/ and src/extension/typescriptContext/
- Very specific: line 298
Prompt engineering: Update src/extension/prompts/ and src/extension/prompt/
- Very specific: line 302
Search functionality: Update src/extension/search/ for general search
- Very specific: line 305
Workspace tracking: Update src/extension/workspaceRecorder/ for interaction recording
- Very specific: line 309
Settings and config: Update src/extension/configuration/ and src/extension/settingsSchema/
- Very specific: line 313
AI endpoints: Update src/extension/endpoint/ for model selection and routing
- Very specific: line 316
MCP integration: Update src/extension/mcp/ for Model Context Protocol features
- Very specific: line 319
VS Code commands: Update src/extension/commands/ for command implementations
- Very specific: line 322
Cross-tab features: Update src/extension/xtab/ for multi-tab coordination
- Very specific: line 326
Extension tests: Update src/extension/test/ for extension-specific test utilities
- Distinctive: line 330
VS Code integration: Update contribution files and extension activation code
- Distinctive: line 336
Use services and dependency injection over VS Code extension APIs when possible:
- Very specific: line 337
Use IFileSystemService instead of Node's fs or vscode.workspace.fs
- Very specific: line 338
Use ILogService instead of console.log
- Very specific: line 339
Look for existing I*Service interfaces before reaching for raw APIs
- Distinctive: line 341
Always use the URI type instead of using string file paths.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Chat Extension - Copilot Instructions
Project Overview
This is the GitHub Copilot Chat extension for Visual Studio Code - a VS Code extension that provides conversational AI assistance, a coding agent with many tools, inline editing capabilities, and advanced AI-powered features for VS Code.
Key Features
- Chat Interface: Conversational AI assistance with chat participants, variables, and slash commands
- Inline Chat: AI-powered editing directly in the editor with
Ctrl+I - Agent Mode: Multi-step autonomous coding tasks
- Edit Mode: Natural language to code
- Inline Suggestions: Next edit suggestions and inline completions
- Language Model Integration: Support for multiple AI models (GPT-4, Claude, Gemini, etc.)
- Context-Aware: Workspace understanding, semantic search, and code analysis
Tech Stack
- TypeScript: Primary language (follows VS Code coding standards)
- TSX: Prompts are built using the @vscode/prompt-tsx library
- Node.js: Runtime for extension host and language server features
- WebAssembly: For performance-critical parsing and tokenization
- VS Code Extension API: Extensive use of proposed APIs for chat, language models, and editing
- ESBuild: Bundling and compilation
- Vitest: Unit testing framework
- Python: For notebooks integration and ML evaluation scripts
Validating changes
Choose validation based on the scope and risk of the change. Prefer existing diagnostics and the smallest targeted tests that cover the changed behavior. Do not start start-watch-tasks, run a full build, or make type checking a prerequisite for targeted tests solely as a completion ritual.
If start-watch-tasks is already running, use its diagnostics. Start it or run another targeted type check or build when existing diagnostics are unavailable, the change is broad or cross-cutting, it affects build or type configuration, or another validation step reports a compilation problem. start-watch-tasks runs the extension, extension-web, simulation-workbench, and esbuild watchers.
Project Architecture
Top-Level Directory Structure
Core Source Code (src/)
src/extension/: Main extension implementation, organized by featuresrc/platform/: Shared platform services and utilitiessrc/util/: Common utilities, VS Code API abstractions, and service infrastructure
Build & Configuration
.esbuild.mts: Build configuration for bundling extension, web worker, and simulation workbenchtsconfig.json: TypeScript configuration extending base config with React JSX settingsvite.config.ts: Test configuration for Vitest unit testspackage.json: Extension manifest with VS Code contributions, dependencies, and scripts
Testing & Simulation
test/: Comprehensive test suite including unit, integration, and simulation testsscript/simulate.sh: Test runner for scenario-based testingnotebooks/: Jupyter notebooks for performance analysis and ML experiments
Assets & Documentation
assets/: Icons, fonts, and visual resourcesCONTRIBUTING.md: Architecture documentation and development guide
Key Source Directories
src/extension/ - Feature Implementation
Core Chat & Conversation Features:
conversation/: Chat participants, agents, and conversation flow orchestrationinlineChat/: Inline editing features (Ctrl+I) and hints systeminlineEdits/: Advanced inline editing capabilities with streaming edits
Context & Intelligence:
context/: Context resolution for code understanding and workspace analysiscontextKeys/: VS Code context key management for UI stateintents/: Chat participant/slash command implementationsprompts/: Prompt engineering and template systemprompt/: Common prompt utilitiestypescriptContext/: TypeScript-specific context and analysis
Search & Discovery:
search/: General search functionality within the extensionworkspaceChunkSearch/: Chunked workspace search for large codebasesworkspaceSemanticSearch/: Semantic search across workspace contentworkspaceRecorder/: Recording and tracking workspace interactions
Authentication & Configuration:
authentication/: GitHub authentication and token managementconfiguration/: Settings and configuration managementbyok/: Bring Your Own Key (BYOK) functionality for custom API keys
AI Integration & Endpoints:
endpoint/: AI service endpoints and model selectiontools/: Language model tools and integrationsapi/: Core API abstractions and interfacesmcp/: Model Context Protocol integration
Development & Testing:
testing/: Test generation and execution featurestest/: Extension-specific test utilities and helpers
User Interface & Experience:
commands/: Service for working with VS Code commandscodeBlocks/: Streaming code block processinglinkify/: URL and reference linkificationgetting-started/: Onboarding and setup experienceonboardDebug/: Debug onboarding flowssurvey/: User feedback and survey collection
Specialized Features:
notebook/: Notebook integration and supportreview/: Code review and PR integration featuresrenameSuggestions/: AI-powered rename suggestionsignore/: File and pattern ignore functionalityxtab/: Cross-tab communication and state management
Infrastructure & Utilities:
extension/: Core extension initialization and lifecyclelog/: Logging infrastructure and utilitiestelemetry/: Analytics and usage tracking
VS Code API Type Definitions:
- Multiple
vscode.proposed.*.d.tsfiles for proposed VS Code APIs including chat, language models, embeddings, and various editor integrations
src/platform/ - Platform Services
chat/: Core chat services and conversation optionsopenai/: OpenAI API protocol integration and request handlingembedding/: Vector embeddings for semantic searchparser/: Code parsing and AST analysissearch/: Workspace search and indexingtelemetry/: Analytics and usage trackingworkspace/: Workspace understanding and file managementnotebook/: Notebook integrationgit/: Git integration and repository analysis
src/util/ - Infrastructure
common/: Shared utilities, service infrastructure, and abstractionsvs/: Utilities borrowed from the microsoft/vscode repo (readonly)
Extension Activation Flow
- Base Activation (
src/extension/extension/vscode/extension.ts):- Checks VS Code version compatibility
- Creates service instantiation infrastructure
- Initializes contribution system
- Service Registration:
- Platform services (search, parsing, telemetry, etc.)
- Extension-specific services (chat, authentication, etc.)
- VS Code integrations (commands, providers, etc.)
- Contribution Loading:
- Chat participants
- Language model providers
- Command registrations
- UI contributions (views, menus, etc.)
Chat System Architecture
Chat Participants
- Default Agent: Main conversational AI assistant
- Setup Agent: Handles initial Copilot setup and onboarding
- Workspace Agent: Specialized for workspace-wide operations
- Agent Mode: Autonomous multi-step task execution
Request Processing
- Input Parsing: Parse user input for participants, variables, slash commands
- Context Resolution: Gather relevant code context, diagnostics, workspace info
- Prompt Construction: Build prompts with context and intent detection
- Model Interaction: Send requests to appropriate language models
- Response Processing: Parse and interpret AI responses
- Action Execution: Apply code edits, show results, handle follow-ups
Language Model Integration
- Support for multiple providers (OpenAI, Anthropic, etc.)
- Model selection and switching capabilities
- Quota management and fallback handling
- Custom instruction integration
Inline Chat System
- Hint System: Smart detection of natural language input for inline suggestions
- Intent Detection: Automatic detection of user intent (explain, fix, refactor, etc.)
- Context Collection: Gather relevant code context around cursor/selection
- Streaming Edits: Real-time application of AI-suggested changes
- Version 2: New implementation with improved UX and hide-on-request functionality
Coding Standards
TypeScript/JavaScript Guidelines
- Indentation: Use tabs, not spaces
- Naming Conventions:
PascalCasefor types and enum valuescamelCasefor functions, methods, properties, and local variables- Use descriptive, whole words in names
- Strings:
- "double quotes" for user-visible strings that need localization
- 'single quotes' for internal strings
- Functions: Use arrow functions
=>over anonymous function expressions - Conditionals: Always use curly braces, opening brace on same line
- Comments: Use JSDoc style for functions, interfaces, enums, and classes
React/JSX Conventions
- Custom JSX factory:
vscpp(instead of React.createElement) - Fragment factory:
vscppf - Components follow VS Code theming and styling patterns
Architecture Patterns
- Service-oriented: Heavy use of dependency injection via
IInstantiationService - Contribution-based: Modular system where features register themselves
- Event-driven: Extensive use of VS Code's event system and disposables
- Layered: Clear separation between platform services and extension features
Dependency Boundaries
- Do not import directly from the repository's root
src/vs/tree. The extension is compiled and bundled from its ownsrc/tree, and root VS Code internals are not an extension dependency. - Use the corresponding implementation under
extensions/copilot/src/or the vendored compatibility code underextensions/copilot/src/util/vs/when it is already available. Keep shared behavior behind the extension's own platform abstractions.
Testing Standards
- Unit Tests: Vitest for isolated component testing
- Integration Tests: VS Code extension host tests for API integration
- Simulation Tests: End-to-end scenario testing with
.stest.tsfiles - Fixtures: Comprehensive test fixtures for various scenarios
File Organization
- Logical Grouping: Features grouped by functionality, not technical layer
- Platform Separation: Different implementations for web vs. Node.js environments
- Test Proximity: Tests close to implementation (
/test/subdirectories) - Clear Interfaces: Strong interface definitions for service boundaries
Key Development Guidelines
Arrow Functions and Parameters
- Use arrow functions
=>over anonymous function expressions - Only surround arrow function parameters when necessary:
x => x + x // ✓ Correct
(x, y) => x + y // ✓ Correct
<T>(x: T, y: T) => x === y // ✓ Correct
(x) => x + x // ✗ WrongCode Structure
- Always surround loop and conditional bodies with curly braces
- Open curly braces always go on the same line as whatever necessitates them
- An open curly brace MUST be followed by a newline, with the body indented on the next line
- Parenthesized constructs should have no surrounding whitespace
- Single space follows commas, colons, and semicolons
for (let i = 0, n = str.length; i < 10; i++) {
if (x < 10) {
foo();
}
}
function f(x: number, y: string): void { }Type Management
- Do not export
typesorfunctionsunless you need to share it across multiple components - Do not introduce new
typesorvaluesto the global namespace - Use proper types. Do not use
anyunless absolutely necessary. - Use
readonlywhenever possible. - Avoid casts in TypeScript unless absolutely necessary. If you get type errors after your changes, look up the types of the variables involved and set up a proper system of types and interfaces instead of adding type casts.
- Do not use
anyorunknownas the type for variables, parameters, or return values unless absolutely necessary. If they need type annotations, they should have proper types or interfaces defined.
Key APIs and Integrations
VS Code Proposed APIs (Enabled)
The extension uses numerous proposed VS Code APIs for advanced functionality:
chatParticipantPrivate: Private chat participant featureslanguageModelSystem: System messages for LM APIchatProvider: Custom chat provider implementationmappedEditsProvider: Advanced editing capabilitiesinlineCompletionsAdditions: Enhanced inline suggestionsaiTextSearchProvider: AI-powered search capabilities
External Integrations
- GitHub: Authentication and API access
- Azure: Cloud services and experimentation
- OpenAI: Language model API
- Telemetry: Usage analytics and performance monitoring
Development Workflow
Setup and Build
pnpm install: Install dependenciespnpm run compile: Development buildpnpm run watch:*: Various watch modes for development
Testing
pnpm run test:unit: Unit testspnpm run test:extension: VS Code integration testspnpm run simulate: Scenario-based simulation tests
Key Entry Points for Edits
Chat & Conversation Features:
- Adding new chat features: Start in
src/extension/conversation/ - Chat participants and agents: Look in
src/extension/conversation/for participant implementations - Conversation storage: Modify
src/extension/conversationStore/for persistence features - Inline chat improvements: Look in
src/extension/inlineChat/andsrc/extension/inlineEdits/
Context & Intelligence:
- Context resolution changes: Check
src/extension/context/andsrc/extension/typescriptContext/ - Prompt engineering: Update
src/extension/prompts/andsrc/extension/prompt/ - Intent detection: Modify
src/extension/intents/for user intent classification
Search & Discovery:
- Search functionality: Update
src/extension/search/for general search - Workspace search: Modify
src/extension/workspaceChunkSearch/for large codebase search - Semantic search: Edit
src/extension/workspaceSemanticSearch/for AI-powered search - Workspace tracking: Update
src/extension/workspaceRecorder/for interaction recording
Authentication & Configuration:
- Authentication flows: Modify
src/extension/authentication/for GitHub integration - Settings and config: Update
src/extension/configuration/andsrc/extension/settingsSchema/ - BYOK features: Edit
src/extension/byok/for custom API key functionality
AI Integration:
- AI endpoints: Update
src/extension/endpoint/for model selection and routing - Language model tools: Modify
src/extension/tools/for AI tool integrations - API abstractions: Edit
src/extension/api/for core interfaces - MCP integration: Update
src/extension/mcp/for Model Context Protocol features
User Interface:
- VS Code commands: Update
src/extension/commands/for command implementations - Code block rendering: Modify
src/extension/codeBlocks/for code display - Onboarding flows: Edit
src/extension/getting-started/andsrc/extension/onboardDebug/ - Cross-tab features: Update
src/extension/xtab/for multi-tab coordination
Testing & Development:
- Test generation: Modify
src/extension/testing/for AI-powered test creation - Extension tests: Update
src/extension/test/for extension-specific test utilities
Platform Services:
- Core platform services: Extend
src/platform/services for cross-cutting functionality - VS Code integration: Update contribution files and extension activation code
- Configuration: Modify
package.jsoncontributions for VS Code integration
This extension is a complex, multi-layered system that provides comprehensive AI assistance within VS Code. Understanding the service architecture, contribution system, and separation between platform and extension layers is crucial for making effective changes.
Best Practices
- Use services and dependency injection over VS Code extension APIs when possible:
- Use
IFileSystemServiceinstead of Node'sfsorvscode.workspace.fs - Use
ILogServiceinstead ofconsole.log - Look for existing
I*Serviceinterfaces before reaching for raw APIs - Why: Enables unit testing without VS Code host, supports simulation tests, provides cross-platform abstractions (Node vs web), and adds features like caching and size limits
- Use
- Always use the URI type instead of using string file paths. There are many helpers available for working with URIs.
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.

