<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SEBAA Mohammed</title>
    <description>The latest articles on DEV Community by SEBAA Mohammed (@mohammed_sebaa_2610).</description>
    <link>https://dev.to/mohammed_sebaa_2610</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4196941%2F7d2a99d3-a266-482b-8686-3aee2071f7df.png</url>
      <title>DEV Community: SEBAA Mohammed</title>
      <link>https://dev.to/mohammed_sebaa_2610</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohammed_sebaa_2610"/>
    <language>en</language>
    <item>
      <title>Running Claude Code with Ollama and Local Models</title>
      <dc:creator>SEBAA Mohammed</dc:creator>
      <pubDate>Wed, 21 Oct 2026 01:08:35 +0000</pubDate>
      <link>https://dev.to/mohammed_sebaa_2610/running-claude-code-with-ollama-and-local-models-4c49</link>
      <guid>https://dev.to/mohammed_sebaa_2610/running-claude-code-with-ollama-and-local-models-4c49</guid>
      <description>&lt;h2&gt;
  
  
  Claude Code + Ollama: Coding with a Local Model
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; is Anthropic's agentic coding tool. It reads your project, edits files, and runs commands from the terminal. With &lt;strong&gt;Ollama&lt;/strong&gt;, you can run it on a model hosted on your own machine instead of in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why local models?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your code never leaves your machine&lt;/li&gt;
&lt;li&gt;No API costs&lt;/li&gt;
&lt;li&gt;Works offline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this guide, you'll install Claude Code, run it inside IntelliJ IDEA, connect it to Ollama, and test it on a small Java project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install Claude Code
&lt;/h2&gt;

&lt;p&gt;Install it globally with npm:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwoyvo1qmvdhr12p5ytj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwoyvo1qmvdhr12p5ytj.png" alt="install claude code via npm" width="366" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then open a terminal and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo2bogrzu7dibyzqkmhth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo2bogrzu7dibyzqkmhth.png" alt="run claude code in terminal" width="547" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the Claude Code prompt appears, the installation worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Run It Inside IntelliJ IDEA
&lt;/h2&gt;

&lt;p&gt;You don't need to leave your IDE. Open your project in IntelliJ, open the built-in terminal (&lt;strong&gt;View → Tool Windows → Terminal&lt;/strong&gt;), and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fthhfrghmk3056awkg8fg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fthhfrghmk3056awkg8fg.png" alt="Running claude code in a terminal in intelij" width="798" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Claude Code now has access to your project files and works right next to your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Connect It to Ollama
&lt;/h2&gt;

&lt;p&gt;Ollama exposes an Anthropic-compatible API, so Claude Code can talk to a local model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install Ollama&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; lets you download and run language models &lt;strong&gt;on your own machine&lt;/strong&gt;. Your code never leaves your computer and there is no per-request cost.&lt;/p&gt;

&lt;p&gt;On &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;https://ollama.com&lt;/a&gt; you can create a free account. The dashboard shows your free quota for cloud models. For the rest of this tutorial (100% local), it isn't required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Pull a coding model:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama pull qwen3.5:9b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Point Claude Code at Ollama:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_BASE_URL=http://localhost:11434
claude --model qwen3.5:9b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;On Windows PowerShell, use &lt;code&gt;$env:ANTHROPIC_AUTH_TOKEN="ollama"&lt;/code&gt; and &lt;code&gt;$env:ANTHROPIC_BASE_URL="http://localhost:11434"&lt;/code&gt; instead of &lt;code&gt;export&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Alternatively, let Ollama handle the setup with one command, using --model&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama launch claude --model qwen3.5:9b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F91j8466sxhr7i5amftcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F91j8466sxhr7i5amftcs.png" alt="run claude code with specific model" width="799" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Build a Demo Project
&lt;/h2&gt;

&lt;p&gt;Let's test the setup with a small Java project: a &lt;strong&gt;console task manager&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Create an empty Java project in IntelliJ, open the terminal, start Claude Code, and give it this prompt:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a simple Java console app: a task manager. Users can add,
list, complete and delete tasks. Save tasks to a text file so they
persist. Keep it to 2-3 classes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Claude Code will plan the work, create the files, fix the errors, and ask for your permission before making changes. Approve the actions and watch it work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv1pd2suq3hkf2sjn8vhs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv1pd2suq3hkf2sjn8vhs.png" alt="claude code running" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpokj0plgunlro4iz7f2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpokj0plgunlro4iz7f2w.png" alt="claude code running" width="800" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then run the app and try it out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpcs3bit0dfsxmj8328zi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpcs3bit0dfsxmj8328zi.png" alt="testing program" width="731" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuyj1aymyxr31xlfci9m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuyj1aymyxr31xlfci9m1.png" alt="testing program" width="514" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that it doesn't only generate code. It also creates the files, runs the program, and fixes its own errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud vs Local: Quick Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Cloud Claude&lt;/th&gt;
&lt;th&gt;Local model (Ollama)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Privacy&lt;/td&gt;
&lt;td&gt;Code is sent to the API&lt;/td&gt;
&lt;td&gt;Stays on your machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Subscription / API&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;Depends on your hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quality&lt;/td&gt;
&lt;td&gt;Highest&lt;/td&gt;
&lt;td&gt;Good for small tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Claude Code with Ollama is a practical way to try agentic coding without sending your code anywhere, as long as your machine can handle the model. Start with a small project like this one, then try it on your own code.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>java</category>
      <category>ollama</category>
      <category>claudecode</category>
    </item>
  </channel>
</rss>
