Your First Copilot CLI Session
Getting from zero to a running Copilot CLI session takes under five minutes — here is exactly what to install, how to authenticate, and what to do in the first session so you learn the rhythm before you need it for real work.
The session is the unit of work in Copilot CLI — every task you run lives inside one, and knowing how sessions start, accumulate state, and end makes everything else cleaner.
Before the session, there is installation. It is quick. Copilot CLI is a standalone application — not a GitHub CLI extension. You install it once with your package manager of choice and you are one command away from running.
Install and authenticate
# Install Copilot CLI (pick one)
npm install -g @github/copilot # all platforms — requires Node.js 22+
brew install copilot-cli # macOS / Linux
winget install GitHub.Copilot # Windows
# Launch — first run walks you through login
copilot
# Inside the session, authenticate if prompted
/login
The login step matters. Copilot CLI uses your GitHub account to access the Copilot API. You need a GitHub Copilot subscription — Pro, Pro+, Business, or Enterprise. If you are on a free account, you will hit an authorization error when you try to start a session.
Starting a session
Navigate to your project directory and run:
cd ~/your-project
copilot
You will see a prompt indicator and a model name. You are now in an interactive session. The session knows your working directory. Every file path you reference or that Copilot CLI discovers is resolved relative to where you launched.
The session accumulates context as it works. When Copilot CLI reads a file, that file content enters the context. When it runs a command, the output enters the context. By the time you are three or four prompts deep on a task, the session knows a lot about your project — more than a fresh prompt ever could.
What to do in your first session
Do not start with a task that requires you to trust the output. Start with a task that teaches you how Copilot CLI thinks.
The best first prompt for an existing project:
Explore this project and give me a one-paragraph summary of what it does,
the tech stack, and the main entry points. Don't make any changes.
Watch what happens. Copilot CLI will read files — probably package.json, README.md, the main entry file, and a config or two. It will produce a summary based on what it actually found, not what you told it. This calibrates your mental model for how thorough its exploration is before it acts.
The key commands you need on day one
You do not need to memorize the full command list. Seven commands cover 90% of session management:
The three you will use most often in your first week: /help when you forget something, /usage to check what a session cost you, and /clear when context gets muddled and you want to reset without starting over.
Giving good prompts
Copilot CLI responds better to task descriptions than to open-ended questions. Compare:
Weak: "What's wrong with my auth module?"
Strong: "The auth tests in tests/auth.test.ts are failing with a 401 when the token is valid. Read the test, read the auth middleware it calls, and identify the root cause. Don't edit anything yet."
The stronger version tells Copilot CLI what to look at, what the symptom is, and what not to do. This matters because "what's wrong" could mean anything — Copilot CLI might read thirty files before concluding nothing is obviously wrong, while you already knew which test was failing.
Ending a session
Sessions do not end when you close the terminal — they persist in ~/.copilot/session-state/. To properly end one:
/new— starts a fresh session, preserving the old session's state on disk/clear— resets context in the current session without ending the processCtrl+Cor/exit— exits the process; the session state is still on disk
To pick a previous session back up, run copilot --resume (or /resume inside a running session) and choose it from the list.
Before ending any session where Copilot CLI made changes, run /diff to review which files were modified. This is your audit trail.
Lesson Drill
- Install Copilot CLI, authenticate, and run
copilot --version. Paste the version number somewhere you will remember it. - Start a session in an existing project and run the exploration prompt from this lesson. Read what Copilot CLI found and check whether it missed anything important.
- Run
/usageat the end of the session. How many tokens did a single exploration prompt cost?
Bottom Line
Starting a Copilot CLI session is two commands: navigate to your project and run copilot. The session accumulates context as you work and persists across terminal restarts. Good prompts are specific about the target, the symptom, and the constraints. Seven commands — /help, /usage, /context, /session, /clear, /new, /model — cover everything you need to manage a session confidently.
The next lesson covers custom instructions — how to wire your team's conventions into Copilot CLI so every session starts with the right context already loaded.