Claude Code talks to Anthropic. That is the whole product, and most days it is the right answer. But some work cannot leave the machine, some of it happens on a plane, and some of it is a loop you do not want metered. For those, you want the same agent answering from a model on your own hardware.
In ToolPiper that is one switch. You keep typing claude, and the sessions you already have open keep doing what they were doing.
What actually changes when you do this?
ToolPiper writes a few entries to Claude Code's user settings file, ~/.claude/settings.json: its own address on 127.0.0.1, the models you can run, and a command that hands Claude Code a token. Each new claude session reads that file when it starts and answers from the model you picked. Turn the switch off and the file goes back as ToolPiper found it.
Byte for byte, when nothing else changed in it, spacing and key order included. If you edited the file while the switch was on, your edit survives and the file comes back in sorted form. A value of your own for a key the switch wrote comes back too.
We built it this way because a second command for the same agent was the wrong shape. Claude Code reads settings at launch and has documented keys for a gateway and a model list, so one claude can do both jobs.
What happens to the sessions I already have open?
Nothing. A session already running stays where it is, because a long conversation should never land on a smaller model because of a click in another window. Only new sessions start on the engine.
The way this works: Claude Code applies a settings change to every running session, so the switch first writes a ConfigChange hook on its own, and only after sessions have loaded it does it write the engine's entries. The hook makes any session not on the engine refuse the change. A new session reads the file at launch, runs no hook, and starts on the engine.
The catch is that while the switch is on, a session not on the engine takes no edit to that file at all, your own included, since Claude Code reloads the file all or nothing. Those edits arrive when you turn it off.
What you need
You don't need: an API key for a local model, a Docker container, Python, a config file you write by hand, or an internet connection once the model is downloaded.
You do need: a Mac with Apple Silicon, ToolPiper running, the official claude CLI, and a language model the switch can offer. ToolPiper never installs a language model on its own, so choose one first: open Choose a language model on Home. Gemma 4 E4B, Gemma 4 12B and Qwen 3.8 27B all qualify, and the switch lists what fits your Mac. A cloud model you added runs on your own account and needs Pro.
Why does a local model need a window of 98,304 tokens?
Claude Code holds about 33K back for compaction whatever the window is. At its lowest setting it compacts between 65K and 70K of usage, and the window still has to hold the reply and the compaction. So the switch offers a local model only if it was trained for at least 98,304 tokens and fits your Mac's memory.
Your local chats don't change. ToolPiper runs a chat at that chat's own window and gives Claude Code a separate entry of the model at 98,304. That separation has a cost: the same model in chat and in Claude Code at once loads twice, so its memory counts twice.
How long does a turn take on a local model?
It depends on the model and on how much of the window the conversation fills. The longest wait is compaction: on a large local model, a turn that holds a compaction takes minutes. Smaller models get there sooner.
Claude Code's prompts are large before you type anything, and a repo with a big CLAUDE.md starts close to the compaction point. Every reply still arrives on your Mac with nothing metered. Pick the model to fit the work: a small one for the loop you run all day, a larger one when the reasoning matters and you can wait for it.
Can I use more than one model?
Yes. /model inside Claude Code lists every model the switch can offer, local and cloud together. Each model compacts at its own number, so sessions on different models run side by side without one limit for all of them. A model you add while a session is open compacts at its own number from the next new session.
How does Claude Code get the credential?
ToolPiper mints a narrow token that can only reach chat and its Messages endpoint, and stores it in ToolPiper's own folder as claude-code-engine.key with mode 0600. The settings file names a command that prints it, so the token never enters the settings file.
Off revokes the token. The settings also blank Claude Code's credential keys, so a key exported from your .zshrc doesn't reach ToolPiper ahead of the token.
How to tell it worked
Start a new session and type /model. It lists ToolPiper's models and only those. The Claude Code row on Home names the model and says whether it runs on your Mac or on your own cloud account.
When it doesn't work
"Claude Code needs at least 98K"
The row names your model and its window. Choose a model trained for at least 98,304 tokens that fits your Mac, and the switch offers it.
The switch says your settings already name something
Settings that name another server, credential helper, credential, pinned model, context window or their own modelPicker are yours, and the switch could not put them back. It says so and writes nothing. The same goes for hooks turned off in your settings or by a policy on this Mac, a Claude Code older than the release this was measured on, and a settings file that isn't JSON.
model_not_found after turning it off
A session where you picked a model with /model keeps that pick, and Anthropic doesn't know the name. Run /model again in that session and nothing is lost. A session that never picked one comes back on its next message.
A session says it can't connect
ToolPiper closed while that session was on the engine. It stays pointed at ToolPiper so your code never moves to the cloud because an app quit. Reopen ToolPiper, or start a new session, which runs normally because Quit takes the entries out of the file. If ToolPiper crashes or the Mac loses power, a small launchd agent does the same cleanup.
"command not found" for claude-tp
Earlier builds shipped a separate launcher called claude-tp. It is gone, along with the claude_code_install and claude_code_uninstall tools. A ~/.local/bin/claude-tp link left from one of those builds fails with a plain not-found and harms nothing, and rm ~/.local/bin/claude-tp clears it. ToolPiper revokes the old launcher's token and deletes its config by itself.
What about the tools?
The Models switch decides which model thinks. Tools decide what the agent can do: browser automation, screen capture, transcription, system control, scraping and the rest. They are two separate switches on the same row, and you can have either, both or neither.
The Tools switch runs Claude Code's own command for you. By hand it is:
claude mcp add -s user --transport http toolpiper http://127.0.0.1:9998/mcp-s user makes it work in every folder. Without it the server exists only in the folder you ran it in. A new session has the tools, and a session already open picks them up with /reload-plugins. The address is the IPv4 literal 127.0.0.1 and not localhost, because ToolPiper's listener is pinned to IPv4 loopback and macOS resolves the name to IPv6 first.
What this does not do
It does not route a Claude subscription through ToolPiper. While the switch is on, /model in a new session lists ToolPiper's models, and a new session on your Anthropic account means turning it off. Sessions already open stay on your account either way.
It also does not make every model the right one for every job. Long multi-file refactors and deep reasoning across a large context reward a larger model, local or cloud. The small local model is for the loop you run fifty times a day, for anything under NDA, and for the flight.
Try it
Download ToolPiper at modelpiper.com, choose a language model on Home, and turn on Models in the Claude Code row.
