Answer: How you supply relevant context depends on the surface you are using: in IDE code completions, open relevant files and close irrelevant ones; in Copilot in your IDE or on the GitHub website, highlight the code you want referenced and use keywords to attach context (for example, type @ to attach files, issues, pull requests, or repositories). Status: Confirmed Entry: tool/github-copilot/memory-and-context/provide-relevant-context Revision: 3 Digest: sha256:a3f6ee95fb4c28e4 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:21:17Z Last changed: 2026-11-18T12:51:29Z (Custom instructions file: — → .github/copilot-instructions.md) Last verified: 2026-11-20T12:57:45Z Next check: 2026-11-21T12:57:45Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of IDE code completions | open any relevant files and close irrelevant ones | [1] | 2026-11-20 IDE or GitHub website | highlight the code that you want Copilot to reference, and use keywords to attach context | [1] | 2026-11-20 Attach context keyword | @ | [1] | 2026-11-20 CLI file attach | @path | [1] | 2026-11-20 CLI issue/PR reference | #number | [1] | 2026-11-20 Custom instructions file | .github/copilot-instructions.md | [1] | 2026-11-20 Cloud agent scoping | scope the task by selecting the repository and base branch | [1] | 2026-11-20 Sources: [1] GitHub. "Prompt engineering for GitHub Copilot - GitHub Docs". https://docs.github.com/en/copilot/concepts/prompting-and-context/prompt-engineering Role: primary. Accessed: 2026-11-20T12:57:45Z Quote: "Code completions in your IDE: open any relevant files and close irrelevant ones." (Supports: IDE code completions) Quote: "highlight the code that you want Copilot to reference, and use keywords to attach context" (Supports: IDE or GitHub website) Quote: "type @ in your prompt to attach items such as files, issues, pull requests, or repositories" (Supports: Attach context keyword) Quote: "attach a repository file with @path" (Supports: CLI file attach) Quote: "reference a GitHub issue or pull request with #number" (Supports: CLI issue/PR reference) Quote: "add custom instructions such as a .github/copilot-instructions.md file" (Supports: Custom instructions file) Quote: "Copilot cloud agent: scope the task by selecting the repository and base branch" (Supports: Cloud agent scoping) Snapshot SHA-256: 0b15bd3a3ed50da73cabf859b0765c3217591213d806cdad46eb1562a7eaa28c (captured 2026-11-18T12:51:29Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T12:51:29Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:57:45Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:57:45Z Last attempt: 2026-11-20T12:57:45Z Notes and limitations: Extracted automatically from a single official source (section "Provide relevant context"). Related: https://latestn.com/tool/github-copilot/memory-and-context/repository-custom-instructions How do I set up repository custom instructions for GitHub Copilot? https://latestn.com/tool/github-copilot/memory-and-context/repository-custom-instructions-2 How do I add custom instructions to a repository for GitHub Copilot? https://latestn.com/tool/github-copilot/memory-and-context/repository-indexing How do I index repositories for GitHub Copilot? https://latestn.com/tool/github-copilot/memory-and-context/organize-context-with-space How do I organize project context with a space in GitHub Copilot? https://latestn.com/tool/github-copilot/memory-and-context/path-specific-custom-instructions-file How do I create a custom instructions file in GitHub Copilot that applies only to HTML files? https://latestn.com/tool/github-copilot/memory-and-context/personal-custom-instructions How do I set up personal custom instructions in GitHub Copilot? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:51:29Z | changed | Custom instructions file: — → .github/copilot-instructions.md | [1] 2026-11-18T12:51:29Z | changed | CLI issue/PR reference: — → #number | [1] 2026-11-18T12:51:29Z | changed | CLI file attach: — → @path | [1] 2026-11-18T12:51:29Z | changed | Reusable repository context: .github/copilot-instructions.md → — | [1] 2026-11-18T12:51:29Z | changed | CLI issue or pull request: #number → — | [1] 2026-11-18T12:51:29Z | changed | CLI repository file: @path → — | [1] 2026-11-16T12:40:59Z | changed | Reusable repository context: — → .github/copilot-instructions.md | [1] 2026-11-16T12:40:59Z | changed | CLI issue or pull request: — → #number | [1] 2026-11-16T12:40:59Z | changed | CLI repository file: — → @path | [1] 2026-11-16T12:40:59Z | changed | IDE or GitHub website: — → highlight the code that you want Copilot to reference, and use keywords to attach context | [1] 2026-11-16T12:40:59Z | changed | Cloud agent scoping: selecting the repository and base branch → scope the task by selecting the repository and base branch | [1] 2026-11-16T12:40:59Z | changed | Custom instructions file: .github/copilot-instructions.md → — | [1] 2026-11-16T12:40:59Z | changed | CLI issue/PR reference: #number → — | [1] 2026-11-16T12:40:59Z | changed | CLI file attach: @path → — | [1] 2026-11-13T03:21:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/memory-and-context/provide-relevant-context/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/memory-and-context/provide-relevant-context POST: https://latestn.com/dispute/tool/github-copilot/memory-and-context/provide-relevant-context with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/memory-and-context/provide-relevant-context?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I give GitHub Copilot relevant context in my prompts? Revision 3, last verified 2026-11-20T12:57:45Z. https://latestn.com/tool/github-copilot/memory-and-context/provide-relevant-context (accessed 2026-11-21T09:53:35Z). @misc{LatestN_tool_github_copilot_memory_and_context_provide_relevant_context_r3, title = {How do I give GitHub Copilot relevant context in my prompts?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/memory-and-context/provide-relevant-context}}, note = {Revision 3; digest sha256:a3f6ee95fb4c28e4; last verified 2026-11-20T12:57:45Z; accessed 2026-11-21T09:53:35Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/memory-and-context/provide-relevant-context