🌱 Welcome to Factnetize — honest, well-researched articles on tech, health and AI. Read more →
AI

Connect Hermes to Claude Code: use Claude with no API key

Already have Claude Code installed? Have Hermes call it directly and use Claude with no API key — just your existing subscription. Works on Pro, uses print mode, handles the Windows gotcha.

Connect Hermes to Claude Code: use Claude with no API key

⚡ Key takeaways

  • If Claude Code is installed on your machine, Hermes can use Claude by calling that CLI directly — no API key, no OAuth, no browser login.
  • It works on a plain Claude Pro plan, because Hermes drives the already-signed-in claude command rather than the Max-only OAuth route.
  • Print mode (claude -p) is the robust default on Windows; a full interactive terminal is the backup for tasks print mode blocks.
  • Once it works, the reliable approach gets saved as a skill — including the real Windows gotcha we hit along the way.

Here’s something people often get wrong: they say you can’t use your Claude subscription inside another agent without a separate API key. You can — if Claude Code is already installed. Hermes doesn’t need a key or an OAuth handshake; it simply calls the claude command that’s already on your machine and already signed in to your plan. This article shows how that actually works, the Windows pitfall that trips up the first attempt, and how the working approach becomes a reusable skill.

It’s not magic — it’s a CLI

Claude Code is, at its core, a terminal application. You send it text on standard input, it prints its answer on standard output. That’s exactly what a chat does. So when Hermes “talks to Claude,” it isn’t authenticating against an API endpoint — it’s running the local claude command and reading what comes back, the same way it runs any other terminal tool.

That single fact is the whole trick. Because the claude command on your machine is already logged in to your Claude subscription, Hermes inherits that access for free. No API key to generate, no second bill, no OAuth provider to configure — and crucially, no need for a Claude Max plan. The Max-only OAuth route that some guides describe is a different mechanism entirely; this one works on plain Claude Pro because it leans on the CLI, not on Anthropic’s subscription-OAuth path.

Prerequisites

  • Hermes Agent installed and running. If you’re not there yet, start with the Windows 11 install guide.
  • Claude Code installed and signed in. Open a terminal and run claude — if it starts and is logged in to your plan, you’re ready. This is the one hard requirement: Hermes can only call the command if it’s actually there.
  • An active Claude subscription. Pro is enough. The point of this method is that Hermes uses the access Claude Code already has.

Claude Code has an official headless mode, and it’s the cleanest way for Hermes to use it. In print mode, you pass the task as an argument, Claude runs it without any interactive screen, prints the result, and exits:

claude --model opus -p "Fix the auth bug in src/auth.py" --allowedTools "Read,Edit" --max-turns 10

No interactive screen, no dialogs, no keyboard needed — which is exactly why it’s the robust default on Windows. You choose the model right there with --model (Opus for heavy reasoning, a lighter Claude for routine work). And print mode is still multi-turn when you need it: --continue or --resume <session_id> picks the conversation back up in the same session, without a live interactive screen.

In practice you don’t type this yourself. You ask Hermes, in plain chat, to run a task on your local Claude Code with the model you want — and Hermes builds and runs the command for you. The result comes back into your Hermes conversation like any other tool output.

The Windows gotcha: –add-dir in print mode

This is the part the tutorials skip, and it’s exactly where the first real attempt went sideways. When Claude Code needs to write files outside its current directory, the obvious move is to grant access with --add-dir. On Windows, in print mode, that flag is unreliable — Claude runs, reports success, and writes nothing, because the write permission never actually took.

The trap is the retry instinct: you see no files written, so you run it again with the same --add-dir flag — and get the same silent non-result. The rule that came out of this: don’t retry with the same flag. When print mode blocks a write, the fix isn’t another --add-dir attempt; it’s either applying the change through a different tool, or switching to interactive mode (below) for the write step. This exact lesson — the failure and the workaround order — is what makes the connection reliable the second time around.

Interactive mode: the backup path

When print mode can’t do what you need — typically writing files it won’t permit — Hermes has a second, heavier way to drive Claude Code: a real interactive terminal.

Hermes’ terminal tool can start a PTY (pseudo-terminal) — a fake terminal that behaves exactly as if a human were sitting at it. Inside it, Hermes launches claude.exe as a normal process, waits for the prompt, and sends its messages the way a person would type them. Claude’s answers and tool output come back on standard output, and Hermes reads them. The trust and permission dialogs that Claude Code shows on first launch get dismissed by sending Enter, or Down then Enter — again, just as a human would.

This path is more involved, so it’s the backup, not the default. Reach for it when a task genuinely needs the interactive session; stay in print mode for everything else.

Why people think this “can’t be done”

The “you need an API key” belief comes from an older reality. For a long time, claude was only an interactive TUI — a full-screen terminal app that requires a real terminal to run. Without a PTY, you can’t talk to it: a script that just pipes text into standard input crashes or hangs. On Windows this is worse, because a bare newline doesn’t register as Enter the way the app expects.

So people try the obvious shortcut — something like echo "my question" | claude, or a subprocess call with no PTY — it doesn’t work, and they conclude it can’t be done. But it can: Claude Code has an official headless -p mode, and Hermes can emulate a real terminal when the interactive path is needed. The “talking” is just text over standard input and output, like any other CLI. No workaround, no hack — two supported paths, used for what each is good at.

Saving it as a skill

Once the connection works, you want it to stay working — without rediscovering the same gotcha next time. That’s what skills are for. A skill in Hermes is a saved, reusable procedure the agent can follow again on its own.

You can ask Hermes to save the working approach as a skill once a task succeeds. In practice, Hermes often does this itself as a learning step: after the --add-dir failure and the workaround, it recorded exactly that — “this flag is unreliable in print mode on Windows; don’t retry with it” — into a skill, so the next session starts already knowing the reliable path. Either way, the outcome is the same: the hard-won detail becomes permanent, and calling Claude Code through Hermes just works from then on.

This is also a first look at how skills work more broadly, which the series returns to later. The pattern to notice is that anything you get working once — including the mistakes you learned from — can be preserved as a skill.

Frequently asked questions

Do I need Claude Max for this, or does Pro work?

Pro works. This method calls the local claude command, which is already signed in to your subscription — it does not use Anthropic’s subscription-OAuth route, which is the one that requires Max plus extra usage credits. If you have Claude Code installed and logged in on Pro, you’re set.

Do I need an Anthropic API key?

No. That’s the whole point. Hermes drives the Claude Code CLI that’s already authenticated on your machine, so there’s no separate key and no extra bill.

Why did my first file-writing task produce nothing?

Almost certainly the --add-dir gotcha: in print mode on Windows, that flag can report success while writing nothing. Don’t retry with the same flag — apply the change through another tool, or switch to interactive mode for the write step.

What if I don’t have Claude Code installed?

Then this method has nothing to call. You’d instead reach Claude through an API-key provider — the Command Code route gives you Claude alongside many other models under one key.

What’s next

You’ve given Hermes top-tier Claude access with no API key and no Max plan — by having it call the Claude Code CLI you already have, in the mode that’s robust on Windows, with the one real gotcha handled. And by saving the working approach as a skill, it stays reliable session after session.

Next up: the agent can now think with the right model for each job. But it still starts every session blind — no memory of who you are or how you like to work. The next article shows how persistent memory changes that, and what the two decisions are that are actually yours to make. This article is part of the Agentic AI series.

John Lock
Written by

John Lock

Liked this? There's more where it came from.

Get our digest — articles worth your time, no spam, unsubscribe in one click.

Subscribe to Factnetize →

Leave a comment

Your email address will not be published. Required fields are marked *

Weekly · No spam

Get smarter,
one Sunday at a time.

Join our weekly digest — the articles worth your time, plus one thing that made us think differently.