How to use GitHub Copilot Spaces to debug issues faster
Source: GitHub Blog
How to debug issues with spaces
1. Start with an issue
A contributor opened an issue reporting an unsafe usage of check_call in your project. As a maintainer you might not know the best way to fix it immediately. Normally you’d search the repo, check past pull requests, and comb through security guidelines.
With GitHub Copilot Spaces, you can create a space, add the issue and the key files or docs, and let Copilot reason across everything at once.
2. Create a space for your project
Inside the space, add:
- Design patterns (e.g.,
/docs/security/check-patterns.md,/docs/design/architecture-overview.md) - Security guidelines
- Accessibility recommendations
- The entire repository (for broad coverage) or a curated set of the most relevant files for your specific use case
- The URL to the issue itself
3. Add Instructions for Copilot
Each space includes an Instructions panel where you tell Copilot how to work inside your project. Example:
You are an experienced engineer working on this codebase.
Always ground your answers in the linked docs and sources in this space.
Before writing code, produce a 3–5 step plan that includes:
- The goal
- The approach
- The execution steps
Cite the exact files that justify your recommendations.
After I approve a plan, use the Copilot coding agent to propose a PR.
These instructions keep Copilot consistent and prevent hallucinations.
4. Ask Copilot to debug the issue
With everything set up, ask Copilot: “Help me debug this issue.”
Copilot knows which issue you mean because it’s linked to the space. It parses all sources and returns a clear plan, e.g.:
Goal: Fix unsafe usage of runBinaryCheck to ensure input paths are validated.
Approach:
- Search the repo for usages of
runBinaryCheck. - Compare each usage to the safe pattern in the security docs.
- Identify the required refactor.
- Prepare a diff for each file with unsafe usage.
5. Generate the pull request
After approving the plan, tell Copilot: “Propose code changes using Copilot coding agent.”
The agent generates a pull request that includes:
- Before and after versions of the files
- An explanation of what changed
- References to the exact files that informed the fix
- The instructions that guided its choices
Every file shows which source informed the suggestion, allowing you to audit the reasoning before merging.
6. Iterate if needed
If something isn’t right, mention @copilot in the pull‑request comments to iterate, or go back to the space to generate a fresh one. Spaces are private by default, but you can share them with specific individuals, your team, or the whole organization (subject to admin permissions).
Use GitHub Copilot Spaces from your IDE
Spaces are now available in your IDE via the GitHub MCP Server. Install the MCP server and call your spaces directly from the editor, getting the same curated context and grounded answers without leaving your development environment.
Coming soon
- Public API
- Image support
- Additional file types such as
.doc,.docx, and PDFs
Three ways teams are using spaces right now
- Code generation and debugging – Use spaces with the Copilot coding agent to generate pull requests aligned with your patterns, security rules, and architecture.
- Planning features – Link issues, design docs, and repos to plan features and draft requirements. Ask Copilot for a technical plan and it generates a pull request.
- Knowledge sharing and onboarding – Spaces become living knowledge bases, helping new engineers onboard faster and reducing repetitive questions for existing team members.
Try it on your next issue
Challenge yourself:
- Create a GitHub Copilot Space.
- Add one issue and three to four key files.
- Add simple instructions.
- Ask Copilot to analyze the issue and propose a debugging plan.
- Approve the plan.
- Trigger the coding agent to generate a pull request.
You’ll see how much time you save when Copilot actually knows your project. Your AI assistant should never lack the right context—that’s what Spaces are for.