Close Menu
  • AI Tools
    • Claude AI
    • ChatGPT
    • Cursor AI
    • GitHub Copilot
  • Programming
    • Python
    • JavaScript
    • Software Engineering
  • Web Development
    • HTML Tutorial
    • CSS Tutorial
    • Tailwind CSS
    • React JS
  • Roadmaps & Careers
    • Freelancing
  • About
  • Contact
Facebook X (Twitter) Instagram
Skill Trek
Facebook X (Twitter) Instagram Pinterest
  • AI Tools
    • Claude AI
    • ChatGPT
    • Cursor AI
    • GitHub Copilot
  • Programming
    • Python
    • JavaScript
    • Software Engineering
  • Web Development
    • HTML Tutorial
    • CSS Tutorial
    • Tailwind CSS
    • React JS
  • Roadmaps & Careers
    • Freelancing
  • About
  • Contact
Subscribe
Skill Trek
Home»AI Tools»Claude AI»How to Use Claude Code for Free using Ollama in VS Code
Claude AI

How to Use Claude Code for Free using Ollama in VS Code

Md Al MamunBy Md Al MamunSeptember 3, 2026No Comments11 Mins Read
Share Facebook Bluesky Threads Pinterest Twitter LinkedIn Tumblr Email
Follow Us
Google News Flipboard
Share
Facebook Bluesky Pinterest Threads Email Copy Link

What if you could use an AI coding agent like Claude Code inside Visual Studio Code without relying entirely on a monthly subscription?

With Ollama, you can run open-source large language models locally and connect them to Claude Code for a more private and flexible development workflow.

In this guide, you’ll learn how to:

  • Install Claude Code
  • Install Git Bash on Windows
  • Install and configure Ollama
  • Connect Claude Code to Ollama
  • Use Claude Code inside Visual Studio Code
  • Build and test a Node.js to-do API

Note: Model availability, authentication options, commands, and integration steps may change over time. Always check the official Claude Code and Ollama documentation for the latest instructions.

Let’s get started.

Prerequisites

Before beginning, make sure you have:

  • A Windows, macOS, or Linux computer
  • Visual Studio Code
  • An internet connection
  • Sufficient system resources to run local AI models
  • Basic familiarity with terminals and JavaScript

This tutorial uses Windows examples, but Ollama is also available for macOS and Linux.

1. Install Claude Code

The first step is to install Claude Code.

Open a new browser tab and search for Claude Code. Visit the official Claude Code website and locate the CLI installation command.

Copy the installation command. You’ll run it in a terminal shortly.

2. Open PowerShell and Install Claude Code

On Windows, open PowerShell.

Paste the Claude Code installation command into PowerShell and press Enter.

The installation should take a few moments. After it finishes, you may see a message indicating that Claude Code requires Git Bash.

If you see this message, install Git Bash before continuing.

3. Install Git Bash

Open a new browser tab and search for Git Bash.

Visit the official Git website and download the installer for your operating system. Git is available for Windows, macOS, and Linux.

For Windows, download the Windows installer.

After the download finishes:

  1. Double-click the installer.
  2. Select Yes if Windows asks for permission.
  3. Click Next through the setup screens.
  4. Enable the option to add the Git Bash profile to Windows Terminal, if available.
  5. Choose your preferred default editor for Git. Visual Studio Code is a good option.
  6. Continue through the remaining setup options.
  7. Click Install.

Wait for the installation to finish, then click Finish.

4. Install Claude Code Again

Return to your terminal and open a new terminal session.

Paste the Claude Code installation command again and press Enter.

Claude Code should now install successfully.

Wait for the installation process to complete.

5. Verify the Claude Code Installation

After installation, verify that Claude Code is available by running:

claude --help

Press Enter.

If you see an error such as:

claude is not recognized as the name of a cmdlet

the Claude Code installation directory may not have been added to your system PATH.

6. Add Claude Code to the Windows PATH

First, identify the directory where Claude Code was installed and copy the required path.

Then open Windows Search and search for:

Environment Variables

Open Edit the system environment variables.

Next:

  1. Open the Advanced tab.
  2. Click Environment Variables.
  3. Under the appropriate user or system variables section, select Path.
  4. Click Edit.
  5. Add the Claude Code installation directory.
  6. Click OK to save the changes.
  7. Click OK again to close the remaining windows.

Open a new terminal so Windows can load the updated PATH.

Run the following command again:

claude --help

If the Claude Code help options appear, the installation is working correctly.

7. Launch Claude Code

You can now launch Claude Code by running:

claude

Press Enter.

Claude Code will open its terminal interface.

During the initial setup, choose your preferred color mode and press Enter.

You’ll then see several authentication options.

Option 1: Claude Subscription

This option requires a paid Claude subscription, such as Pro, Max, or Max 20x.

Option 2: Anthropic Console

This option uses an Anthropic Console account and requires API usage.

Option 3: Third-Party Platform

This option allows Claude Code to work through a third-party platform.

For this tutorial, choose the Third-Party Platform option.

8. Install Ollama

Ollama is an open-source platform that allows you to run large language models locally on your computer.

Open the official Ollama website and select Download.

Choose the installer for your operating system:

  • Windows
  • macOS
  • Linux

For Windows, select Download for Windows.

Save the installer and wait for the download to finish.

9. Install Ollama

Once the download is complete, open the installer.

Double-click the downloaded file and follow the installation instructions.

Click Install and wait for the setup process to finish.

After installation, Ollama will launch and display available models that you can install based on your requirements.

10. Configure the Ollama Context Size

Before connecting Ollama to Claude Code, review the Ollama settings.

Open Settings in Ollama.

The context size may be set to 4K by default. Depending on your hardware and the model you’re using, you may be able to increase it to 32K or 64K.

A larger context window can be useful for coding projects because it allows the model to process more project information in a single interaction.

However, larger context sizes require more system resources. Choose a setting that your computer can handle comfortably.

11. Explore Ollama Integrations

Return to the main Ollama interface.

You’ll find several integration options for AI coding tools and development platforms, including:

  • Claude Code
  • Codex
  • OpenCode
  • Llama
  • Other AI development tools

Ollama can also be used for automation and local AI workflows.

For this setup, select Claude Code.

12. Review the Claude Code and Ollama Setup

The Claude Code integration page provides instructions for connecting Claude Code with Ollama.

The page may include:

  • Claude Code installation instructions
  • Commands for launching Claude Code
  • Recommended models
  • Model download commands
  • Configuration instructions

Depending on your requirements, you may see models from providers such as GLM and MiniMax.

Ollama provides commands for downloading and running these models.

Because our goal is to use Claude Code inside Visual Studio Code, continue with the Visual Studio Code setup.

13. Create a Project Directory

Create a new folder for your project.

For example, name it:

demo-app

Open Visual Studio Code and open the demo-app folder.

You can drag the folder into Visual Studio Code or select it through the File > Open Folder menu.

If Visual Studio Code asks whether you trust the folder, choose the appropriate Trust option.

14. Install the Claude Code Extension for Visual Studio Code

In Visual Studio Code, open the Extensions panel.

Search for:

claude

Look for the official Claude Code extension from Anthropic.

Select the official extension and click Install.

Wait for the installation to complete.

Once installed, Claude Code will be available directly inside Visual Studio Code.

15. Open Claude Code in Visual Studio Code

Open the Claude Code options from the Visual Studio Code interface.

Depending on the extension version, you may be able to open Claude Code through the sidebar, Command Palette, or integrated terminal.

When prompted, select Claude Code.

You may see the following authentication options:

  • Claude AI subscription
  • Anthropic Console
  • Third-party platform

Choose the option that allows you to Run Claude in terminal.

A terminal window will open inside Visual Studio Code.

Choose your preferred color mode and press Enter.

16. Connect Claude Code to Ollama

Now connect Claude Code to Ollama.

Open the integrated terminal in Visual Studio Code.

From the Ollama Claude Code integration instructions, copy the provided command.

Paste the command into the terminal and press Enter.

Claude Code should redirect you to Ollama to establish the connection.

If required, create an Ollama account or sign in to an existing account.

To create an account, select Sign Up, enter your email address, create a password, and complete the connection process.

17. Select a Model

After the connection is established, you’ll return to the Claude Code interface.

You should now be able to use a model provided through Ollama.

In this example, the selected model is Kimi K2.5.

Press Enter to continue.

When Claude Code asks whether you want to use the recommended settings, select:

Yes, use recommended settings

If Claude Code asks whether you trust the project folder, select:

Yes, I trust this folder

Claude Code is now ready to work with your project.

18. Test Claude Code

Let’s verify that everything is working.

Start with a simple prompt:

Hi, who are you?

Claude Code should respond and identify itself as Anthropic’s coding agent.

It can assist with software engineering tasks such as:

  • Writing code
  • Debugging applications
  • Exploring a codebase
  • Creating new projects
  • Modifying files
  • Explaining technical concepts
  • Reviewing existing code

19. Build a Node.js To-Do API

Now test the setup with a real development task.

Ask Claude Code to create a Node.js application using Express for a simple to-do list server:

Create a Node.js app using Express for a to-do list server.

Claude Code will begin working on the project.

It can scaffold the application, create the required files, install dependencies, and implement the basic API functionality.

After a short time, the project files should appear in Visual Studio Code.

20. Create the Project Files

During the process, Claude Code may ask for permission to modify specific files.

For example, it may ask:

Do you want to edit package.json?

Choose Yes.

Claude Code will create or update the package.json file.

It may then ask whether you want to edit index.js.

Choose the appropriate option.

Claude Code will create the index.js file containing the Express server.

21. Review the Generated API

After the generation process is complete, Claude Code will provide a summary of the application.

The to-do server should include API endpoints for working with to-do items.

It should also provide instructions for running the application.

Typically, you’ll install the dependencies with:

npm install

Then start the development server with:

npm start

or:

npm run dev

The correct command depends on the project configuration generated by Claude Code.

22. Install the Dependencies

Open a new terminal in Visual Studio Code.

Run:

npm install

This installs the dependencies listed in package.json.

Wait for the installation to finish.

23. Start the Development Server

Next, run:

npm run dev

Your Express server should start running locally.

In this example, the server runs at:

http://localhost:3000

Open the URL in your browser.

To test the to-do API, visit:

http://localhost:3000/todos

At this stage, the API may return an empty list because no to-do items have been added yet.

24. Add Default To-Do Items with Claude Code

Return to Claude Code and ask it to add some default to-do items:

Add some default to-dos.

Claude Code will modify the project files as needed.

Approve the requested changes.

Once the changes are complete, refresh the following endpoint:

http://localhost:3000/todos

You should now see the generated to-do items returned by the API.

25. Test a Specific To-Do Item

The API can also retrieve a specific to-do item by its ID.

For example, open:

http://localhost:3000/todos/1

This requests the to-do item with ID 1.

If the item exists, the API will return the corresponding to-do.

Conclusion

You’ve now connected Claude Code with Ollama, opened the workflow inside Visual Studio Code, and used an AI coding agent to build and modify a working Node.js application.

This setup gives you a flexible development environment powered by open-source models through Ollama. Depending on your hardware, model choice, and configuration, you can use local AI assistance for coding, debugging, project exploration, and application development.

Running models locally can also give you greater control over your development workflow and reduce your dependence on paid hosted AI services.

Frequently Asked Questions

Is Claude Code completely free with Ollama?

Not necessarily. Ollama provides access to locally hosted models, but Claude Code authentication and integration requirements may vary. Check the current official documentation for the latest pricing and account requirements.

Can I use Ollama on macOS or Linux?

Yes. Ollama supports Windows, macOS, and Linux. The installation steps and terminal commands may differ slightly between operating systems.

What hardware do I need to run local models?

Hardware requirements depend on the model size and context window. Larger models generally require more RAM or GPU memory. Start with a smaller model if your computer has limited resources.

Why is my local model responding slowly?

Slow responses may be caused by limited RAM, insufficient GPU memory, a large context size, or a model that is too large for your hardware. Try reducing the context size or using a smaller model.

Can I use Claude Code with other Ollama models?

Yes, depending on the current integration and compatibility requirements. Ollama supports many models, but not every model will provide the same coding performance or tool-use capabilities.

Share. Facebook Pinterest Telegram Bluesky Threads Email Copy Link
Previous ArticleHow to Use Claude Code for Free with Agent Router API in VS Code
Next Article How to Install Ubuntu on VirtualBox in Windows 11
Md Al Mamun
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

a full-stack developer and educator with a community of over 144,000 learners across YouTube, Udemy, and Facebook. With years of hands-on experience in building modern web applications, I specialize in making complex topics easy to understand through clear, structured explanations and real-world examples.

Related Posts

How to Use Claude Code for Free with Agent Router API in VS Code

September 3, 2026

How to Get the Usage Limit and Token bar in Claude Code

August 25, 2026

How to Connect GitHub to Claude Code (Step-by-Step)

August 24, 2026

How to Use Canva with Claude: A Complete Beginner’s Guide

August 14, 2026

How to Set Up Omni Route with Claude Code

August 13, 2026
Add A Comment
Leave A Reply Cancel Reply

Recent Posts

  • How to Connect OpenCode to Roblox Studio Using MCP
  • How to Check Ubuntu Version: 3 Easy Methods
  • How to Install Ubuntu on VirtualBox in Windows 11
  • How to Use Claude Code for Free using Ollama in VS Code
  • How to Use Claude Code for Free with Agent Router API in VS Code

Recent Comments

No comments to show.

Archives

  • September 2026
  • August 2026

Categories

  • AI Tools
  • Claude AI
  • Google Antigravity
  • Programming
  • Roadmaps & Careers
Facebook X (Twitter) Instagram Pinterest
© 2026 SkillTrek. All Rights Preserved by Md Al Mamun.

Type above and press Enter to search. Press Esc to cancel.