{"id":47578429,"url":"https://github.com/Enderfga/openclaw-claude-code","last_synced_at":"2026-04-15T05:00:31.310Z","repository":{"id":335861821,"uuid":"1146091496","full_name":"Enderfga/openclaw-claude-code","owner":"Enderfga","description":"OpenClaw plugin — turn Claude Code CLI into a programmable, headless coding engine with plenty of tools, agent teams, and multi-model proxy","archived":false,"fork":false,"pushed_at":"2026-04-11T14:27:44.000Z","size":939,"stargazers_count":310,"open_issues_count":0,"forks_count":50,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-11T16:30:08.919Z","etag":null,"topics":["agent-teams","ai-agent","claude-code","coding-agent","mcp","openclaw","plugin","session-management"],"latest_commit_sha":null,"homepage":"https://github.com/Enderfga/openclaw-claude-code#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Enderfga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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-01-30T16:00:53.000Z","updated_at":"2026-04-11T15:54:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Enderfga/openclaw-claude-code","commit_stats":null,"previous_names":["enderfga/openclaw-claude-code-skill","enderfga/openclaw-claude-code"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/Enderfga/openclaw-claude-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enderfga%2Fopenclaw-claude-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enderfga%2Fopenclaw-claude-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enderfga%2Fopenclaw-claude-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enderfga%2Fopenclaw-claude-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enderfga","download_url":"https://codeload.github.com/Enderfga/openclaw-claude-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enderfga%2Fopenclaw-claude-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31826902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["agent-teams","ai-agent","claude-code","coding-agent","mcp","openclaw","plugin","session-management"],"created_at":"2026-03-31T09:00:20.315Z","updated_at":"2026-04-15T05:00:31.301Z","avatar_url":"https://github.com/Enderfga.png","language":"TypeScript","funding_links":[],"categories":["MCP und Tool-Server"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/banner.jpg\" alt=\"openclaw-claude-code banner\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n# openclaw-claude-code\n\nProgrammable bridge that turns coding CLIs into headless, agentic engines — persistent sessions, multi-engine orchestration, multi-agent council, and dynamic runtime control.\n\n[![npm version](https://img.shields.io/npm/v/@enderfga/openclaw-claude-code.svg)](https://www.npmjs.com/package/@enderfga/openclaw-claude-code)\n[![CI](https://github.com/Enderfga/openclaw-claude-code/actions/workflows/ci.yml/badge.svg)](https://github.com/Enderfga/openclaw-claude-code/actions/workflows/ci.yml)\n[![Tests](https://img.shields.io/badge/tests-300%20passed-brightgreen)](https://github.com/Enderfga/openclaw-claude-code/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Why This Exists\n\nClaude Code and Codex are powerful coding CLIs, but they're designed for interactive use. If you want AI agents to **programmatically** drive coding sessions — start them, send tasks, manage context, coordinate teams, switch models mid-conversation — you need a control layer.\n\nThis project wraps coding CLIs and exposes their capabilities as a clean, tool-based API. Your agents get persistent sessions, real-time streaming, multi-model routing, multi-engine support, and multi-agent council orchestration.\n\n\u003e **Why not just use the Claude API directly?** The API gives you completions. This gives you a fully managed coding agent — file editing, tool use, git awareness, context management, and multi-turn conversations — all without building the orchestration yourself.\n\n## Quick Start\n\n**One-line install** (recommended):\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Enderfga/openclaw-claude-code/main/install.sh | bash\n```\n\nThis installs via npm, registers the plugin in `openclaw.json`, and restarts the gateway automatically.\n\n**Standalone** (no OpenClaw):\n\n```bash\nnpm install -g @enderfga/openclaw-claude-code\nclaude-code-skill serve\n```\n\n```typescript\nimport { SessionManager } from '@enderfga/openclaw-claude-code';\n\nconst manager = new SessionManager();\nawait manager.startSession({ name: 'task', cwd: '/project' });\nconst result = await manager.sendMessage('task', 'Fix the failing tests');\n```\n\nSee [Getting Started](./skills/references/getting-started.md) for full setup guide.\n\n## Features\n\n### Multi-Engine Sessions\n\nDrive Claude Code, OpenAI Codex, Google Gemini, Cursor Agent, or **any custom coding CLI** through a unified `ISession` interface. Each engine manages its own subprocess, events, and cost tracking.\n\n```typescript\n// Claude Code engine (default)\nawait manager.startSession({ name: 'claude-task', engine: 'claude', model: 'opus' });\n\n// Codex engine\nawait manager.startSession({ name: 'codex-task', engine: 'codex', model: 'gpt-5.4' });\n\n// Gemini engine\nawait manager.startSession({ name: 'gemini-task', engine: 'gemini', model: 'gemini-3.1-pro-preview' });\n\n// Cursor Agent engine\nawait manager.startSession({ name: 'cursor-task', engine: 'cursor', model: 'sonnet-4' });\n\n// Custom engine — any coding agent CLI via config\nawait manager.startSession({\n  name: 'my-task',\n  engine: 'custom',\n  cwd: '/project',\n  customEngine: {\n    name: 'my-agent',\n    bin: 'my-agent',\n    persistent: true,  // or false for one-shot\n    args: { print: '-p', outputFormat: '--output-format', outputFormatValue: 'stream-json', /* ... */ },\n  },\n});\n```\n\nSee [Multi-Engine](./skills/references/multi-engine.md) for architecture and adding new engines.\n\n### Multi-Agent Council\n\nMultiple agents collaborate in parallel on the same codebase with git worktree isolation, consensus voting, and a two-phase protocol (plan then execute).\n\n```typescript\nconst session = manager.councilStart('Build a REST API with auth', {\n  agents: [\n    { name: 'Planner', emoji: '🟠', persona: 'Requirements \u0026 architecture', engine: 'claude', model: 'opus' },\n    { name: 'Generator', emoji: '🟢', persona: 'Implementation per plan', engine: 'codex', model: 'gpt-5.4' },\n    { name: 'Evaluator', emoji: '🔵', persona: 'Independent verification', engine: 'claude', model: 'sonnet' },\n  ],\n  maxRounds: 10,\n  projectDir: '/tmp/api-project',\n});\n```\n\nSee [Council](./skills/references/council.md) for the full collaboration protocol.\n\n### 27 Tools\n\n| Category | Tools |\n|----------|-------|\n| Session Lifecycle | `claude_session_start`, `send`, `stop`, `list`, `overview` |\n| Session Operations | `status`, `grep`, `compact`, `update_tools`, `switch_model` |\n| Inbox | `session_send_to`, `session_inbox`, `session_deliver_inbox` |\n| Agent Teams | `agents_list`, `team_list`, `team_send` |\n| Council | `council_start`, `council_status`, `council_abort`, `council_inject`, `council_review`, `council_accept`, `council_reject` |\n| Ultraplan | `ultraplan_start`, `ultraplan_status` |\n| Ultrareview | `ultrareview_start`, `ultrareview_status` |\n\nSee [Tools Reference](./skills/references/tools.md) for complete API.\n\n### Session Inbox\n\nCross-session messaging: sessions can send messages to each other. Idle sessions receive immediately; busy sessions queue for later delivery.\n\n```typescript\nawait manager.sessionSendTo('planner', 'coder', 'The auth module needs rate limiting');\nawait manager.sessionSendTo('monitor', '*', 'Build failed!');  // broadcast\n```\n\n### Ultraplan\n\nDedicated Opus planning session that explores your project for up to 30 minutes and produces a detailed implementation plan.\n\n```typescript\nconst plan = manager.ultraplanStart('Add OAuth2 support with Google and GitHub providers', {\n  cwd: '/project',\n});\n// Poll: manager.ultraplanStatus(plan.id)\n```\n\n### Ultrareview\n\nFleet of 5-20 bug-hunting agents that review your codebase in parallel, each from a different angle (security, performance, logic, types, etc.).\n\n```typescript\nconst review = manager.ultrareviewStart('/project', {\n  agentCount: 10,\n  maxDurationMinutes: 15,\n});\n// Poll: manager.ultrareviewStatus(review.id)\n```\n\n### OpenAI-Compatible API\n\nDrop-in backend for any OpenAI-compatible webchat frontend. Stateful sessions maximize Anthropic prompt caching (90% discount on cached tokens).\n\n```bash\n# Start the server\nclaude-code-skill serve\n\n# Use with any OpenAI client\ncurl http://127.0.0.1:18796/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"claude-sonnet-4-6\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}],\"stream\":true}'\n```\n\nWorks with ChatGPT-Next-Web, Open WebUI, LobeChat, and any app that speaks the OpenAI API format. Set the API base URL to `http://127.0.0.1:18796/v1` and use any API key (or leave blank).\n\nSee [CLI Reference](./skills/references/cli.md) for configuration options.\n\n### And More\n\n- **Session Persistence** — 7-day disk TTL, auto-resume across restarts\n- **Multi-Model Proxy** — Anthropic ↔ OpenAI format translation for Gemini/GPT\n- **Cost Tracking** — per-model pricing with real-time token accounting\n- **Effort Control** — `low` to `max` thinking depth per message\n- **Runtime Model/Tool Switching** — hot-swap via `--resume`\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[OpenClaw / Your Code] --\u003e|tool calls| B[Plugin Entry\u003cbr/\u003eindex.ts]\n    B --\u003e C[SessionManager]\n    C --\u003e D[Claude Engine\u003cbr/\u003epersistent-session.ts]\n    C --\u003e E[Codex Engine\u003cbr/\u003epersistent-codex-session.ts]\n    C --\u003e K[Gemini Engine\u003cbr/\u003epersistent-gemini-session.ts]\n    C --\u003e L[Cursor Engine\u003cbr/\u003epersistent-cursor-session.ts]\n    C --\u003e M[Custom Engine\u003cbr/\u003epersistent-custom-session.ts]\n    C --\u003e F[Council\u003cbr/\u003ecouncil.ts]\n    C --\u003e G[Inbox / Ultraplan / Ultrareview]\n    F --\u003e|git worktree per agent| D\n    B --\u003e H[Proxy Handler]\n    H --\u003e|Anthropic format| I[Gemini / GPT / Gateway]\n    B --\u003e J[Embedded HTTP Server]\n```\n\n```\nsrc/\n├── index.ts                    # Plugin entry — 27 tools + proxy route\n├── models.ts                   # Centralized model registry (pricing, aliases, engines)\n├── types.ts                    # Shared types, ISession interface, re-exports from models\n├── constants.ts                # Shared constants (timeouts, limits, thresholds)\n├── logger.ts                   # Structured Logger interface + console implementation\n├── base-oneshot-session.ts     # Abstract base class for one-shot engines (Codex/Gemini/Cursor)\n├── persistent-session.ts       # Claude Code engine (ISession)\n├── persistent-codex-session.ts # Codex engine (extends BaseOneShotSession)\n├── persistent-gemini-session.ts # Gemini engine (extends BaseOneShotSession)\n├── persistent-cursor-session.ts # Cursor Agent engine (extends BaseOneShotSession)\n├── persistent-custom-session.ts # Custom engine — any CLI via config (ISession)\n├── session-manager.ts          # Multi-session orchestration + council management\n├── circuit-breaker.ts          # Engine failure tracking with exponential backoff\n├── inbox-manager.ts            # Cross-session messaging (inbox)\n├── council.ts                  # Multi-agent council orchestration\n├── consensus.ts                # Consensus vote parsing\n├── openai-compat.ts            # OpenAI-compatible /v1/chat/completions\n├── embedded-server.ts          # HTTP server for standalone mode\n└── proxy/\n    ├── handler.ts              # Provider detection + routing\n    ├── anthropic-adapter.ts    # Anthropic ↔ OpenAI conversion\n    ├── schema-cleaner.ts       # Gemini schema compatibility\n    └── thought-cache.ts        # Gemini thought caching\n\nskills/\n├── SKILL.md                    # OpenClaw skill definition (triggers + metadata)\n└── references/                 # All documentation (progressive disclosure)\n    ├── getting-started.md      # Installation, configuration, first session\n    ├── sessions.md             # Persistent sessions, resume, cost tracking\n    ├── multi-engine.md         # Claude + Codex + Gemini + Cursor + Custom engines\n    ├── council.md              # Multi-agent collaboration protocol\n    ├── tools.md                # Complete 27-tool API reference\n    ├── inbox.md                # Cross-session messaging\n    ├── ultra.md                # Ultraplan \u0026 Ultrareview\n    └── cli.md                  # Command-line interface\n```\n\n## Documentation\n\nAll documentation lives in [`skills/references/`](./skills/references/) — see the directory tree above. Start with [Getting Started](./skills/references/getting-started.md), or jump to the [Tools Reference](./skills/references/tools.md) for the full 27-tool API.\n\nFor contributing: see [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Engine Compatibility\n\nAll engines are tested and verified in each release:\n\n| Engine | CLI | Tested Version | Invocation | Status |\n|--------|-----|---------------|------------|--------|\n| Claude Code | `claude` | 2.1.91 | Persistent subprocess, stream-json | **Fully supported** |\n| OpenAI Codex | `codex` | 0.118.0 | `codex exec --full-auto`, per-message | **Fully supported** |\n| Google Gemini | `gemini` | 0.36.0 | `gemini -p --output-format stream-json`, per-message | **Fully supported** |\n| Cursor Agent | `agent` | 2026.03.30 | `agent -p --force --output-format stream-json`, per-message | **Fully supported** |\n| Custom | User-configured | Any | User-defined via `CustomEngineConfig` | **Fully supported** |\n\n\u003e **Note:** CLI versions evolve independently. If a new CLI version changes its flags or output format, the plugin may need an update. Pin your CLI versions in CI to avoid surprises.\n\n### Known Limitations\n\n- **Team tools** (`team_list`, `team_send`) work on all engines: Claude uses native agent teams; Codex/Gemini/Cursor use cross-session messaging as a virtual team layer\n- **Codex/Gemini/Cursor sessions** are one-shot per message (no persistent subprocess) — context is carried via working directory, not conversation history\n- **Custom engine** event parsing assumes stream-json NDJSON format compatible with Claude Code / Gemini / Cursor CLI output; CLIs with proprietary output formats may need a built-in engine instead\n- **Council consensus** requires agents to output an explicit `[CONSENSUS: YES/NO]` tag — loose phrasing will default to NO\n- **Inbox delivered messages** are not retained in inbox history (only queued messages appear)\n\n## Requirements\n\n- **Node.js \u003e= 22**\n- **Claude Code CLI \u003e= 2.1** — `npm install -g @anthropic-ai/claude-code`\n- **OpenClaw \u003e= 2026.3.0** (optional, for plugin mode)\n- **Codex CLI \u003e= 0.112** (optional) — `npm install -g @openai/codex`\n- **Gemini CLI \u003e= 0.35** (optional) — `npm install -g @google/gemini-cli`\n- **Cursor Agent CLI** (optional) — Install via Cursor IDE or `curl https://cursor.com/install -fsSL | bash`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEnderfga%2Fopenclaw-claude-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEnderfga%2Fopenclaw-claude-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEnderfga%2Fopenclaw-claude-code/lists"}