gitclaw gives every LLM the same agentic power — bash, file editing, multi-step reasoning, MCP tools — with zero vendor lock-in. Claude runs natively. Everything else goes through the shim.
No accounts. No subscriptions. Claude, GPT, or Llama — same tools, same power.
Claude models use the Anthropic Messages API directly — zero translation overhead. Full streaming, all tools, native format passthrough.
GPT-4o, DeepSeek, Gemini, Llama, Mistral, Codex — they all get the same 14-tool system through the OpenAI shim.
Point at Ollama or LM Studio and run entirely on your hardware. No API key, no cloud, no telemetry.
Anthropic native for Claude. OpenAI Chat Completions for GPT/Llama. Codex Responses for GPT-5.4. Auto-detected from model name.
Token-by-token from every provider. Claude SSE events forwarded as-is. OpenAI SSE translated on the fly.
Goal-based model selection, provider profiles, runtime diagnostics. Pick the best model for latency, quality, or coding.
Claude goes native. OpenAI gets a shim. Codex gets its own path. The tool system doesn't know the difference.
Claude models pass through directly to /v1/messages. No format conversion. SSE events forwarded as-is.
Anthropic messages → OpenAI format. Tool calls → function calls. SSE translated on the fly. One file, zero deps.
Routes through ChatGPT's /responses endpoint. JWT auth, account ID, reasoning effort.
Auto-detected from model name — just set and go.
| Model | Tool Calling | Code Quality | Speed | Transport |
|---|---|---|---|---|
| Claude Opus 4.6 | Excellent | Excellent | Medium | Native |
| Claude Sonnet 4.6 | Excellent | Excellent | Fast | Native |
| GPT-4o | Excellent | Excellent | Fast | Shim |
| Claude Haiku 4.5 | Great | Great | Very Fast | Native |
| Codex (GPT-5.4) | Excellent | Excellent | Medium | Codex |
| DeepSeek-V3 | Great | Great | Fast | Shim |
| Gemini 2.0 Flash | Great | Good | Very Fast | Shim |
| Llama 3.3 70B | Good | Good | Medium | Shim |
| <7B models | Limited | Limited | Very Fast | Shim |
Every tool, every provider. Claude gets them natively — others through the shim.
Install once, switch providers with env vars. Claude auto-detects — no extra flags.
Everything you need to install, configure, and run gitclaw.
$ npm install -g @gitlawb/gitclaw
Requires Node.js 20 or newer. The CLI command is gitclaw.
$ git clone https://github.com/git-claw/gitclaw.git $ cd gitclaw $ bun install $ bun run build $ npm link # optional, makes gitclaw available globally
Use Bun 1.3.11 or newer. Older versions can fail with unresolved module errors.
$ git clone https://github.com/git-claw/gitclaw.git $ cd gitclaw && bun install $ bun run dev
$ gitclaw --version gitclaw v0.1.0
gitclaw uses env vars for provider configuration. Claude models auto-detect — no extra flags needed.
| Variable | Required | Description |
|---|---|---|
| CLAUDE_CODE_USE_OPENAI | Yes* | Set to 1 for OpenAI-compatible providers. Not needed for Claude. |
| OPENAI_API_KEY | Yes* | API key for OpenAI-compatible providers. Not needed for Claude or local. |
| OPENAI_MODEL | Yes | Model name. Also accepts Claude models like claude-sonnet-4-6. |
| OPENAI_BASE_URL | No | API endpoint. Defaults to https://api.openai.com/v1. |
| ANTHROPIC_API_KEY | Claude | Anthropic API key. Required when using any Claude model. |
| ANTHROPIC_MODEL | No | Alternative to OPENAI_MODEL for Claude models. |
| ANTHROPIC_BASE_URL | No | Custom Anthropic endpoint. Defaults to https://api.anthropic.com. |
| CODEX_API_KEY | Codex | Codex/ChatGPT access token for codexplan/codexspark. |
| CODEX_AUTH_JSON_PATH | Codex | Path to Codex CLI auth.json file. |
| CODEX_HOME | No | Alternative Codex home directory. |
| GITCLAW_USE_CLAUDE | No | Force Anthropic native transport even for non-claude model names. |
| GITCLAW_DISABLE_CO_AUTHORED_BY | No | Suppress Co-Authored-By trailer in git commits. |
Each provider has different env var requirements. Claude auto-detects from the model name — just set OPENAI_MODEL=claude-* and it routes to the native Anthropic API.
export ANTHROPIC_API_KEY=sk-ant-... export OPENAI_MODEL=claude-sonnet-4-6 $ gitclaw
Aliases: opus, sonnet, haiku, claude-opus, claude-sonnet, claude-haiku
Models: claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5-20251001
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_API_KEY=sk-... export OPENAI_MODEL=gpt-4o $ gitclaw
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_MODEL=codexplan export CODEX_API_KEY=... $ gitclaw
codexplan → GPT-5.4 (high reasoning)codexspark → GPT-5.3 (faster)
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_API_KEY=sk-... export OPENAI_BASE_URL=https://api.deepseek.com/v1 export OPENAI_MODEL=deepseek-chat
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_BASE_URL=http://localhost:11434/v1 export OPENAI_MODEL=llama3.3:70b
No API key needed. Run ollama serve first.
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_API_KEY=gsk_... export OPENAI_BASE_URL=https://api.groq.com/openai/v1 export OPENAI_MODEL=llama-3.3-70b-versatile
export CLAUDE_CODE_USE_OPENAI=1 export OPENAI_API_KEY=sk-or-... export OPENAI_BASE_URL=https://openrouter.ai/api/v1 export OPENAI_MODEL=google/gemini-2.0-flash
# Mistral OPENAI_BASE_URL=https://api.mistral.ai/v1 OPENAI_MODEL=mistral-large-latest # Together AI OPENAI_BASE_URL=https://api.together.xyz/v1 OPENAI_MODEL=meta-llama/Llama-3.3-70B-Instruct-Turbo # LM Studio (local) OPENAI_BASE_URL=http://localhost:1234/v1
All 14 tools work with every provider. Claude gets them natively — others through the OpenAI shim.
Execute shell commands. Supports streaming output, exit codes, timeouts, and working directory control.
Read file contents from disk. Handles text, binary detection, encoding, and large files with range support.
Create or overwrite files. Supports creating intermediate directories and setting file permissions.
Surgical file edits — find and replace, insert at line, delete ranges. Doesn't rewrite entire files.
Find files by pattern. Supports ** recursion, ignore files, and multiple patterns.
Search file contents with regex. Returns matching lines with context, supports case-insensitive and whole-word.
Fetch a URL and extract content. Handles HTML → markdown conversion, JSON, and plain text.
Search the web and return results with titles, URLs, and snippets.
Spawn a sub-agent that uses the same provider. Useful for parallel tasks, research, and divide-and-conquer.
Connect to Model Context Protocol servers. Access external tools, APIs, databases through the MCP standard.
Language Server Protocol integration. Code intelligence: go-to-definition, references, diagnostics, completions.
Edit Jupyter notebooks. Add/remove/modify cells, execute code, update outputs.
Create and manage tasks. Track progress, dependencies, and state across multi-step workflows.
Persistent memory across sessions. Store context, preferences, and project state that survives restarts.
Type these in the CLI prompt during a session.
| Command | Description |
|---|---|
| /commit | Generate a commit message from staged changes and commit |
| /review | Code review unstaged or staged changes with prioritized feedback |
| /diff | Show current diff with analysis |
| /compact | Compact conversation history to save context window |
| /doctor | Run runtime diagnostics inline |
| /clear | Clear conversation history |
Run these from your terminal with bun run.
| Script | Description |
|---|---|
| bun run dev | Build and launch gitclaw |
| bun run dev:profile | Launch from saved profile |
| bun run dev:claude | Launch with Claude preset |
| bun run dev:openai | Launch with OpenAI preset |
| bun run dev:ollama | Launch with Ollama preset |
| bun run dev:codex | Launch with Codex preset |
| bun run dev:deepseek | Launch with DeepSeek preset |
| bun run dev:groq | Launch with Groq preset |
| bun run dev:fast | Ollama fast preset (llama3.2:3b) |
| bun run dev:code | Ollama coding preset (qwen2.5-coder:7b) |
| bun run smoke | Build and verify startup |
| bun run doctor | Runtime diagnostics |
| bun run doctor:report | Save diagnostics to JSON |
| bun run hardening:check | Smoke + doctor combined |
| bun run hardening:strict | Typecheck + smoke + doctor |
Profiles save your provider config to .gitclaw-profile.json so you don't re-type env vars every session.
# Claude $ bun run profile:init -- --provider claude # OpenAI with explicit key $ bun run profile:init -- --provider openai --api-key sk-... --model gpt-4o # Ollama with goal-based model selection $ bun run profile:init -- --provider ollama --goal coding # Codex $ bun run profile:codex
# Preview recommendations with scores $ bun run profile:recommend -- --goal coding --benchmark # Auto-apply best available provider $ bun run profile:auto -- --goal latency
Goals: latency (fastest), balanced (default), coding (best code quality).
{
"provider": "claude",
"model": "claude-sonnet-4-6",
"baseUrl": "https://api.anthropic.com",
"createdAt": "2026-04-03T..."
}
The profile is gitignored by default — it may contain API keys.
The doctor command validates your setup before launch.
$ bun run doctor ◆ gitclaw doctor ✓ Node.js version: Node 22.22.0 ✓ Provider enabled: OpenAI-compatible provider enabled ✓ Model configured: claude-sonnet-4-6 (Anthropic native) ✓ API key: sk-ant-api0...Xk4f ✓ Base URL: Default ✓ Profile file: Profile: claude/claude-sonnet-4-6 ✓ Provider reachability: Reachable 6 pass, 0 warn, 0 fail
| Problem | Cause | Fix |
|---|---|---|
| Script not found "dev" | Wrong directory | cd to gitclaw project root |
| ollama: not recognized | Ollama not installed | Install from ollama.com |
| Provider reachability failed | Service not running | ollama serve for local, check API key for remote |
| Missing key for non-local | No API key configured | Set OPENAI_API_KEY or ANTHROPIC_API_KEY |
| Placeholder key error | Using example value | Replace with a real API key or switch to Ollama |
| API error 401 | Invalid API key | Verify key at provider's dashboard |
| API error 429 | Rate limited | Wait and retry, or switch to a different provider |
| Tool calls failing | Model doesn't support tools well | Switch to a model with strong tool support (GPT-4o, Claude, DeepSeek) |
| Slow responses | Large model on CPU | Run ollama ps — check PROCESSOR column. Use smaller model or GPU. |
| Build errors with Bun | Bun version too old | Update to Bun 1.3.11+ |
When something breaks, run these in order:
$ bun run doctor:runtime # check what's wrong $ bun run doctor:report # save diagnostic snapshot $ bun run smoke # verify build works
For Ollama issues specifically:
$ ollama --version # verify installed $ ollama serve # start server $ ollama ps # check loaded models $ bun run dev:ollama # relaunch
See how gitclaw handles real tasks. Pick a prompt, pick a provider — watch the agent work.
Fork it, modify it, run it on your own infra. Hosted on gitlawb's decentralized network.