{"id":47955660,"url":"https://github.com/hatixntsoa/openclaude","last_synced_at":"2026-04-07T12:00:31.877Z","repository":{"id":348594905,"uuid":"1197751858","full_name":"hatixntsoa/openclaude","owner":"hatixntsoa","description":"OpenSource Version Of Claude Code (mirrored)","archived":false,"fork":false,"pushed_at":"2026-04-01T21:00:37.000Z","size":9877,"stargazers_count":23,"open_issues_count":0,"forks_count":28,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-06T11:03:01.763Z","etag":null,"topics":["ai-agents","claude-code","educational-purposes"],"latest_commit_sha":null,"homepage":"https://gitlawb.com/node/repos/z6MkqDnb/openclaude","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hatixntsoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T21:17:25.000Z","updated_at":"2026-04-05T13:39:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hatixntsoa/openclaude","commit_stats":null,"previous_names":["hatixntsoa/openclaude"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hatixntsoa/openclaude","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatixntsoa%2Fopenclaude","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatixntsoa%2Fopenclaude/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatixntsoa%2Fopenclaude/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatixntsoa%2Fopenclaude/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hatixntsoa","download_url":"https://codeload.github.com/hatixntsoa/openclaude/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatixntsoa%2Fopenclaude/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31511784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","claude-code","educational-purposes"],"created_at":"2026-04-04T09:31:52.492Z","updated_at":"2026-04-07T12:00:31.855Z","avatar_url":"https://github.com/hatixntsoa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenClaude\n\nUse Claude Code with **any LLM** — not just Claude.\n\nOpenClaude is a fork of the [Claude Code source leak](https://gitlawb.com/node/repos/z6MkgKkb/instructkr-claude-code) (exposed via npm source maps on March 31, 2026). We added an OpenAI-compatible provider shim so you can plug in GPT-4o, DeepSeek, Gemini, Llama, Mistral, or any model that speaks the OpenAI chat completions API.\n\nAll of Claude Code's tools work — bash, file read/write/edit, grep, glob, agents, tasks, MCP — just powered by whatever model you choose.\n\n---\n\n## Install\n\n### Option A: npm (recommended)\n\n```bash\nnpm install -g openclaude\n```\n\n### Option B: From source (requires Bun)\n\n```bash\n# Clone from gitlawb\ngit clone https://github.com/hatixntsoa/openclaude.git\ncd openclaude\n\n# Install dependencies\nbun install\n\n# Build\nbun run build\n\n# Link globally (optional)\nnpm link\n```\n\n### Option C: Run directly with Bun (no build step)\n\n```bash\ngit clone https://github.com/hatixntsoa/openclaude.git\ncd openclaude\nbun install\nbun run dev\n```\n\n---\n\n## Quick Start\n\n### 1. Set 3 environment variables\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=sk-your-key-here\nexport OPENAI_MODEL=gpt-4o\n```\n\n### 2. Run it\n\n```bash\n# If installed via npm\nopenclaude\n\n# If built from source\nbun run dev\n# or after build:\nnode dist/cli.mjs\n```\n\nThat's it. The tool system, streaming, file editing, multi-step reasoning — everything works through the model you picked.\n\n---\n\n## Provider Examples\n\n### OpenAI\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=sk-...\nexport OPENAI_MODEL=gpt-4o\n```\n\n### DeepSeek\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=sk-...\nexport OPENAI_BASE_URL=https://api.deepseek.com/v1\nexport OPENAI_MODEL=deepseek-chat\n```\n\n### Google Gemini (via OpenRouter)\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=sk-or-...\nexport OPENAI_BASE_URL=https://openrouter.ai/api/v1\nexport OPENAI_MODEL=google/gemini-2.0-flash\n```\n\n### Ollama (local, free)\n\n```bash\nollama pull llama3.3:70b\n\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_BASE_URL=http://localhost:11434/v1\nexport OPENAI_MODEL=llama3.3:70b\n# no API key needed for local models\n```\n\n### LM Studio (local)\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_BASE_URL=http://localhost:1234/v1\nexport OPENAI_MODEL=your-model-name\n```\n\n### Together AI\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=...\nexport OPENAI_BASE_URL=https://api.together.xyz/v1\nexport OPENAI_MODEL=meta-llama/Llama-3.3-70B-Instruct-Turbo\n```\n\n### Groq\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=gsk_...\nexport OPENAI_BASE_URL=https://api.groq.com/openai/v1\nexport OPENAI_MODEL=llama-3.3-70b-versatile\n```\n\n### Mistral\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=...\nexport OPENAI_BASE_URL=https://api.mistral.ai/v1\nexport OPENAI_MODEL=mistral-large-latest\n```\n\n### Azure OpenAI\n\n```bash\nexport CLAUDE_CODE_USE_OPENAI=1\nexport OPENAI_API_KEY=your-azure-key\nexport OPENAI_BASE_URL=https://your-resource.openai.azure.com/openai/deployments/your-deployment/v1\nexport OPENAI_MODEL=gpt-4o\n```\n\n---\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `CLAUDE_CODE_USE_OPENAI` | Yes | Set to `1` to enable the OpenAI provider |\n| `OPENAI_API_KEY` | Yes* | Your API key (*not needed for local models like Ollama) |\n| `OPENAI_MODEL` | Yes | Model name (e.g. `gpt-4o`, `deepseek-chat`, `llama3.3:70b`) |\n| `OPENAI_BASE_URL` | No | API endpoint (defaults to `https://api.openai.com/v1`) |\n\nYou can also use `ANTHROPIC_MODEL` to override the model name. `OPENAI_MODEL` takes priority.\n\n---\n\n## What Works\n\n- **All tools**: Bash, FileRead, FileWrite, FileEdit, Glob, Grep, WebFetch, WebSearch, Agent, MCP, LSP, NotebookEdit, Tasks\n- **Streaming**: Real-time token streaming\n- **Tool calling**: Multi-step tool chains (the model calls tools, gets results, continues)\n- **Images**: Base64 and URL images passed to vision models\n- **Slash commands**: /commit, /review, /compact, /diff, /doctor, etc.\n- **Sub-agents**: AgentTool spawns sub-agents using the same provider\n- **Memory**: Persistent memory system\n\n## What's Different\n\n- **No thinking mode**: Anthropic's extended thinking is disabled (OpenAI models use different reasoning)\n- **No prompt caching**: Anthropic-specific cache headers are skipped\n- **No beta features**: Anthropic-specific beta headers are ignored\n- **Token limits**: Defaults to 32K max output — some models may cap lower, which is handled gracefully\n\n---\n\n## How It Works\n\nThe shim (`src/services/api/openaiShim.ts`) sits between Claude Code and the LLM API:\n\n```\nClaude Code Tool System\n        |\n        v\n  Anthropic SDK interface (duck-typed)\n        |\n        v\n  openaiShim.ts  \u003c-- translates formats\n        |\n        v\n  OpenAI Chat Completions API\n        |\n        v\n  Any compatible model\n```\n\nIt translates:\n- Anthropic message blocks → OpenAI messages\n- Anthropic tool_use/tool_result → OpenAI function calls\n- OpenAI SSE streaming → Anthropic stream events\n- Anthropic system prompt arrays → OpenAI system messages\n\nThe rest of Claude Code doesn't know it's talking to a different model.\n\n---\n\n## Model Quality Notes\n\nNot all models are equal at agentic tool use. Here's a rough guide:\n\n| Model | Tool Calling | Code Quality | Speed |\n|-------|-------------|-------------|-------|\n| GPT-4o | Excellent | Excellent | Fast |\n| DeepSeek-V3 | Great | Great | Fast |\n| Gemini 2.0 Flash | Great | Good | Very Fast |\n| Llama 3.3 70B | Good | Good | Medium |\n| Mistral Large | Good | Good | Fast |\n| GPT-4o-mini | Good | Good | Very Fast |\n| Qwen 2.5 72B | Good | Good | Medium |\n| Smaller models (\u003c7B) | Limited | Limited | Very Fast |\n\nFor best results, use models with strong function/tool calling support.\n\n---\n\n## Files Changed from Original\n\n```\nsrc/services/api/openaiShim.ts   — NEW: OpenAI-compatible API shim (724 lines)\nsrc/services/api/client.ts       — Routes to shim when CLAUDE_CODE_USE_OPENAI=1\nsrc/utils/model/providers.ts     — Added 'openai' provider type\nsrc/utils/model/configs.ts       — Added openai model mappings\nsrc/utils/model/model.ts         — Respects OPENAI_MODEL for defaults\nsrc/utils/auth.ts                — Recognizes OpenAI as valid 3P provider\n```\n\n6 files changed. 786 lines added. Zero dependencies added.\n\n---\n\n## Origin\n\nThis is a fork of [instructkr/claude-code](https://gitlawb.com/node/repos/z6MkgKkb/instructkr-claude-code), which mirrored the Claude Code source snapshot that became publicly accessible through an npm source map exposure on March 31, 2026.\n\nThe original Claude Code source is the property of Anthropic. This repository is not affiliated with or endorsed by Anthropic.\n\n---\n\n## License\n\nThis repository is provided for educational and research purposes. The original source code is subject to Anthropic's terms. The OpenAI shim additions are public domain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatixntsoa%2Fopenclaude","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhatixntsoa%2Fopenclaude","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatixntsoa%2Fopenclaude/lists"}