Claude CLI v2.1.154 Breaks Local vLLM — One-Line Patch Fixes It

Claude CLI v2.1.154 introduced support for workflows, but in doing so it added three new API message roles (ctx, msg, and system) that broke compatibility with local vLLM servers. The fix is a one-line change to vLLM's Anthropic protocol definitions.
The Problem
Claude CLI versions ≥2.1.154 now send messages with roles beyond user and assistant. vLLM's Anthropic API endpoint only accepted the original two roles, causing requests from the CLI to fail when pointing to a local vLLM instance.
The One-Line Patch
The patch updates the role field in vllm/entrypoints/anthropic/protocol.py to allow the new roles:
--- a/vllm/entrypoints/anthropic/protocol.py
+++ b/vllm/entrypoints/anthropic/protocol.py
@@ -65,7 +65,7 @@ class AnthropicContentBlock(BaseModel):
class AnthropicMessage(BaseModel):
"""Message structure"""
- role: Literal["user", "assistant"]
+ role: Literal["user", "assistant", "ctx", "msg", "system"]That's it. After applying this change, you can use the latest Claude CLI workflows with vLLM-based local models like MiniMax-M2.7 (the only model tested by the author).
If you run a local Anthropic-compatible endpoint on vLLM, apply this patch to keep working with Claude CLI ≥2.1.154.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Claude Code Agents Don't Automatically Read Project Documentation
When Claude Code dispatches subagents like Sonnet to write code, those agents only see what's explicitly included in their prompt and don't automatically read CLAUDE.md, MEMORY.md, or other project context files unless specifically instructed to do so.
Slash Agent Start-Up Tokens by 60%: Clean Up Your Bot's Workspace
One developer dropped start-up tokens from 80k to 31k by having an LLM audit and restructure workspace files—removing bloat, deduplicating info, and organizing tool docs into separate files.

How to Disable Claude Code's 1M Context Window to Reduce Token Usage
Anthropic users can disable the 1M context window in Claude Code by adding environment variables to settings.json, which may reduce unexpected token consumption. The source provides two configuration options: completely disabling 1M context or capping the auto-compact window.

Routing Agent Subtasks to Cheaper Models Dropped Cost from $18 to $4 on Same Refactor
A developer cut agent run costs from $18 to $4 by routing routine subtasks (lint, rename, config edits) to cheap models like DeepSeek V4 Pro and Tencent Hunyuan Hy3, reserving Opus 4.7 for complex reasoning.