Overview
OpenClaude is an open-source coding-agent CLI that talks to cloud and local model providers from a single terminal-first workflow — prompts, tools, agents, MCP, slash commands and streaming output stay the same whichever backend is behind them. Rather than picking a provider for you, it ships guided setup: run `/provider` inside the CLI and it walks you through configuration and saves a reusable profile.
The provider table is unusually wide. Any OpenAI-compatible `/v1` server works, which covers OpenAI, OpenRouter, DeepSeek, Groq, Mistral and LM Studio among others, and on top of that sit first-class routes for Gemini, GitHub Models (via an `/onboard-github` flow), Codex and Codex OAuth, Fireworks AI, Cloudflare Workers AI, Bedrock, Vertex and Foundry for the Anthropic family, a set of aggregator gateways, and local inference through Ollama or Atomic Chat with no API key at all.
The agent itself does the usual tool-driven work — bash, file read/write/edit, grep, glob, sub-agents, tasks, MCP and slash commands — with multi-step tool loops and streaming token output. Around that are conveniences worth knowing: conversations can be resumed by session id or forked into a new one, long prompts can run detached as background sessions you list, tail and kill, a PageRank-ranked repo map can be injected into context, `WebSearch` falls back to DuckDuckGo for non-Anthropic models (with Firecrawl as the supported alternative), and the whole thing can run headless as a gRPC service for CI pipelines or custom UIs. OpenClaude keeps its own config under `~/.openclaude` and deliberately does not read `~/.claude`, project `.claude/` directories or `CLAUDE_CONFIG_DIR`, so it does not require Claude Code to be installed.
What it does
- One CLI across OpenAI-compatible APIs, Gemini, GitHub Models, Codex/Codex OAuth, Fireworks, Cloudflare Workers AI, Bedrock/Vertex/Foundry, Ollama and more
- Guided provider setup and saved profiles through `/provider`, stored in `.openclaude-profile.json`
- Tool-driven coding workflows: bash, file read/write/edit, grep, glob, sub-agents, tasks, MCP and slash commands, with streaming output and multi-step tool loops
- Resume a conversation by session id or continue the most recent one in the directory, with `--fork-session` to branch history instead of reusing the transcript
- Background sessions as local child processes — `--bg` to start, `ps`, `logs -f` and `kill` to manage, with terminal outcomes recorded under the config directory
- Per-agent provider and model routing via `agentModels` / `agentRouting`, plus `maxSteps` caps on sub-agent tool steps
- A repo map ranked by PageRank importance that can be auto-injected into context and inspected with `/repomap`
- Headless gRPC server with bidirectional streaming for embedding the agent in other applications or CI/CD pipelines
Getting started
OpenClaude needs Node.js 22 or newer for npm installs and at runtime; Bun is only needed for source builds and local development. It does not automatically load project .env files — use `/provider`, or pass `--provider-env-file` explicitly.
Install
Arch Linux users can install from the community-maintained AUR package instead. If the install reports `ripgrep not found`, install ripgrep system-wide and confirm `rg --version` works in the same terminal first.
npm install -g @gitlawb/openclaude@latest
# Arch Linux
paru -S openclaudeStart it and pick a provider
Launch the CLI, then run the guided setup. `/onboard-github` is the interactive path for GitHub Models.
openclaude
# inside OpenClaude:
/provider # guided provider setup and saved profiles
/onboard-github # GitHub Models onboardingResume or fork a conversation
Forking branches the conversation history into a new session id. It is conversation branching only — it does not copy your working tree or create a git worktree.
openclaude --resume <session-id>
openclaude --continue
openclaude --resume <session-id> --fork-sessionRun something in the background
Background sessions are local child processes, not a daemon or network service; metadata and logs live under ~/.openclaude/bg-sessions/ unless OPENCLAUDE_CONFIG_DIR points elsewhere.
openclaude --bg "fix failing tests"
openclaude --bg --name auth-refactor "refactor auth middleware"
openclaude ps
openclaude logs auth-refactor -f
openclaude kill auth-refactorAdd a better web-fetch path (optional)
DuckDuckGo is the default free search path for non-Anthropic models but scrapes results and may be rate-limited or blocked. A Firecrawl key switches WebFetch to Firecrawl's scrape endpoint, which handles JavaScript-rendered pages.
export FIRECRAWL_API_KEY=your-key-hereOr run it headless
Starts the gRPC service; a test CLI client ships with the repository and clients can be generated from src/proto/openclaude.proto.
npm run dev:grpcCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Keep one coding-agent workflow while switching between a hosted API, an aggregator gateway and a local Ollama model
- Run a long refactor detached from your terminal and check on it with `ps` and `logs -f`
- Route cheap sub-agents to a small model and hard reasoning to a large one from a single settings file
- Embed an agentic coding loop into CI or a custom UI through the headless gRPC server
How OpenClaude compares
OpenClaude alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 208k | OpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app. |
| Claude Code | ★ 145k | Anthropic's agentic coding tool for the terminal, IDE and GitHub: it understands your codebase, executes routine tasks, explains code and handles git workflows from natural-language commands. |
| OpenAI Codex | ★ 125k | OpenAI's cloud and CLI coding agent that writes features, fixes bugs, and proposes code changes across a repo, running tasks in parallel. |
| Gemini CLI | ★ 107k | An open-source command-line AI agent from Google that connects your terminal to Gemini models for reading code, editing files, running shell commands, and searching the web. |
| Pi | ★ 106k | Minimal terminal coding agent harness with four built-in tools, extended through TypeScript extensions, skills and prompt templates instead of forks. |
| autoresearch | ★ 96.1k | Karpathy's minimal harness that hands a coding agent a single-GPU LLM training script and lets it run fixed five-minute experiments, keeping or discarding each change on its own. |
| OpenHands | ★ 88.2k | An open-source AI software-development agent that plans tasks, edits files, runs commands, and tests code, usable from a terminal CLI, a local web GUI, or a Python SDK. |
| OpenClaude | ★ 33.4k | One terminal coding agent across cloud APIs, gateways and local model backends |