OpenCode 2.0: Biggest Update Ever (Free + Local Models)
Read the Portuguese translation →
Author: Leon van Zyl · Watch on YouTube
Video authored by the channel shown, not by IANIA; all rights belong to the creator. Transcript and summary generated automatically; the original-language content is preserved.
Original language: English
Original video: OpenCode 2.0: Biggest Update Ever (Free + Local Models) · Channel: Leon van Zyl · 14:26 · Watch on YouTube
Topics: AI agents, Software engineering with AI, AI developer tools, Local and open-source models
Summary
Section titled “Summary”OpenCode 2.0 adds shared sessions across the terminal, desktop app, and phone, along with background tasks, sub-agents, code mode, worktrees, and plugins. The video demonstrates these features by building a bill-splitting app and using free models, while also noting privacy considerations when using them. It explains how to install and configure OpenCode, including connecting to free models and running local models with Ollama. The presenter finishes by showing that a local model can run offline in OpenCode.
Key points
Section titled “Key points”- OpenCode can be updated with the /update command, and it is available as a terminal tool and a desktop app for Mac, Windows, and Linux.
- Sessions are shared between the terminal, desktop app, and mobile app.
- OpenCode supports multiple providers and local models, and the video uses free models for the bill-splitting app.
- Free models may involve OpenCode training on prompts, so the presenter advises caution for professional work and mentions paid services or local models as alternatives.
- Tasks can be moved to the background, and agents can launch background sub-agents using different models.
- Code mode lets an agent write a script to run multiple tools together rather than calling them one at a time.
- Worktrees let an agent make changes in a separate copy of the code before merging them into the main branch.
- Agents can create plugins, including one that requests permission before reading .env files.
- Ollama can be configured in OpenCode to run a local model, which the presenter describes as secure and usable offline.
Chapters
Section titled “Chapters”| Start | Chapter | Summary |
|---|---|---|
| 00:00 | OpenCode 2.0 overview and setup | The presenter introduces the update, explains how to install or upgrade OpenCode, and creates a project folder for the demo. |
| 02:41 | Shared sessions and free models | The video shows sessions shared across devices, selects a free model, builds the app, and discusses privacy considerations. |
| 05:22 | Background tasks and sub-agents | The presenter moves a task to the background, launches a review sub-agent, and checks its activity from different interfaces. |
| 08:05 | Code mode and worktrees | The video demonstrates code mode for combining tool calls, then uses a worktree to add and merge light and dark modes. |
| 10:43 | Plugins and protecting .env files | The agent creates a plugin that prevents reading .env files without permission, and the presenter tests it in a new session. |
| 12:18 | Running local models with Ollama | The presenter installs Ollama, configures a local model in OpenCode, and demonstrates running it offline. |
Quotes
Section titled “Quotes”this is the biggest update this open source coding agent has ever had. — 00:00
your sessions are shared between the desktop app, the terminal and the mobile app as well. — 02:41
code mode allows your agent to write the script that runs all of these tools at once. — 08:05
we can actually ask our agents to build their very own plugins. — 10:43
Now I’m actually running a local model on my machine in OpenCode. — 14:26
Concepts and entities
Section titled “Concepts and entities”OpenCode, OpenCode 2.0, Beam, Big Pickle, Ollama, Qwen3.8, LM Studio, Playwright MCP, Leon van Zyl
Full transcript (original language)
Section titled “Full transcript (original language)”00:00 OpenCode 2.0 is out, and this is the biggest update this open source coding agent has ever had. Your terminal, the desktop app, and even your phone all share the same session. Agents can now run in the background while you keep working. It can write its own plugins while you watch. And it comes with free models built in, so you can build your apps or follow along with this video without paying a cent. In this video, we’ll build a simple app, but we’ll have a look at all of the new features in OpenCode 2.0 along the way. First things first, if you already use OpenCode, upgrading is really simple.
00:34 Within OpenCode, all you have to do is run the command slash update. In fact, we get a little tip over here. So I would be just running the command. Update like so. Then I’ll click on upgrade. Then we just have to restart OpenCode. And now I am running OpenCode 2.0, which you can see down here. If this is your first time using OpenCode, I’ll link to this website in the description of the video. Installation is really simple. If you’re using Linux or Mac, what you can do is copy the curl command.
01:05 Or if you are on Windows, go to NPM, copy this command. And simply run that command in your command prompt or PowerShell. And this will install OpenCode. It’s also worth mentioning that OpenCode also has a desktop app. Again, from their website, go to download. But when we scroll down, we can go to OpenCode desktop app. And they’ve got an app for Mac, Windows and Linux. So I’m going to download the app for Windows. You can simply run the file that you just downloaded. And it’s really that simple. And now we’ve got access to the desktop app as well.
01:38 Now you can follow along with either the desktop app or the terminal. I’ll use the terminal, but don’t worry, all the features work in both. By the way, I’ve got a free course that teaches you how to use coding agents effectively. This has been for vibe coders and experienced developers alike. This teaches you the framework I use to build any project using free models all the way to frontier models. Again, it’s completely free, and I’ll leave a link in the description. So what I recommend you do is create a new folder for your project. So I’ll just create this bill splitter folder on my machine.
02:09 Then I’ll open command prompt in that folder. And I’ll just run OpenCode. This will simply ensure that all the files that the agent creates for this project will simply be stored in this folder. If you run this in the root of your machine, who knows where it’s going to end up adding all of those files. If you are using the desktop app, the process is very similar. Simply click on this drop down down here, go to add project. Then select that folder on your machine. And that’s really it. One of the new features in OpenCode is that your sessions are shared between the
02:41 desktop app, the terminal and the mobile app as well. So let me show you what that actually looks like. I’m going to start the session in the terminal and then I’m going to switch back over to the desktop app to show you that same session is available there as well. But first, let’s select our agent. OpenCode supports pretty much any provider out there, so you’re not limited to a single model or provider. It also supports local models too. If we run the command slash models. We can select from a wide range of different models.
03:14 We’ve got models from providers like OpenAI, Google, Anthropic, you name it. And if you do have local models using Ollama or LM Studio, you can select those from here as well. For this tutorial, let’s actually select one of the free models. I’m actually going to go with Beam. And I’ve actually never used this model before in my life, but we’ll see how good it is in a second. Please. Build a simple. Bill-splitting app that runs in the browser. Cool, they’ve seen this.
03:46 But I’m getting this message saying that this API key has expired, create a new API key in OpenCode console. and replace it with your client and secret store. To fix that issue, I’ll go back to the models. And then we can press control and A. To connect and integration. Then let’s go to OpenCode Console and press enter. Let’s click on add account. I’ll go to OpenCode console account. So this will ask you just to sign in with your Google account or your email and password, which I’m doing off screen at the moment.
04:17 Now I’ve authorized this connection. And that’s it. So let’s try again. And cool, now everything is working. Alright, that was really, really quick. What I want to do is actually go back to the desktop app and from here let’s go to home. And look at that. Now we can see that session that we started in the terminal in the desktop app as well. So let’s click on this And this is indeed the app that we just created. And of course we can select the model here as well, like beam. Let’s just ask it. Please can you start.
04:50 a dev server. Give me the URL. Now I do want to mention that these free models in OpenCode can be ideal if you’re starting out with agentic coding or if you’re a student. But for professional work, you have to be careful. You get to use these models for free, but in exchange, OpenCode might be training on your prompts as well So if you are worried about that, rather sign in with your OpenCode account or provide your Claude API key or use one of those paid services. Or maybe even run a local model on your machine.
05:22 OpenCode does allow you to run its agents and tasks in the background, too. So at the moment this task to start a dev server is holding up the entire thread. So I can’t actually interact with the agent anymore. What we can do is press control B or just click on this little button over here and that will move that entire task to the background, which means we can continue interacting with our agent. I’ll just click on this URL. And there we go, we can now access our app on that dev server. And speaking of running tasks in the background, we can also get our agent to
05:54 run other agents or sub-agents in the background too. Now we can simply do that by prompting the agent like this. So we can just ask it to spawn a background review agent. So maybe instead of using Beam. Let’s see what other models we have available. Let’s actually run Big Pickle as a background agent. Use Big Pickle for the background review agent. I’ve seen this. And our agent is saying it launched a background review agent using Big Pickle to review the bill splitter code.
06:25 I’ll share its findings when it completes. Let’s just click on this. Then we can click on this review agent over here. We can see the instructions that the main agent gave to the sub-agent. But if I just move my camera for a second, we can open up the sidebar and here we can see more details about this sub-agent. And here we can see that the model is indeed Big Pickle. So I do like the idea of combining different models for different tasks. And yes, Big Pickle is also free. And by the way, if you were curious what was happening in the terminal, if I just
06:59 close this. In the terminal we can see that very same session. And if I open the app on the phone, it’s the exact same story. I can start a session on my PC, walk away and continue working using my phone. And by the way, if you’ve never tried Big Pickle, it’s actually not a bad coding model. Now, unfortunately, you can’t send messages directly to sub-agents, but I do think it’s really cool that you get all of this information out of the box. To go back to the main agent, we can simply click on this option over here. If you wanted to see what sub-agents are up to in the terminal view, really all you
07:32 have to do is press the down arrow. And then we can see our review agent over here. I’ll press enter to go to that agent. And now we can see the output of that sub-agent. We cannot send messages to sub-agents in the terminal either. Then I’ll just press the up arrow to go back to the main agent. Our sub-agent completed the review and our main agent applied the fixes. Another really cool feature in OpenCode 2.0 is code mode. Now, let me first explain what this is. Normally, coding agents would call tools one at a time.
08:05 So they would call a tool, get a response, and then use that response to call the next tool. Now this can actually add a lot of bloat to the context window. Instead of calling one tool at a time, code mode allows your agent to write the script that runs all of these tools at once. Now code mode is enabled by default in OpenCode, but we can also force the agent to use it just by giving it a prompt. So we can say something like Use code mode to do the following. Retrieve the docs for the Playwright MCP from this URL.
08:36 Now, of course, yours could be anything. It can be any combination of tool calls. Then I’ll say please. Install the MCP locally. I’ll just say then use the MCP to open our app. We’ll keep it super simple. You know that code mode was used when you expand this sort of tool timeline. And it usually looks something like this. You’ll see these sort of execute steps. That call something like tools dot OpenCode dot whatever. So that way you know that the script was actually used to execute all of this.
09:07 And this entire session from researching the web, installing the tool and opening the browser, and it took like 27 seconds. And by the way, I do like the fact that we actually have an integrated browser within this desktop app, so it’s just super convenient Alright, let’s have a look at the next feature. We can now also get our agents to make changes in worktrees. This means that instead of our coding agent changing the main branch every time, it will make a copy of our code where it can safely make the changes and we can test it there. And once we’re happy with the changes, we can merge them back into
09:39 the main branch. So, looking at our app, we might want to add light and dark mode. So what I’m going to ask our agent is. Please use the worktree to add support for light and dark modes. All right, how cool is that? So we can see this line over here that says that the code Was moved to. My C drive, OpenCode, bill splitter theme. So this is a physical copy of our code base on our machine, by the way. I can show you that as well. So if I go back to that initial folder, if I go to OpenCode.
10:10 We now have this second folder for this version of the code. So all of the changes related to light and dark mode will be added to this folder, and once we’re happy, we’ll merge back into the main folder. And we can basically delete this copy. And because Beam is so stupidly fast, it actually completed this change in like 44 seconds. We have light and dark mode, which actually does work. So once we’re done we can just say. Please go ahead and move all the changes into the main branch and you can remove the worktree. And just like that, these changes were merged back into the main
10:43 branch. OpenCode 2.0 also supports plugins and we can actually ask our agents to build their very own plugins. So we can do something like this. Write a plug-in that stops you from ever reading .env files. If you’re unfamiliar with .env files, these are the files you use to store your secrets like API keys. And typically you don’t want your agents to read that information. So let’s actually send this instruction. Awesome, the agent just created the plugin, so when we create a new session,
11:14 the plugin will automatically be applied. Now if you do want to see all the plugins that are available, you can basically do that from your command prompt by running OpenCode plugin list And at the moment we only have this one plug-in set up. And as you can see, these plugins are very simple TypeScript files. Right, so just for the sake of this tutorial, I’m going to add this .env file. Let’s just add something like. My secret. Key equals Nothing to see
11:46 here. So our agent should not be able to look at this file at all. I’m going to open up a new session. Then I’ll select my bill splitter project. Please tell me what the available. Vars and values in .env are. And look at that, now the agent needs our permission to read that file, so I can just go ahead and deny it. And that’s it. That will stop this session, and our agent has no way of seeing what’s available in that file unless we give it permission to do so.
12:18 And finally, you can run local models as well. Let me show you how to do that. One of the easiest ways to run local models on your machine is to use something like Ollama. So you can simply go to Ollama dot com, click on get started. I prefer to go to download manually. Then simply run the file that you downloaded to install Ollama. Then you do have to select a model. Now this is going to depend on the hardware that you have. But personally, I like to run Qwen 3.8. This is a really good model, especially for coding tasks.
12:50 You will need about 16 GB of VRAM to run this model. There are smaller models as well. One piece of advice I will give you is ask your coding agent or Claude Code or whatever you’re using to look at your hardware and recommend the model on Ollama that you could realistically run. Then I’m simply going to copy the model name. Back in the terminal, we can run Ollama pull. And we will place in the name of the model. And that’s it, we can now run this model on our own machine. Then back in OpenCode select one of the free models, so Big Pickle as an example
13:23 or a beam, any of the free models will do. Then just simply run a prompt like I would like to use the Ollama models on my machine in OpenCode. Now I think this step might be optional. I’ve had issues before where OpenCode did not discover the models automatically on my machine. So this just kind of helps you with that setup. This is to say that Ollama is already running and OpenCode discovers its models automatically. Right, so if you get that message, that’s perfectly fine. I’m just going to try this out, so I’ll go to model.
13:54 Let’s go to manage models. I’m just going to look for. Ollama in this list. So yeah, we’ve got Ollama. I’m just going to enable Ollama. And I’m going to just kind of disable any models I don’t want. I’ll just ensure that Qwen 3.8 is enabled. Cool, let’s close this. I’m going to test it. From the model picker. I’m going to search for Qwen 3.8. Let’s say, hi. This might actually slow down my webcam as it loads the entire
14:26 model into memory. And cool, that’s it. Now I’m actually running a local model on my machine in OpenCode. And the benefit of running this model locally is it is secure, it’s offline. I can actually disconnect from the network entirely and everything will continue working. Let me know in the comments what you think about OpenCode 2.0. If you enjoyed this video, hit the like button and subscribe to my channel for more agentic coding tutorials. Thank you for watching. I’ll see you in the next one. Bye-bye.