Chat Participants: @workspace, @terminal, @vscode
Direct Copilot's attention to a specific context scope.
What You Will Learn
- Use @workspace to scope Chat to the whole repo.
- Use @terminal to feed terminal output as context.
- Use @vscode for editor-level actions.
- Combine participants with slash commands.
- Recognize when a participant adds value vs overhead.
Why This Matters
Without participants, Chat only sees your current selection. With @workspace, it sees the whole repo. With @terminal, it sees your last command's output. The right participant transforms a generic answer into a grounded one.
Concept Explained
Chat participants are scoped context injectors. They tell Copilot what additional context to gather before responding. @workspace pulls repo-wide context; @terminal pulls recent terminal output; @vscode exposes editor commands.
How It Works
Type @ in the chat box; a participant picker appears. The selected participant runs its context-gathering function (e.g. @workspace indexes your repo), assembles context, and sends it with your prompt to the model. Latency increases for broader scopes.
Step-by-Step Tutorial
1. Use @workspace
Type @workspace followed by your question. Copilot searches the repo for relevant files and includes them in context.2. Use @terminal
After running a failing command, type @terminal followed by 'why did this fail?'. Copilot sees the terminal output.3. Use @vscode
Type @vscode followed by an action like 'format this file'. Copilot triggers the VS Code command.4. Combine
Type @workspace /tests — runs /tests with full repo context.5. Recognize overhead
@workspace is slower than no participant. Use it only for cross-file questions.Real-World Example
A developer saw a CI failure but couldn't reproduce locally. They opened Copilot Chat, typed @terminal 'why is CI failing?' with the failed CI log in their terminal scrollback. Copilot identified a missing environment variable, proposed a fix, and explained why the local environment differed from CI. Five-minute resolution instead of an hour of investigation.
Example Prompts / Commands / Code
@workspace How does the auth middleware connect to the user service? List the files and the data flow.
# After `npm run build` fails:
@terminal Why did the build fail? Suggest a fix.
@workspace /tests for the UserController — cover all public methods
Common Mistakes
- Using @workspace for single-file questions — adds latency without value.
- Forgetting @terminal exists — manually pasting error output instead.
- Assuming @vscode can run any command — it's scoped to safe editor actions.
- Mixing too many participants in one prompt — context gets noisy.
Best Practices
- Default to no participant; add when needed.
- Use @workspace for architecture, dependency, and cross-file questions.
- Use @terminal for any debugging session — it sees your last command's output.
- Combine participants with slash commands for structured output.
Troubleshooting
| Problem | How to Fix |
|---|---|
| @workspace is slow | Repo is large. Narrow scope by attaching specific files instead. |
| @terminal sees the wrong command | Run the relevant command last, or attach the terminal output explicitly. |
| @vscode command not found | The command must be a registered VS Code command. Check the command palette. |
Practical Exercise
Your Turn
Open a project you know. Run a failing command in the terminal (e.g. an intentional typo). Use @terminal to ask Copilot why it failed. Then use @workspace to ask how the failing module fits into the broader architecture.
Key Takeaways
- Participants scope Chat's context: @workspace, @terminal, @vscode.
- @workspace is for repo-wide questions; expect higher latency.
- @terminal is for debugging — feeds terminal output as context.
- Combine participants with slash commands for structured, grounded output.
- Default to no participant; add when the question demands it.
Frequently Asked Questions
Are there other participants?
Does @workspace index the whole repo every time?
Can I write my own participant?
Further Reading
Official References
Related lessons: BE-08, BE-09, IN-35
SEO Metadata
SEO title: Chat Participants: @workspace, @terminal, @vscode
Meta description: Direct Copilot's attention to a specific context scope.
Primary keyword: chat participants
Secondary keywords: chat participants: @workspace, @terminal, @vscode
Search intent: Informational
URL slug: /github-copilot-chat-participants-workspace-terminal
Categories: AI Tools, GitHub Copilot
Tags: GitHub Copilot, Beginner, Chat Participants, IMCSEIAN, Tutorial, IMCSEIAN
Featured image concept: IMCSEIAN lesson card for Chat Participants: @workspace, @terminal, @vscode
Comments
Comments
Post a Comment