Key insight

GitHub Copilot is a language model pointed at your editor: to it, code is just text with strict patterns, so predicting the next line is the same trick as predicting the next word. It works from a limited context — usually your open files — so what it can see decides what it can do. It shows up in three modes of increasing autonomy: inline completions finish your keystrokes, chat answers questions, and agent mode does whole tasks. It writes plausible code — and plausible is not correct, so you're still the engineer.

AI coding assistants can feel like magic, and magic is hard to use well. This guide takes the mystery out of GitHub Copilot from the ground up, so you understand what it's actually doing — which is exactly what lets you get far more out of it.

1 · A language model that writes code

At its heart, Copilot is exactly the kind of language model you'd use for chat — a system trained to predict what text comes next. The twist is that it was trained on an enormous amount of code, so it's brilliant at predicting the next line of a program. That's the key realisation: to a model, code is just another kind of text with very strict patterns, and predicting the next token of code is the same trick as predicting the next word of a sentence. So Copilot isn't a mysterious new invention — it's the text-prediction engine you already understand, pointed at your editor.

2 · It reads your open files as context

The single most important thing about any coding assistant: it can only help with what it can see. Copilot doesn't magically know your whole codebase. When it makes a suggestion, it's working from a limited window — typically the file you're editing, the code around your cursor, and often your other open files. That's its context window: a limited desk holding what it currently knows. This explains its behaviour. A perfect suggestion means the relevant code was in view; a suggestion that ignores a function in another file usually means that file simply wasn't on its desk. What you have open literally shapes what it can do.

Copilot suggests from the context it can see Your open code feeds the model, which suggests; it can only use what it can see. your open files the model suggests It can only use what it can see — your files are the context
Figure 1. Most of the skill of using a coding assistant is making sure the right things are on its desk before you ask.

3 · Inline completions: finishing your line

Copilot shows up in three modes. The first and most famous is inline completion — the grey “ghost text” ahead of your cursor as you type. You start a function, and it predicts the rest of the line or the whole block, which you accept with Tab or ignore by typing on. This is autocomplete on steroids: fast, constant, driven by the code around your cursor. It shines for the routine and predictable — boilerplate, obvious next steps, patterns it can see you establishing. You stay in control, because nothing happens unless you press Tab.

4 · Chat: ask in plain language

The second mode is chat — a conversation panel inside your editor where you ask in plain language. “Why is this test failing?” “Explain this function.” “Write a version that handles empty input.” Chat is more flexible than inline: you can describe intent, ask for explanations, and go back and forth. It can pull in context you point it at — the selected code, a file, sometimes the whole project — so it reasons about more than the lines near your cursor. Chat is where your prompt-engineering skills pay off directly: be specific, give context, show the format. It's the chat model you know, living beside your code so its answers are concrete instead of generic.

5 · Agent mode: it takes the wheel

The third and newest mode is agent mode, a real step up in power. You give it a goal — “add a login page,” “fix this bug across the codebase” — and it works like an agent: it plans, edits multiple files, runs commands like tests, reads the results, and iterates until the goal is met. This is where the agent-security ideas come home: because it takes real actions in your project, the stakes are higher, which is why good agent mode keeps you in the loop, showing its plan and changes for approval. Inline finishes your keystrokes; chat answers your questions; agent mode does whole tasks — same model, three very different levels of autonomy.

Three modes of increasing autonomy Inline completion, chat, and agent mode, from least to most autonomous. inlinefinishes your keystrokes chatanswers your questions agent modedoes whole tasks Same model, rising autonomy — and rising stakes
Figure 2. Match the mode to the job: inline for the routine, chat for questions, agent mode for multi-step work.

6 · Why suggestions sometimes miss

Once you know Copilot works from a limited context, its failures become fixable. When it suggests code that ignores your existing helper, invents an API that doesn't exist, or misses your conventions, the cause is usually the same: the information it needed wasn't in its context window. It couldn't see the file, so it guessed — from general training rather than your specific code. This reframes how you work with it. Instead of “the AI is dumb,” think “what does it need to see?” Open the relevant file. Select the code you're asking about. Point chat at the right context. Most of the skill of using a coding assistant well is context management.

7 · You are still the engineer

One mindset is essential: Copilot writes plausible code, and plausible is not the same as correct. It predicts what code usually looks like in situations like yours — astonishingly useful, but it can confidently produce something that looks right and is subtly wrong (a hazard we cover under hallucination later). So you remain the engineer. Read what it suggests before accepting. Run the tests. Question an API you don't recognise. Treat its output like a fast junior developer's pull request: often great, sometimes off, always worth a review. Used this way it's a genuine multiplier; used blindly it's a fast way to ship confident-looking bugs. The difference is entirely you.

8 · A simple test you can run this week

Prove the context rule

1. Try all three modes: inline, chat, and agent.
2. Ask chat about code in a closed file — watch it struggle.
3. Open that file, ask again — see the answer improve.
4. Review one suggestion line by line before accepting.

The lesson: it can only help with what it can see — and you still decide.

9 · Glossary — every term, spelled out

Coding assistant
A language model, trained heavily on code, wired into your editor to suggest and write code.
Context window
The limited set of text (usually your open files) the assistant can see when making a suggestion.
Inline completion
Grey “ghost text” predicting the rest of your line or block, accepted with Tab.
Chat
A conversation panel in the editor for asking questions and requesting changes in plain language.
Agent mode
The assistant taking a goal and acting across your project — planning, editing files, running commands — with your approval.
Plausible vs. correct
Assistant output looks right (plausible) but may be subtly wrong (incorrect) — which is why you review.
Key takeaways

Copilot is a text-prediction model pointed at your editor — code is just patterned text.
It works from a limited context, usually your open files, so what it can see decides what it can do.
It comes in three modes of rising autonomy: inline completion, chat, and agent mode.
It writes plausible code, which isn't always correct — so you're still the engineer who reviews and decides.

References

  1. GitHub, About GitHub Copilot — how completions, chat, and agents work. docs.github.com
  2. Visual Studio Code, Copilot documentation — the three modes in the editor. code.visualstudio.com
  3. The Prompt Engineering guide’s Prompt Engineering Basics — the skills chat rewards.
  4. This guide’s Custom Instructions, Explained From Zero — teaching it your project.