Claude Opus 5.5 prompting tips from Anthropic's own guide
Practical prompting tips for Claude Opus 5.5, taken from Anthropic's guide: old habits to drop, the new effort default, agents that stop early, lines to copy.
At a glancePoint Claude Code at a model you host with vLLM: the six settings, what Claude Code really sends, what stops working, and what Anthropic does not support.
Partly testedClaude Code was run against a stand-in server to record what it sends. No model was served: there was no GPU.
Claude Code is the terminal coding agent from Anthropic. vLLM is the open-source server for running models on your own GPUs. vLLM can speak the same API that Claude Code uses, so the two can be connected: the agent's interface, with a model on hardware you control. This guide shows how, what Claude Code actually sends to your server, and where the combination falls short. One thing first, because it decides whether you should do this at all.
| A good reason | A poor reason |
|---|---|
| The code may not leave your network | "It will be as good, for free." It will not be as good, and GPUs are not free |
| You already run a GPU server and want one more use for it | You have no GPU server yet. Start with the sizing guide |
| You want to see how an open model handles agent work | You need the web search and other tools that run on Anthropic's side |
/v1/messages and translates itThe last box is the demanding one. A coding agent works by calling tools: read a file, edit it, run a command. vLLM's page says the model needs "strong tool calling capabilities". A model that chats well and calls tools badly will read your request and then do nothing useful.
Start the server with tool calling switched on. This is vLLM's own example:
vllm serve openai/gpt-oss-120b --served-model-name my-model --enable-auto-tool-choice --tool-call-parser openai
| Flag | Why it is there |
|---|---|
--served-model-name my-model | A short name with no slash. vLLM's page warns that model names containing /, such as the Hugging Face name itself, cannot be used with Claude Code |
--enable-auto-tool-choice | Lets the model decide when to call a tool |
--tool-call-parser openai | How this model writes its tool calls. Other models need a different parser; vLLM's tool calling page lists them. For Qwen, see part 3 of our series |
Start Claude Code with six settings:
ANTHROPIC_BASE_URL=http://localhost:8000 \
ANTHROPIC_API_KEY=dummy \
ANTHROPIC_AUTH_TOKEN=dummy \
ANTHROPIC_DEFAULT_OPUS_MODEL=my-model \
ANTHROPIC_DEFAULT_SONNET_MODEL=my-model \
ANTHROPIC_DEFAULT_HAIKU_MODEL=my-model \
claude
| Setting | What it does |
|---|---|
ANTHROPIC_BASE_URL | Where requests go. No /v1 at the end; Claude Code adds the path |
ANTHROPIC_API_KEY | Any value, because vLLM asks for no key by default |
ANTHROPIC_AUTH_TOKEN | vLLM's page says it is required and can be any value. If you started vLLM with --api-key, set both this and the line above to that key |
The three …_MODEL settings | Claude Code asks for different models for different jobs. All three must point at the one name your server knows |
On Windows PowerShell, set each one first and then start Claude Code:
$env:ANTHROPIC_BASE_URL = "http://localhost:8000"
$env:ANTHROPIC_API_KEY = "dummy"
$env:ANTHROPIC_AUTH_TOKEN = "dummy"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "my-model"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "my-model"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "my-model"
claude
To keep the settings, vLLM's page suggests your shell profile, a small wrapper script, or the env section of ~/.claude/settings.json. A wrapper script is the safest of the three: your normal claude command keeps talking to Anthropic, and a second command, say claude-local, talks to your server.
We had no GPU for this article, so we tested the half that needs none. This small program pretends to be a model server: it records what arrives and replies with one fixed sentence. Save it as stand_in.py if you want to repeat the test:
"""stand_in.py: a stand-in for a model server. It records what a client asks for and streams back one fixed sentence.
It speaks just enough of the Anthropic Messages API to answer Claude Code. It is not a model.
"""
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
REPLY = "Hello from your own server."
class StandIn(BaseHTTPRequestHandler):
def do_POST(self):
raw = self.rfile.read(int(self.headers.get("Content-Length", 0)))
body = json.loads(raw or b"{}")
print(json.dumps({"path": self.path.split("?")[0], "bytes": len(raw), "model": body.get("model"), "stream": body.get("stream"),
"max_tokens": body.get("max_tokens"), "tools": len(body.get("tools", [])),
"system_chars": len(json.dumps(body.get("system", ""))),
"auth": sorted(h for h in ("authorization", "x-api-key") if self.headers.get(h))}), flush=True)
if self.path.startswith("/v1/messages/count_tokens"):
return self.send_json({"input_tokens": 10})
if not body.get("stream"):
return self.send_json({"id": "msg_1", "type": "message", "role": "assistant", "model": body.get("model"),
"content": [{"type": "text", "text": REPLY}], "stop_reason": "end_turn",
"stop_sequence": None, "usage": {"input_tokens": 10, "output_tokens": 6}})
self.send_response(200)
self.send_header("Content-Type", "text/event-stream")
self.end_headers()
events = [
("message_start", {"type": "message_start", "message": {"id": "msg_1", "type": "message", "role": "assistant", "model": body.get("model"), "content": [], "stop_reason": None, "stop_sequence": None, "usage": {"input_tokens": 10, "output_tokens": 0}}}),
("content_block_start", {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}),
("content_block_delta", {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": REPLY}}),
("content_block_stop", {"type": "content_block_stop", "index": 0}),
("message_delta", {"type": "message_delta", "delta": {"stop_reason": "end_turn", "stop_sequence": None}, "usage": {"output_tokens": 6}}),
("message_stop", {"type": "message_stop"}),
]
for name, data in events:
self.wfile.write(f"event: {name}\ndata: {json.dumps(data)}\n\n".encode())
self.wfile.flush()
def send_json(self, data):
payload = json.dumps(data).encode()
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(payload)))
self.end_headers()
self.wfile.write(payload)
def log_message(self, *args):
pass
HTTPServer(("127.0.0.1", 8000), StandIn).serve_forever()
With it running, we started Claude Code 2.1.322 with the six settings and one short question:
$ ANTHROPIC_BASE_URL=http://127.0.0.1:8000 ANTHROPIC_API_KEY=dummy ANTHROPIC_AUTH_TOKEN=dummy ANTHROPIC_DEFAULT_OPUS_MODEL=my-model ANTHROPIC_DEFAULT_SONNET_MODEL=my-model ANTHROPIC_DEFAULT_HAIKU_MODEL=my-model claude -p "Say hello"
[claude-code:unrecognized_model] {"model":"my-model[1m]","query_source":"sdk"}
Hello from your own server.
And this is what the stand-in recorded:
{"path": "/v1/messages", "bytes": 46224, "model": "my-model", "stream": true, "max_tokens": 32000, "tools": 12, "system_chars": 6132, "auth": ["authorization", "x-api-key"]}
| What was recorded | What it means for your server |
|---|---|
"model": "my-model" | The three model settings work. Your server must be serving exactly this name |
"bytes": 46224, "tools": 12 | "Say hello" arrived wrapped in about 46 KB of instructions and twelve tool definitions. At a rough four characters per token, that is on the order of 11,000 tokens before Claude Code has read a single file of yours. That figure is our estimate |
"max_tokens": 32000 | Claude Code asked for room to write up to 32,000 tokens |
"stream": true | Replies are streamed. Any proxy in front of vLLM must not buffer them; the nginx settings in part 5 cover this |
Both authorization and x-api-key | The token and the key each travel in their own header. In a second run without ANTHROPIC_AUTH_TOKEN, only x-api-key was sent and the request still arrived. Set both, as vLLM's page says |
--max-model-len will not be enough. Size the context first; part 6 shows what each extra token of context costs in GPU memory.You can lower the output allowance. With CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096 added, the stand-in recorded "max_tokens": 4096. That setting is in Claude Code's list of environment variables.
| Symptom | Cause, from vLLM's page | What to do |
|---|---|---|
| Web search fails with "tool type 'web_search_…' is not supported" | Claude Code's web search runs on Anthropic's servers. vLLM does not run such tools and rejects the request | Add an MCP server that provides search. See adding MCP servers |
| The model answers but never edits or runs anything | Tool calling is off, or the parser does not match the model | Check --enable-auto-tool-choice and the --tool-call-parser for your model |
| "Model not found" | The name in the settings is not the served name, or it contains a / | Use --served-model-name and the same short name in all three settings |
| Everything is slow, and each request seems to start from nothing | Claude Code adds a per-request fingerprint to the start of its instructions, which defeats vLLM's prefix cache. vLLM handles this in versions after 0.17.1 | Upgrade vLLM, or on an older version add "CLAUDE_CODE_ATTRIBUTION_HEADER": "0" to the env section of ~/.claude/settings.json |
A request with max_tokens: 0 is refused | Anthropic's API accepts that to warm its cache; vLLM always produces at least one token | Nothing, for normal use. A tool that sends it should send 1 |
| "Connection refused" | vLLM is not running, or the port is different | Check the server and the address |
Beyond that list, expect differences that no setting fixes. Claude Code's features were built around Claude models, and some will behave differently, or not at all, with another model behind the same interface.
We did not serve a model, so we have no results of our own to report, and we will not borrow anyone else's. What can be said from how the pieces work:
The fair test is a task you know well. Give the same small job, in the same repository, to Claude Code on its normal model and on your server. Compare what was done, how many steps it took and how long you waited.
| Your situation | Suggestion |
|---|---|
| Code must stay inside your network, and you have GPUs | Worth trying. Go in knowing it is unsupported |
| You want the best results on hard tasks | Use Claude Code as intended |
| You are curious and already run vLLM | An afternoon well spent. Use a wrapper script so your normal setup is untouched |
| You have no server yet | Build one first: the vLLM series starts from one command |
| You only want a model on your own machine to chat with | This is more than you need. See vLLM, Ollama or llama.cpp |
If you do run it for a team, the rest of the series applies unchanged: keys and a proxy, dashboards and alerts.
This article reflects public information available when it was written. Versions, defaults and prices can change; check the linked official documentation.
The vLLM commands, settings and limits are from vLLM's own page on Claude Code, read on November 12, 2026; no GPU was available, so no model was served for this article. The Claude Code side was tested: Claude Code 2.1.322 was run with those settings against a small stand-in server on Linux, and the request details in section 4 are what that server recorded. That test shows what Claude Code sends, not how well any model answers. Anthropic's position on non-Claude models is quoted from its gateway documentation. The token estimate is ours and is marked as an estimate. The Windows commands follow the same documentation and were not run. Written for this site with AI assistance, from the sources above. For errors or additional information, please request a correction. Editorial policy
Found this useful? Share it, or follow for new guides.