opencode is an open source AI coding agent that works in the terminal. For
students in this course, it is a good next step after GitHub Copilot CLI or
Claude Code when you want a more configurable, open source workflow. It can use
several providers and is strong for longer agentic coding sessions.
One especially useful point for students is that OpenCode can connect to GitHub
Copilot. That means you can often use your GitHub student benefits inside
opencode instead of paying for a separate provider immediately.
OpenCode can also use OpenCode Zen, direct API-backed providers, and local models. For the overall picture, see Model access.
After working through this page, students should be better able to:
AGENTS.md and skills appropriately as reusable instruction layers in a
project workflowYou should already have:
One common starting route is GitHub Copilot through your GitHub student benefits. OpenCode can also use OpenCode Zen, direct APIs, and local models such as Ollama.
OpenCode documents several installation methods. Common choices are:
curl -fsSL https://opencode.ai/install | bash
npm install -g opencode-ai
brew install anomalyco/tap/opencode
Use whichever package manager you already use for the rest of your tools.
Start OpenCode in the project directory you want to work in:
opencode
You can also start it for a specific directory:
opencode /path/to/project
OpenCode is not tied to one provider. A few common student paths are:
If you want to use your GitHub Copilot student access, the common path is:
opencode./connect.GitHub Copilot./models and select a model.If you want OpenCode’s own curated model list:
opencode./connect.OpenCode Zen./models and select a model.If you want a direct provider route such as OpenAI or Anthropic API access:
opencode./connect./models and select a model.If you want a local route:
opencode./connect.Ollama./models and select a model.If you want the deeper local workflow, read Local models and Ollama.
For tool-calling local models, you may need a larger context setting.
Whichever route you use, finish with /models so you know which models are
actually available in your current session. See Model access
for the broader overview, and Which model should I use?
for guidance on which model fits which kind of task.
A safe beginner workflow is:
opencode in a repository you understand.Plan agent when you want help designing a change.
It plays a role similar to plan mode in other tools, but OpenCode implements
it as a separate agent rather than a toggle.Good first prompts are:
Explain the structure of this project.
Read @README.md and tell me what I should look at next.
Plan how to add a small feature, but do not make any changes yet.
A few OpenCode features matter quickly:
@path/to/file to include a file in your prompt!command to run a shell command and include its output/connect to add or manage a provider/models to inspect available models/init to create or update AGENTS.md/compact to shrink conversation context during a long sessionIf you want a one-shot non-interactive command, OpenCode also supports:
opencode run "Explain the purpose of this repository"
OpenCode is more powerful than a simple chat interface, so good habits matter:
For a more explicit student workflow for checking repository claims, diffs, commands, and tests, read Verification.
Use OpenCode when you want:
If you mainly want the quickest path from GitHub student benefits to a working terminal agent, GitHub Copilot CLI is still the simpler first step. If you want one polished paid tool first, Claude Code is another good starting point.
If you compare OpenCode with the other coding-agent tools in this guide, the same recurring ideas are visible here too:
Planning before editing: OpenCode separates planning into a built-in Plan
agent instead of a plan-mode toggle.Limited context: /compact and the emphasis on explicitly managing longer
sessions both reflect a limited context window.Work isolation: specialised agents and subagents help keep planning or
exploration work out of the main thread.Instructions and memory: instruction files such as
AGENTS.md and reusable skills are explicit, while the
current session carries the working context.After you have seen the three main coding-agent guides, the page on Agentic concepts reconnects these recurring ideas.
opencode./connect to attach GitHub Copilot, OpenCode Zen, or another provider.AGENTS.md is forllm