v0.1.0 · open source · 12 providers · claude native

run any LLM
as a code agent.

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.

terminal
$ export ANTHROPIC_API_KEY=sk-ant-...
$ export OPENAI_MODEL=claude-sonnet-4-6
$ gitclaw

▶ provider: anthropic (native — zero translation)
▶ model: claude-sonnet-4-6
▶ tools: 14 loaded (bash, file, grep, mcp...)
▶ streaming: SSE passthrough

✓ gitclaw is running.
>
14
built-in tools
12
providers
3
transports
0
lock-in
claude nativeopenai shimcodex backendbash toolfile opsmulti-stepmcp serverstreamingsub-agentsollamadeepseekgeminizero translationpersistent memorylsp claude nativeopenai shimcodex backendbash toolfile opsmulti-stepmcp serverstreamingsub-agentsollamadeepseekgeminizero translationpersistent memorylsp

built for freedom.

No accounts. No subscriptions. Claude, GPT, or Llama — same tools, same power.

01

Native Claude support.

Claude models use the Anthropic Messages API directly — zero translation overhead. Full streaming, all tools, native format passthrough.

02

Any model, same tools.

GPT-4o, DeepSeek, Gemini, Llama, Mistral, Codex — they all get the same 14-tool system through the OpenAI shim.

03

Run locally, free.

Point at Ollama or LM Studio and run entirely on your hardware. No API key, no cloud, no telemetry.

04

Three transports.

Anthropic native for Claude. OpenAI Chat Completions for GPT/Llama. Codex Responses for GPT-5.4. Auto-detected from model name.

05

Real-time streaming.

Token-by-token from every provider. Claude SSE events forwarded as-is. OpenAI SSE translated on the fly.

06

Smart routing.

Goal-based model selection, provider profiles, runtime diagnostics. Pick the best model for latency, quality, or coding.

three transports.

Claude goes native. OpenAI gets a shim. Codex gets its own path. The tool system doesn't know the difference.

ANTHROPIC NATIVE

Zero translation

Claude models pass through directly to /v1/messages. No format conversion. SSE events forwarded as-is.

claude-opus-4-6
claude-sonnet-4-6
claude-haiku-4-5
OPENAI SHIM

Format translation

Anthropic messages → OpenAI format. Tool calls → function calls. SSE translated on the fly. One file, zero deps.

GPT-4o, DeepSeek, Gemini
Llama, Mistral, Ollama
+ any compatible API
CODEX RESPONSES

Codex backend

Routes through ChatGPT's /responses endpoint. JWT auth, account ID, reasoning effort.

codexplan → GPT-5.4
codexspark → GPT-5.3

plug in anything.

Auto-detected from model name — just set and go.

OpenAI
GPT-4o, GPT-4o-mini
Codex
GPT-5.4 / GPT-5.3
DeepSeek
DeepSeek-V3
Gemini
via OpenRouter
Ollama
local, free
LM Studio
local GUI
Together AI
Llama, Mixtral
Groq
ultra-fast inference
Mistral
Mistral Large
Azure
Azure OpenAI
OpenRouter
any model

Model quality guide

ModelTool CallingCode QualitySpeedTransport
Claude Opus 4.6ExcellentExcellentMediumNative
Claude Sonnet 4.6ExcellentExcellentFastNative
GPT-4oExcellentExcellentFastShim
Claude Haiku 4.5GreatGreatVery FastNative
Codex (GPT-5.4)ExcellentExcellentMediumCodex
DeepSeek-V3GreatGreatFastShim
Gemini 2.0 FlashGreatGoodVery FastShim
Llama 3.3 70BGoodGoodMediumShim
<7B modelsLimitedLimitedVery FastShim

everything works.

Every tool, every provider. Claude gets them natively — others through the shim.

Bash
FileRead
FileWrite
FileEdit
Glob
Grep
WebFetch
WebSearch
Agent
MCP
LSP
NotebookEdit
Tasks
Memory

pick your model. go.

Install once, switch providers with env vars. Claude auto-detects — no extra flags.

$ npm install -g @gitlawb/gitclaw
claude# native Anthropic — zero translation
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_MODEL=claude-sonnet-4-6

$ gitclaw

# aliases: opus, sonnet, haiku
openaiexport CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-4o

$ gitclaw
ollama (free)export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_MODEL=llama3.3:70b

$ gitclaw
deepseekexport CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.deepseek.com/v1
export OPENAI_MODEL=deepseek-chat

$ gitclaw
codex# GPT-5.4 via ChatGPT backend
export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_MODEL=codexplan
export CODEX_API_KEY=...

$ gitclaw

the full reference.

Everything you need to install, configure, and run gitclaw.

Installation

Option A — npm (recommended)

$ npm install -g @gitlawb/gitclaw

Requires Node.js 20 or newer. The CLI command is gitclaw.

Option B — from source (requires Bun)

$ 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.

Option C — run directly (no build)

$ git clone https://github.com/git-claw/gitclaw.git
$ cd gitclaw && bun install
$ bun run dev

Verify installation

$ gitclaw --version
gitclaw v0.1.0

Environment Variables

gitclaw uses env vars for provider configuration. Claude models auto-detect — no extra flags needed.

VariableRequiredDescription
CLAUDE_CODE_USE_OPENAIYes*Set to 1 for OpenAI-compatible providers. Not needed for Claude.
OPENAI_API_KEYYes*API key for OpenAI-compatible providers. Not needed for Claude or local.
OPENAI_MODELYesModel name. Also accepts Claude models like claude-sonnet-4-6.
OPENAI_BASE_URLNoAPI endpoint. Defaults to https://api.openai.com/v1.
ANTHROPIC_API_KEYClaudeAnthropic API key. Required when using any Claude model.
ANTHROPIC_MODELNoAlternative to OPENAI_MODEL for Claude models.
ANTHROPIC_BASE_URLNoCustom Anthropic endpoint. Defaults to https://api.anthropic.com.
CODEX_API_KEYCodexCodex/ChatGPT access token for codexplan/codexspark.
CODEX_AUTH_JSON_PATHCodexPath to Codex CLI auth.json file.
CODEX_HOMENoAlternative Codex home directory.
GITCLAW_USE_CLAUDENoForce Anthropic native transport even for non-claude model names.
GITCLAW_DISABLE_CO_AUTHORED_BYNoSuppress Co-Authored-By trailer in git commits.

Provider Configuration

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.

Claude (Anthropic native)

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

OpenAI

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-4o
$ gitclaw

Codex (ChatGPT backend)

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)

DeepSeek

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

Ollama (local, free)

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.

Groq

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

Gemini (via OpenRouter)

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 / Together / Azure / LM Studio

# 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

Tools Reference

All 14 tools work with every provider. Claude gets them natively — others through the OpenAI shim.

Bash

Execute shell commands. Supports streaming output, exit codes, timeouts, and working directory control.

FileRead

Read file contents from disk. Handles text, binary detection, encoding, and large files with range support.

FileWrite

Create or overwrite files. Supports creating intermediate directories and setting file permissions.

FileEdit

Surgical file edits — find and replace, insert at line, delete ranges. Doesn't rewrite entire files.

Glob

Find files by pattern. Supports ** recursion, ignore files, and multiple patterns.

Grep

Search file contents with regex. Returns matching lines with context, supports case-insensitive and whole-word.

WebFetch

Fetch a URL and extract content. Handles HTML → markdown conversion, JSON, and plain text.

WebSearch

Search the web and return results with titles, URLs, and snippets.

Agent (sub-agents)

Spawn a sub-agent that uses the same provider. Useful for parallel tasks, research, and divide-and-conquer.

MCP

Connect to Model Context Protocol servers. Access external tools, APIs, databases through the MCP standard.

LSP

Language Server Protocol integration. Code intelligence: go-to-definition, references, diagnostics, completions.

NotebookEdit

Edit Jupyter notebooks. Add/remove/modify cells, execute code, update outputs.

Tasks

Create and manage tasks. Track progress, dependencies, and state across multi-step workflows.

Memory

Persistent memory across sessions. Store context, preferences, and project state that survives restarts.

Slash Commands

Type these in the CLI prompt during a session.

CommandDescription
/commitGenerate a commit message from staged changes and commit
/reviewCode review unstaged or staged changes with prioritized feedback
/diffShow current diff with analysis
/compactCompact conversation history to save context window
/doctorRun runtime diagnostics inline
/clearClear conversation history

CLI Scripts

Run these from your terminal with bun run.

ScriptDescription
bun run devBuild and launch gitclaw
bun run dev:profileLaunch from saved profile
bun run dev:claudeLaunch with Claude preset
bun run dev:openaiLaunch with OpenAI preset
bun run dev:ollamaLaunch with Ollama preset
bun run dev:codexLaunch with Codex preset
bun run dev:deepseekLaunch with DeepSeek preset
bun run dev:groqLaunch with Groq preset
bun run dev:fastOllama fast preset (llama3.2:3b)
bun run dev:codeOllama coding preset (qwen2.5-coder:7b)
bun run smokeBuild and verify startup
bun run doctorRuntime diagnostics
bun run doctor:reportSave diagnostics to JSON
bun run hardening:checkSmoke + doctor combined
bun run hardening:strictTypecheck + smoke + doctor

Provider Profiles

Profiles save your provider config to .gitclaw-profile.json so you don't re-type env vars every session.

Create a profile

# 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

Goal-based auto-selection

# 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).

Profile file format

{
  "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.

Runtime Diagnostics

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

Troubleshooting

ProblemCauseFix
Script not found "dev"Wrong directorycd to gitclaw project root
ollama: not recognizedOllama not installedInstall from ollama.com
Provider reachability failedService not runningollama serve for local, check API key for remote
Missing key for non-localNo API key configuredSet OPENAI_API_KEY or ANTHROPIC_API_KEY
Placeholder key errorUsing example valueReplace with a real API key or switch to Ollama
API error 401Invalid API keyVerify key at provider's dashboard
API error 429Rate limitedWait and retry, or switch to a different provider
Tool calls failingModel doesn't support tools wellSwitch to a model with strong tool support (GPT-4o, Claude, DeepSeek)
Slow responsesLarge model on CPURun ollama ps — check PROCESSOR column. Use smaller model or GPU.
Build errors with BunBun version too oldUpdate to Bun 1.3.11+

Quick Recovery

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

the playground.

See how gitclaw handles real tasks. Pick a prompt, pick a provider — watch the agent work.

prompts
Build a landing page
Deploy to production
Add Stripe payments
Setup auth with JWT
Build a CLI tool
Create a Discord bot
Scaffold a SaaS API
Fix prod incident
Migrate DB schema
gitclaw playground claude-sonnet-4-6

your models.
your rules.

Fork it, modify it, run it on your own infra. Hosted on gitlawb's decentralized network.