OpenCode is an open-source terminal coding agent that lets one agent run models from many providers, including free options, paid API keys, and existing ChatGPT subscriptions. This OpenCode tutorial covers installation, model connections, sessions, plan and build mode, skills, MCPs, and the AGENTS.md project Firebase on a July 2026 walkthrough.
What is OpenCode and who is it for?
OpenCode is an open-source terminal coding agent that lets you run one agent against models from many providers. The project is maintained by SST in the sst/opencode repository, and its documentation lives at opencode.ai. It targets developers who want Claude Code-style workflows without being locked to a single vendor's models.
The pitch is provider freedom. You can attach a pay-as-you-go API key, a subscription you already pay for, a free model, or even a local model, and keep the same agent commands either way. Features popularized by Claude Code, Anthropic terminal coding tool, such as plan mode, sub-agents, and AGENTS.md project instructions, all carry over.
The walkthrough below follows a July 2026 video tutorial by the Eric Tech channel. His commands and workflow are first-hand demonstrations; where a claim depends on pricing or current product behavior, the article says so explicitly and dates the source.
How do you install and start OpenCode?
Installation is a single curl command from the OpenCode documentation. Run it in your terminal, then OpenAI new terminal session so the opencode binary is on your PATH. Typing opencode starts the interactive interface; Ctrl+C exits it.
To run the agent inside a project, change into the project directory first, or start the terminal from an editor. The tutorial author uses VS Code, Microsoft's code editor, and runs opencode in its integrated terminal so the session is already scoped to the repository.
Two habits matter early. The context indicator in the bottom-right corner shows how much of the current session's context window is consumed, and the /new command starts a fresh session when it fills up.
How do you connect models, free tiers, and subscriptions?
The /connect command lists large language model providers and walks you through authentication. There are two billing shapes: subscription plans with a flat monthly fee, and pay-as-you-go API keys that you load with credits. The tutorial was recorded in July 2026, so check the current OpenCode site before relying on any specific plan or price.
The video demonstrates three paths, all confirmed on screen by the presenter (first-hand demonstration, not independent verification):
OpenCode connection options at a glance
Per the July 2026 video, OpenCode's connection menu groups access into roughly these options. Treat prices and model availability as time-sensitive.
| Option | Billing shape | What the video showed |
|---|---|---|
| OpenCode Zen | Pay-as-you-go API keys, plus free models | A free model selectable from the Zen console, usable with no payment for the key |
| OpenCode Go | Flat monthly subscription (reported at $5/month in the video) | Access to a set of paid models under one plan |
| ChatGPT Plus/Pro | Existing OpenAI subscription | OAuth link authenticates the subscription, then OpenAI models appear in the picker |
The practical takeaway: if you already pay for ChatGPT, OpenAI's assistant subscription, you can authenticate it once and pick its models inside OpenCode. If you want to test the tool with zero spend, the free models behind OpenCode Zen are the fastest route.
Which daily commands and modes matter most?
The tutorial's core workflow uses a small set of commands. Learning these covers most day-to-day use of the agent.
/connectattaches a model provider./newstarts a fresh session when context fills.- Shift+Tab toggles between plan mode and build mode; plan mode produces an implementation plan and asks clarification questions before any code changes.
- Double-tap Escape interrupts a running task, and typing
continueresumes it. /variantschanges the model's reasoning effort level, for example from medium to high.
Sessions can run in parallel. In the video, one session refactors a scripts folder while a second session reads past session histories and proposes updates to AGENTS.md. The sessions command switches between them.
Collaboration and history commands round out the set. share publishes the conversation as an HTML page and copies a URL, and unshare revokes it. export writes the full session, including tool calls and metadata, to a Markdown file. timeline lists every message in the session so you can roll back a message and its file changes, or fork a new session from that point.
How do skills and MCPs extend the agent?
Skills are reusable workflows or standard operating procedures that steer an agent through a task. The video browses skills.sh, a directory where skills for coding agents are ranked by popularity and trend, then installs one named superpowers by copying an install prompt from the skill's repository page and pasting it into OpenCode.
Installation is itself an agent task: OpenCode asks for permission to write files, you approve, and the skill lands in the project's agents folder under skills. Restart OpenCode afterward so the running session picks up the new skill, then confirm it appears when you tab-complete the /skills command.
MCPs, or Model Context Protocol servers, plug external tools and data sources into the agent; the protocol is documented at modelcontextprotocol.io. The video treats skills and MCPs as the two main extension points, with skills covering procedural knowledge and MCPs covering live tool access.
What does AGENTS.md do in OpenCode?
AGENTS.md is a project-level instruction file, described at agents.md, that acts like a system prompt for the whole repository. The /init command generates one based on your current project structure, and OpenCode reads it at the start of every session.
The presenter's file stays under about 50 lines and contains four kinds of rules (his description, from the video): a repository definition, agent rules such as keeping responses concise and asking clarification questions, a folder map explaining what each directory holds, and context rules describing how synthesized documents relate to raw source folders. He credits the context-rules style to Andrej Karpathy's LLM wiki approach.
Rules you add take effect for new sessions. In the video, adding a one-line rule that responses must include emojis changed the agent's next reply immediately, which is a quick way to verify the file is being read.
Can OpenCode run a second-brain workflow?
Yes, and this is the tutorial's most opinionated section. The presenter keeps a personal knowledge base, or second brain, inside a repository and uses OpenCode to query it. Asking the agent who he should look up daily, or which advisors to add for his business, produces recommendations grounded in the notes already in context.
He then packages the pattern as a skill called ask-the-board. AI-generated profiles, built from scraped YouTube transcripts, sit in a board-members folder, and triggering the skill makes each member critique the problem from its own angle. In one on-screen example he asks how to reach 20% content growth, and each board member returns a different diagnosis and recommendation.
This is the presenter's personal workflow rather than a documented OpenCode feature, but it shows the general pattern: store raw notes in the repo, write a skill that routes questions to the right subset, and let the agent synthesize answers on demand.
FAQ
- Is OpenCode free to use? The OpenCode agent itself is open source, and the video shows free models available through OpenCode Zen with no payment required for an API key. Paid usage depends on which provider or plan you connect.
- Do OpenCode skills work with Claude Code? The skills.sh directory in the video lists install prompts for multiple agents, including Codex, Cursor, and OpenCode, and skills are plain instruction files. Compatibility per skill depends on its own documentation.
- What is the difference between plan mode and build mode? Plan mode makes the agent produce a plan and ask clarification questions before touching files. Build mode executes changes. Shift+Tab switches between them.
- Can I use my existing ChatGPT subscription in OpenCode? In the July 2026 video, the
/connectmenu includes a ChatGPT Plus/Pro option that authenticates through a link and exposes OpenAI models in the picker. Verify current availability on opencode.ai.
- What should I do after installing a skill? Exit and restart OpenCode so a new session loads the skill, then check that it appears under the
/skillscommand before relying on it.
Fork this article
Start a new branch from the same video, shaped your way. You keep the credit; the original keeps the attribution.
A fork in another language is filed as a translation of this article, so the two pages point at each other. You can unlink it later from the editor.
0/240
You are creating
- Format
- For
- Language
- Source
- Your angle
You will be asked to sign in before it is generated.
Buy credits