CLAUDE.md to use local AI model
-
I just followed this guy's tutorial:
https://towardsdatascience.com/run-claude-code-for-free-with-local-and-cloud-models-from-ollama/I'm using claude code with ollama running gpt-oss:20b on my PC with my Nvidia GPU to speed it up.
I found this CLAUDE.md file works well. It tells the gpt-oss model how to use the Write tool to write to files:
My CLAUDE.md file:
## Important rules - If the user wants you to write a file, do it. Use your Write tool to create the file. The Write tool has a required parameter called "file_path".My interactive claude session:
▐▛███▜▌ Claude Code v2.1.29 ▝▜█████▛▘ gpt-oss:20b · API Usage Billing ▘▘ ▝▝ ~/appdev/raspi /model to try Opus 4.5 ❯ create a python script called hello.py in the current directory that prints "Hello World". ● Write(hello.py) ⎿ Wrote 2 lines to hello.py 1 print("Hello World")This is a command that runs a non-interactive claude session. You could run it via the TRIGGERcmd agent
claude -p -d --model gpt-oss:20b --permission-mode acceptEdits "create a python script called hello.py in the current directory that prints Hello World"I created a this myclaude.bat file:
set ANTHROPIC_BASE_URL=http://127.0.0.1:11434 set ANTHROPIC_AUTH_TOKEN=ollama cd c:\myfolder claude -p -d --model gpt-oss:20b --permission-mode acceptEdits %1My Command field in the GUI editor looks like this:
start /w c:\myfolder\myclaude.batMy commands.json entry looks like this:
{ "trigger": "claude code", "command": "start /w c:\\myfolder\\myclaude.bat", "offCommand": "", "ground": "foreground", "voice": "", "voiceReply": "", "allowParams": "true", "quoteParams": "true", "mcpToolDescription": "" }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login