cerebras-claude
v3.0.0
Published
Run Claude Code and Cerebras CLI with Cerebras-powered agents. One command setup with agent overrides, skill management, and auto-updates.
Maintainers
Readme
Cerebras Claude
Run Claude Code with Cerebras-powered agents. One command sets everything up — API keys, agent routing, skills.
Install
npm install -g cerebras-claudeThis gives you cerebras-claude, cclaude, and ccerebras globally.
Alternatively, run without installing:
npx cerebras-claudeRequirements
- Node.js 18+
- Claude Code CLI:
npm i -g @anthropic-ai/claude-code - Cerebras API key: cloud.cerebras.ai
Setup
The first time you run cerebras-claude, you'll walk through a guided setup:
╭──────────────────────────────────────────╮
│ Cerebras Claude — Setup Wizard │
╰──────────────────────────────────────────╯
✓ Node.js v22.0.0
✓ Claude Code (2.1.63)
? Which CLI do you use?
❯ Claude Code CLI
Cerebras CLI (OpenCode fork)
? Paste your Cerebras API key
▸ csk-...
? Which agents should route through Cerebras?
◯ Main agent (your direct interaction with Claude Code)
◉ Explore (fast codebase search, read-only, default: haiku)
◯ GeneralPurpose (multi-step tasks, all tools)
◯ Plan (research for planning, read-only)
? Install Cerebras team skills?
◉ Platform Console (console-debugging, ui-development, vercel-react)
◯ Cluster Testing
◯ Kernel
◯ Skip skill installation
✓ Config saved to ~/.cerebras-claude/config.jsonRe-run setup any time with cerebras-claude --setup.
Usage
cerebras-claudeWith no arguments, you get an interactive menu:
Cerebras Claude v3.0.0
Main, Explore, GeneralPurpose, Plan → Cerebras zai-glm-4.7
? What do you want to do?
▶ Launch Claude Code
▶ Launch Cerebras CLI
⚙ Configure agent overrides
⚓ Manage skills
ℹ View current config
↻ Re-run setup wizard
≡ Watch proxy logs
✕ QuitOr skip the menu with flags:
cerebras-claude --verbose # launch Claude Code directly
cerebras-claude --dangerously-skip-permissions
cerebras-claude -p "explain this code"
cerebras-claude --cerebras # launch Cerebras CLI instead
cerebras-claude --logs # tail proxy logs (run in second terminal)
cerebras-claude --setup # re-run setup wizard
cerebras-claude --menu # force the menu even with other argsAll unrecognized flags pass through to claude.
How it works
When you launch Claude Code through cerebras-claude:
- Reads config from
~/.cerebras-claude/config.json - Starts a local HTTP proxy on port 3456
- Launches
claudewithANTHROPIC_BASE_URL=http://127.0.0.1:3456 - The proxy inspects every request's system prompt to identify which agent is making the call (Main, Explore, subagents, etc.)
- Requests from configured agents → Cerebras (Anthropic-to-OpenAI format conversion)
- Everything else → Anthropic (transparent passthrough)
You ──> cerebras-claude ──> Claude Code
|
Proxy (:3456)
/ \
configured not configured
agent? or no match?
| |
Cerebras API Anthropic API
(Anthropic→OpenAI) (passthrough)Agent detection is based on system prompt patterns — the main agent contains "interactive agent that helps users", the explore agent contains "file search specialist", etc. The proxy never needs to modify Claude Code's internal agent system.
Agent overrides
Configure which agents route through Cerebras:
cerebras-claude config agentsInteractive picker with these options:
| Agent | What it does | Notes | |-------|-------------|-------| | Main | Your direct interaction with Claude Code | All 21 tools, thinking mode | | Explore | Codebase search, file discovery | Read-only, uses haiku by default | | GeneralPurpose | Multi-step tasks, research + edits | Spawned by Task tool | | Plan | Gather context for planning | Read-only |
View current config without changing:
cerebras-claude config agents --list ✓ Main → Cerebras
✓ Explore → Cerebras
✓ GeneralPurpose → Cerebras
✓ Plan → CerebrasSkills
Skills are markdown files that give agents domain-specific knowledge.
They install to ~/.claude/skills/ (Claude Code) or ~/.cerebras/skills/
(Cerebras CLI).
From the menu, select "Manage skills" to list, install, or uninstall interactively. Uninstalling shows a picker of all installed skills — no need to remember names.
Or use the CLI directly:
cerebras-claude skills list
cerebras-claude skills install console-debugging
cerebras-claude skills install --team platform-console
cerebras-claude skills uninstall kernel-debugging| Team | Skills | |------|--------| | platform-console | console-debugging, ui-development, api-integration, vercel-react | | cluster-testing | cluster-diagnostics, test-automation, performance-benchmarking | | kernel | kernel-debugging, driver-development, system-profiling |
Logs
Watch proxy traffic in real time:
cerebras-claude --logsEach request shows the route (CEREBRAS or ANTHROPIC), model, tool count, and a snippet of the system prompt so you can verify routing.
Log file: ~/.cerebras-claude.log
Config
View everything:
cerebras-claude config Current Configuration
──────────────────────────────────────────
CLI: claude-code
Cerebras model: zai-glm-4.7
API key: csk-c5ee...n8p9
Port: 3456
Agent overrides: Main, Explore, GeneralPurpose, Plan
Config file: ~/.cerebras-claude/config.jsonConfig lives at ~/.cerebras-claude/config.json. Edit it directly or
use cerebras-claude --setup to re-run the wizard.
Testing
npm testRuns automated checks covering:
- Config migration (old routing format → agentOverrides)
- Proxy routing (starts real proxy instances, sends requests with different system prompts, verifies correct CEREBRAS vs ANTHROPIC routing)
- CLI subcommands (config, skills, etc.)
Development
git clone https://github.com/your-org/kev-cc-proxy
cd kev-cc-proxy
npm install
npm link # makes `cerebras-claude` available globally