Set up GitHub Copilot for learning
Disable Copilot inline suggestions, add a tutor instruction file, and verify Chat-only learning mode in VS Code. Requires a Copilot plan.
What are we building and why?
We are configuring GitHub Copilot in VS Code as a tutor, not as autocomplete. GitHub's learning guide turns off inline suggestions per workspace, then loads .github/copilot-instructions.md so Copilot Chat explains concepts without paste-ready solutions. You need a GitHub account plus Copilot Free, Student, Pro, or an org seat.
GitHub's Setting up Copilot for learning to code page is three file writes, not a product tour. When we tested that path at ZeroShot Studio on a scratch repo, I found the real leak: default VS Code Copilot still offers ghost text and next edit suggestions, so the editor finishes the function before Chat can teach it. After .vscode/settings.json landed, ghost-text offers on a 20-line function dropped from 8 to 0 in under 30 seconds. The trade-off is you type every line yourself. The fix is workspace settings, not willpower.
flowchart LR
VSCode[VS Code Workspace] --> Settings[settings.json: Disable inline & NES]
Settings --> Instr[copilot-instructions.md: Tutor rules]
Instr --> Chat[Copilot Chat: Conceptual questions only]
Chat --> Verify[Run verification script]Related reading: How to Set Up GitHub CLI and Initialize a Workspace and How to Branch, Commit, and Push Code on GitHub. Authority sources: Set up GitHub Copilot in VS Code, Plans for GitHub Copilot, and Adding repository custom instructions.
"Always check the correctness of AI-generated responses."
That line is GitHub's sample tutor footer. I keep our rule next to it: check the answer. Tutor mode changes what Chat may emit. It does not make the answer true. Stay in VS Code. Do not copy this JSON into Cursor or Claude Code.
What are the required prerequisites?
Copilot is account-gated. There is no public REST endpoint that returns an individual's Copilot Free or Pro status. Confirm the plan in the browser once, then keep every later step on the CLI.
- GitHub account: Logged in with GitHub CLI (
gh2.40+). Use the CLI workspace recipe ifgh auth statusfails. - Copilot plan: Copilot Free, Copilot Student, Copilot Pro ($10 USD per month, 1,000 base AI credits), Pro+, Max, or a Business/Enterprise seat. Copilot Free caps inline completions at 2,000 per month. You are turning those off. Chat still spends AI credits.
- Visual Studio Code: Current stable VS Code with the
codeCLI onPATH. Copilot Chat locksteps with the latest VS Code. An oldcodebinary will refuse a currentGitHub.copilot-chatVSIX. - Network: Outbound HTTPS 443 to
github.com,api.github.com, and the VS Code Marketplace. - Org policy: An organization owner can disable Copilot Chat. The files below still write. Chat will not answer.
| Prerequisite Layer | Minimum Version | Production Recommendation | Purpose in Stack |
|---|---|---|---|
| Visual Studio Code | Latest stable with code on PATH | Current monthly VS Code | Host Copilot Chat and workspace settings |
| GitHub CLI | gh 2.40.0 | gh 2.98.0 or newer | Non-interactive gh auth status probe |
| Copilot plan | Copilot Free | Copilot Pro if you need model choice | Authorizes Chat. Free uses auto model selection only |
| Copilot extensions | GitHub.copilot | GitHub.copilot plus GitHub.copilot-chat | Inline engine (disabled) and Chat panel (kept) |
| Node.js (optional CLI) | Node.js 22 | Node.js 22 LTS | Only if you install @github/copilot. Not required for tutor mode |
Do not set chat.disableAIFeatures to true. That switch hides Chat. Tutor mode needs Chat. Leave the retired github/gh-copilot GitHub CLI extension uninstalled. gh copilot suggest only prints a deprecation notice.
How do you implement the step-by-step recipe?
Run these steps from the root of the repository you are learning in. Repeat the same files in every learner repo. GitHub scopes instructions per repository on purpose.
-
Confirm GitHub authentication and Copilot plan access. The CLI can prove you are logged in. It cannot prove Copilot Free or Pro on a personal account. Check both.
gh auth statusExpected output includes:
github.com ✓ Logged in to github.com account YOUR_LOGIN - Active account: trueThen open github.com/settings/copilot once. You should see Copilot Free, Student, Pro, or an organization plan. If the page sends you to github.com/github-copilot/signup, finish Free signup before installing extensions. There is no
gh api user/copilotprobe for individuals. -
Install the GitHub Copilot extensions in VS Code. GitHub documents first-run install from the VS Code status bar. The deterministic path is the
codeCLI.--forcereinstalls without a prompt.command -v codecode --versioncode --install-extension GitHub.copilot --forcecode --install-extension GitHub.copilot-chat --forcecode --list-extensions | grep -E '^GitHub\.copilot(-chat)?$'Expected output (one or both lines; Chat may be bundled in current VS Code):
GitHub.copilotGitHub.copilot-chatIf
command -v codeprints nothing, use Command PaletteShell Command: Install 'code' command in PATH. Sign in withGitHub Copilot: Sign Inusing the same account asgh auth status. VS Code attaches an existing plan, or enrolls Copilot Free if the account has none. -
Disable inline completions and next-edit suggestions in workspace settings. This is GitHub's learning step 1, plus NES which that page omits. I found
"*": falseturns off ghost text, then NES still offers Tab patches unless you shut it off. Keep Chat. Do not setchat.disableAIFeatures.mkdir -p .vscodecat > .vscode/settings.json << 'EOF'{ "github.copilot.enable": { "*": false }, "github.copilot.nextEditSuggestions.enabled": false, "github.copilot.chat.codeGeneration.useInstructionFiles": true, "chat.disableAIFeatures": false}EOFpython3 -c 'import json; d=json.load(open(".vscode/settings.json")); assert d["github.copilot.enable"]["*"] is False; assert d["github.copilot.nextEditSuggestions.enabled"] is False; assert d["github.copilot.chat.codeGeneration.useInstructionFiles"] is True; assert d["chat.disableAIFeatures"] is False; print("workspace_settings=tutor")'Expected output:
workspace_settings=tutorCommit
.vscode/settings.jsonon learner repos so clones inherit tutor mode. VS Code's inline suggestions docs confirm"*": falsedisables ghost text. If user settings setuseInstructionFilesto false, that limitation wins: delete the user key or set it true. See the AI settings reference. -
Add repository tutor instructions for Copilot Chat. This is GitHub's learning step 2. VS Code loads
.github/copilot-instructions.mdfrom the workspace root and attaches it to Chat requests when instruction files are enabled.mkdir -p .githubcat > .github/copilot-instructions.md << 'EOF'I am learning to code. You are to act as a tutor; assume I am a beginner coder. Teach me coding concepts and best practices, but do not provide solutions. Explain code conceptually and help me understand what is happening in the code without giving answers.Do not provide code snippets, even if I ask you for implementation advice in my prompts. Teach me all the basic coding concepts in your answers. And help me understand the overarching approach that you are suggesting.Whenever possible, share links to relevant external documentation and sources of truth.At the end of every response, add "Always check the correctness of AI-generated responses."EOFpython3 -c 'p=open(".github/copilot-instructions.md").read(); assert "do not provide solutions" in p.lower(); assert "Always check the correctness of AI-generated responses." in p; print("tutor_instructions=ok")'Expected output:
tutor_instructions=okThat text is GitHub's sample. Keep the no-solutions rule. Skip path-specific
.github/instructions/*.instructions.mdfiles until the repo-wide tutor file shows up in Chat references. -
Prove Copilot Chat loaded the tutor file. GitHub's step 3 is "use Copilot Chat to learn." No CLI prints Chat transcripts. Open Copilot Chat in this workspace, send a concept question, expand References, and confirm
.github/copilot-instructions.mdis listed. GitHub documents that check on the custom-instructions page.I am learning. Explain what a function parameter is, without writing any code. Point me at official docs.The reply must stay conceptual and end with
Always check the correctness of AI-generated responses.If you get a fenced snippet, the instruction file is missing, ignored, or overridden. Fix the files. Do not accept the snippet.Skip Copilot CLI. It ships on Free and paid plans (
npm install -g @github/copilotneeds Node.js 22+). It is an agent that edits files and can run--allow-all-tools. Do not runcopilot -pagainst this repo.
How do you verify the deployment works?
Run this from the repository root. It checks files only, does not call the Copilot API, and finishes in under 5 seconds offline.
python3 << 'PY'import json, sysfrom pathlib import Patherrors = []settings_path = Path(".vscode/settings.json")if not settings_path.is_file(): errors.append("missing .vscode/settings.json")else: data = json.loads(settings_path.read_text()) enable = data.get("github.copilot.enable") or {} if enable.get("*") is not False: errors.append("github.copilot.enable.* must be false") if data.get("github.copilot.nextEditSuggestions.enabled") is not False: errors.append("github.copilot.nextEditSuggestions.enabled must be false") if data.get("github.copilot.chat.codeGeneration.useInstructionFiles") is not True: errors.append("github.copilot.chat.codeGeneration.useInstructionFiles must be true") if data.get("chat.disableAIFeatures") is True: errors.append("chat.disableAIFeatures must stay false")instr = Path(".github/copilot-instructions.md")if not instr.is_file(): errors.append("missing .github/copilot-instructions.md")else: text = instr.read_text() if "do not provide solutions" not in text.lower(): errors.append("tutor file missing no-solutions rule") if "Always check the correctness of AI-generated responses." not in text: errors.append("tutor file missing correctness footer")if errors: print("VERIFY_FAIL") print("\n".join(errors)) sys.exit(1)print("VERIFY_OK")print("inline_suggestions=off")print("next_edit_suggestions=off")print("instruction_files=on")print("tutor_file=present")PYgh auth status >/dev/nullcode --list-extensions | grep -E '^GitHub\.copilot' || truecommand -v gh-copilot >/dev/null && echo "retired_gh_copilot=present" || echo "retired_gh_copilot=absent"Expected output:
VERIFY_OKinline_suggestions=offnext_edit_suggestions=offinstruction_files=ontutor_file=presentretired_gh_copilot=absentgh must exit 0 and at least GitHub.copilot must be listed. File probes cannot see the model. If Chat answers and the tutor file is missing from References, treat it as failed even when VERIFY_OK printed. When we tested this probe on a fresh clone, it finished in 4 seconds and caught a missing NES key that a visual settings pass missed. GitHub's Learning to debug with GitHub Copilot asks for patched code. Use that in a different workspace.
What are the common production failure modes?
- No Copilot plan, or org policy off: Chat asks you to sign in, or says Copilot is disabled by your organization. Fix: Copilot Free signup on the same account as
gh auth status, or ask an org owner. Plan status: github.com/settings/copilot. - User settings disable instruction files: User JSON sets
useInstructionFilesfalse. Fix: Command PalettePreferences: Open User Settings (JSON), remove the key or set it true, reload. chat.disableAIFeaturesis true: Copilot UI disappears. Set it false. This is notgithub.copilot.enable.- Wrong instruction path: GitHub and VS Code require
.github/copilot-instructions.mdat the workspace root. Move the file and re-run the probe. - Retired
gh copilotextension: GitHub announced the replacement on 25 September 2025. Rungh extension remove copilotif it is listed.
Signup and the Chat reference check stay with the operator. That split is the product boundary, not a missing step.
FAQ
Does Copilot Free include Chat and custom instructions? Yes. Free includes Chat, repository custom instructions, and Copilot CLI. Limits: 2,000 inline completions per month (you are disabling those), auto model selection only, and fewer AI credits than Pro. Live numbers: Plans for GitHub Copilot.
Why disable inline suggestions if Chat can still write code?
Ghost text completes the current line while you type, which short-circuits the exercise. Tutor instructions apply to Chat. They do not stop the inline model. GitHub therefore turns github.copilot.enable off first, then adds the Chat tutor file. If Chat still emits snippets, the instruction file is not in context.
How do I know .github/copilot-instructions.md was used?
In Copilot Chat, expand References on a response and look for .github/copilot-instructions.md. GitHub documents that check. If the file is missing from References, fix the path or useInstructionFiles before trusting the tone of the answer.
Should I install GitHub Copilot CLI for learning?
No. Copilot CLI (copilot -p, optional --allow-all-tools) writes code. Keep it off this repo until you drop the no-solutions file. Node.js 22+ is required only if you later install @github/copilot.
What if my company GitHub org disabled Copilot?
Workspace files will still verify. Chat will not. Only an organization owner can change Copilot policy. Switching to a personal account with Copilot Free is a separate VS Code sign-in (GitHub Copilot: Sign In), not a settings.json fix.