Build Games Locally With Claude Code and Ollama (Full Transcript)
[00:00:00] Speaker 1: In this video, I'll show you how to use Claude code for free without paying a subscription or per token API usage. So what's the trick? We'll use Olama to run a free AI model directly on your computer and then connect it to Claude code. Now, Claude code is the tool that creates and edits files, but instead of using Anthropic's Claude models like Opus and Sonnet, we'll use a local AI model. I'll walk you through the setup and then we'll use it to build a playable breakout game from scratch. I'm Kevin, and let's dive in. First, head to olama.com. You'll find the URL at the bottom of the screen. Olama is a free tool that lets you download and run AI models directly on your computer instead of relying on a paid cloud service. In the top right-hand corner, click on Download. Over here, you can select your operating system. I'm using Windows, but Olama also works on Mac and also Linux. I'll select Windows and then click on this button to copy the installation command. Next, right-click your Start button and then right here, select Terminal and make sure that it launches PowerShell. Then in the top right-hand corner, I'll expand this to use the full screen. Within the terminal, over here, you can press the right mouse button and that paste in the command. This will download and install Olama. Press Enter. Once the install finishes, right down here, type in Olama and then a dash dash with version and then press Enter. Here, you should see a version number. Before moving on, there's one setting I recommend adjusting. Even though we installed Olama through terminal, you also have an Olama app on your computer. To open it, click on the Start menu, search for Olama and launch the app and you'll land here. In the top left-hand corner, let's open up the sidebar and then go down to Settings. Down here at the bottom, you'll see the context length. This determines how much information the AI model can work with at once, including your instructions and project files. For coding projects, a larger context window is helpful. So right over here, I'll increase it to 64K. Now keep in mind that a larger context window uses more memory. So you may need to choose a lower setting depending on your computer. Once that's saved, we're ready to go. Next, let's install Cloud Code by heading to this website. This is the coding tool that can create, edit and work with files on your computer. On this site, let's click on Terminal. And here too, you'll find installation instructions for Mac, Linux, and right down here, we have Windows. I'll copy the PowerShell command and then head back to Terminal. Just like we did before, paste in the command and then press Enter. To check that everything installed correctly, type in Cloud, dash dash and then version and press Enter. And here you should see the installed version number. Now, if Windows doesn't recognize the command, you may need to add Cloud Code to your path. If you run into that issue, I've included a command in the video description that you can copy and paste to fix it. And with that, Cloud Code is installed. Now that you have both Olama and Cloud Code installed, let's connect them. First, you'll want to create a project folder where Cloud Code can save the files it creates. Back here in the Terminal, type in the following command. This will make a new directory or create a folder called Breakout Game. Now here, you could use whatever name you want for your project, then press Enter. Now that we've created the project folder, we need to change into it. So over here, type in the following command for change directory to Breakout Game. Now, any files Cloud Code creates will be saved here by default. Now, to connect Cloud Code to Olama, type in the following command and then press Enter. Here, you'll see a list of AI models you can use with Cloud Code. Some of these run in the cloud. You'll see all the ones that end with cloud. But the goal of this video is to run everything locally for free. So we'll choose one of the local models or any one of the three here at the bottom. Generally, smaller models are easier to run on less powerful computers, and larger models tend to be more capable, but require more memory. I'm going to select Gemma 412B from Google. I've tested this model with Cloud Code, and it worked well for the game we're going to build. If your computer is less powerful, you can try a smaller model. Like here, we have Quen 3.5 4B, although the results may vary. And if you want to explore other models, you can find more options on Olama's website. Right over here, I'll select Gemma 412B. Press Enter, and Olama will download the model. Once the download finishes, Cloud Code will launch automatically. Here, I'll select Yes. Here, we have some configuration options. I'll go with Dark Mode, and then I'll press Enter. Here, it asks us if we trust the folder that we just created. Yes, I do. I'll select this option. Now that Cloud Code is running with Gemma 4, let's put it to work. And here we are in Cloud Code with a new project powered by an AI model running directly on your PC. Right down here, you can type in instructions in everyday language, and Cloud Code will use the AI model to create and edit files in your project folder. Let's ask it to build a simple arcade game. Feel free to pause if you'd like to read the full prompt, and then press Enter. Once it finishes, let's open the project folder in File Explorer. Here in File Explorer, I've navigated to my project folder, and here you'll see all the different files that Cloud Code created. Right up here, I'll double-click on the index.html file to open the game in my browser. And here it is. I can move the paddle with my mouse, bounce the ball, and break bricks to earn points. There's also a restart button to start a new game down at the bottom. Not bad for a game built entirely from a simple prompt using a free local AI model. The game works, but let's see if we can make it look even better. Back here in Cloud Code in the terminal, I'll ask it to improve the existing game rather than create something new. I'll type in the following prompt and then press Enter. Cloud Code will now review the existing project files and make the changes using Gemma 4. And that took about 24 seconds. Once it finishes, let's head back to the browser and refresh the page. And look at that. The ball now has a glowing effect, and when it hits the bricks, you can see some really beautiful particles fly out. That's pretty cool. When you're finished working with Cloud Code, you could simply type in forward slash exit and then press Enter, and this takes you back to the regular terminal. And whenever you want to jump back in, navigate to your project folder and then run the same command we used earlier. Here, you could choose your model. And now we're back in. All your project files are still there, so you can continue working on them. Of course, since you're running the AI model on your own computer, the performance that you see depends on your own hardware. And local models like Gemma 4 aren't always as capable as Anthropx Cloud models, especially if your project happens to be more complex. So you may need to experiment with different prompts or different models to get the results that you want. But as you just saw, you can build and improve an entire game using Cloud Code without paying for a subscription or AI usage. That's pretty cool. Thanks for watching, and I'll see you in the next one.
- Ollama can run AI models locally, avoiding paid cloud API usage.
- Claude Code can be configured to work with locally hosted Ollama models.
- Increasing context length can help coding workflows but requires more memory.
- A project directory should be created before launching Claude Code so generated files are organized.
- Model selection depends on available hardware: smaller models are easier to run, while larger models may provide stronger results.
- The demonstration creates and visually improves a functional Breakout game from natural-language prompts.
- Local models are free to use after download but may be slower or less capable than cloud-hosted models on complex tasks.