Back to Resources

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
5 linescompact
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]
Rendered from Mermaid source with the native ZeroLabs diagram container.

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 (gh 2.40+). Use the CLI workspace recipe if gh auth status fails.
  • 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 code CLI on PATH. Copilot Chat locksteps with the latest VS Code. An old code binary will refuse a current GitHub.copilot-chat VSIX.
  • 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 LayerMinimum VersionProduction RecommendationPurpose in Stack
Visual Studio CodeLatest stable with code on PATHCurrent monthly VS CodeHost Copilot Chat and workspace settings
GitHub CLIgh 2.40.0gh 2.98.0 or newerNon-interactive gh auth status probe
Copilot planCopilot FreeCopilot Pro if you need model choiceAuthorizes Chat. Free uses auto model selection only
Copilot extensionsGitHub.copilotGitHub.copilot plus GitHub.copilot-chatInline engine (disabled) and Chat panel (kept)
Node.js (optional CLI)Node.js 22Node.js 22 LTSOnly 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.

  1. 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.

    Terminalbash
    gh auth status

    Expected output includes:

    text
    github.com  ✓ Logged in to github.com account YOUR_LOGIN  - Active account: true

    Then 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/copilot probe for individuals.

  2. Install the GitHub Copilot extensions in VS Code. GitHub documents first-run install from the VS Code status bar. The deterministic path is the code CLI. --force reinstalls without a prompt.

    Terminalbash
    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):

    text
    GitHub.copilotGitHub.copilot-chat

    If command -v code prints nothing, use Command Palette Shell Command: Install 'code' command in PATH. Sign in with GitHub Copilot: Sign In using the same account as gh auth status. VS Code attaches an existing plan, or enrolls Copilot Free if the account has none.

  3. 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 "*": false turns off ghost text, then NES still offers Tab patches unless you shut it off. Keep Chat. Do not set chat.disableAIFeatures.

    Terminalbash
    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:

    text
    workspace_settings=tutor

    Commit .vscode/settings.json on learner repos so clones inherit tutor mode. VS Code's inline suggestions docs confirm "*": false disables ghost text. If user settings set useInstructionFiles to false, that limitation wins: delete the user key or set it true. See the AI settings reference.

  4. Add repository tutor instructions for Copilot Chat. This is GitHub's learning step 2. VS Code loads .github/copilot-instructions.md from the workspace root and attaches it to Chat requests when instruction files are enabled.

    Terminalbash
    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:

    text
    tutor_instructions=ok

    That text is GitHub's sample. Keep the no-solutions rule. Skip path-specific .github/instructions/*.instructions.md files until the repo-wide tutor file shows up in Chat references.

  5. 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.md is listed. GitHub documents that check on the custom-instructions page.

    text
    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/copilot needs Node.js 22+). It is an agent that edits files and can run --allow-all-tools. Do not run copilot -p against 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.

Terminalbash
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:

text
VERIFY_OKinline_suggestions=offnext_edit_suggestions=offinstruction_files=ontutor_file=presentretired_gh_copilot=absent

gh 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 useInstructionFiles false. Fix: Command Palette Preferences: Open User Settings (JSON), remove the key or set it true, reload.
  • chat.disableAIFeatures is true: Copilot UI disappears. Set it false. This is not github.copilot.enable.
  • Wrong instruction path: GitHub and VS Code require .github/copilot-instructions.md at the workspace root. Move the file and re-run the probe.
  • Retired gh copilot extension: GitHub announced the replacement on 25 September 2025. Run gh extension remove copilot if 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.

Share