{"id":48863059,"url":"https://github.com/deepelementlab/clawcode","last_synced_at":"2026-04-15T17:01:48.117Z","repository":{"id":348880113,"uuid":"1198331424","full_name":"deepelementlab/clawcode","owner":"deepelementlab","description":"ClawCode is claude code inspired implementation in python and Rust focused on agents and experience-based evolution, and is an Open-source coding-agent CLI for Anthropic, OpenAI, Gemini, DeepSeek, GLM, Kimit, Ollama, Codex, GitHub Models, and 200+ models via OpenAI-compatible APIs.","archived":false,"fork":false,"pushed_at":"2026-04-10T16:15:06.000Z","size":2161,"stargazers_count":57,"open_issues_count":1,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-10T17:28:18.547Z","etag":null,"topics":["agents","ai-coding","claude-code","claw","codex","opencode","python","rust","skills"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepelementlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-04-01T10:21:32.000Z","updated_at":"2026-04-10T16:37:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deepelementlab/clawcode","commit_stats":null,"previous_names":["deepelementlab/clawcode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deepelementlab/clawcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepelementlab%2Fclawcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepelementlab%2Fclawcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepelementlab%2Fclawcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepelementlab%2Fclawcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepelementlab","download_url":"https://codeload.github.com/deepelementlab/clawcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepelementlab%2Fclawcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31851057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["agents","ai-coding","claude-code","claw","codex","opencode","python","rust","skills"],"created_at":"2026-04-15T17:01:47.328Z","updated_at":"2026-04-15T17:01:48.110Z","avatar_url":"https://github.com/deepelementlab.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n \u003cimg width=\"256\" height=\"256\" alt=\"Screenshot - 2026-03-26 20 36 43\" src=\"https://github.com/user-attachments/assets/03466089-8b3d-47f8-a454-06a8874eb727\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eClawCode\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eYour creative dev tool , AI coding Swiss Army knife\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/deepelementlab/clawcode/releases\"\u003e\n   \u003cimg\n     src=\"https://img.shields.io/static/v1?style=flat\u0026label=release\u0026labelColor=6A737D\u0026color=fe7d37\u0026message=v0.1.2\"\n     alt=\"Release v0.1.2\"\n   /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#license\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-GPL%20OR%20Apache%202.0-blue.svg\" alt=\"License: GPL-3.0\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/deepelementlab/clawcode/wiki\"\u003e\u003cimg src=\"https://img.shields.io/badge/Wiki-documentation-26A5E4?style=flat\u0026logo=github\u0026logoColor=white\"alt=\"Documentation Wiki\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://gitcgr.com/deepelementlab/clawcode\"\u003e\n    \u003cimg src=\"https://gitcgr.com/badge/nearai/clawcode.svg\" alt=\"gitcgr\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README.md\"\u003eEnglish\u003c/a\u003e |\n  \u003ca href=\"README.zh.md\"\u003e简体中文\u003c/a\u003e \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#philosophy\"\u003ePhilosophy\u003c/a\u003e •\n  \u003ca href=\"#product-vision\"\u003eProduct vision\u003c/a\u003e •\n  \u003ca href=\"#development-assistance-functions\"\u003eDevelopment assistance functions\u003c/a\u003e •\n  \u003ca href=\"#system-architecture\"\u003eSystem Architecture\u003c/a\u003e •\n  \u003ca href=\"#value-at-a-glance\"\u003eValue at a glance\u003c/a\u003e •\n  \u003ca href=\"#get-started\"\u003eGet started\u003c/a\u003e\n\u003c/p\u003e\n\n\nClawCode is a Claude Code‑inspired implementation in Python and Rust, focused on agents and experience‑based evolution. It is also an open‑source coding‑agent CLI for Anthropic, OpenAI, Gemini, DeepSeek, GLM, Kimi, Ollama, Codex, GitHub Models, and 200+ models via OpenAI‑compatible APIs.\n\n\u003cimg width=\"2549\" height=\"930\" alt=\"ClawCode screenshot\" src=\"https://github.com/user-attachments/assets/14042063-5545-40c4-a1d8-141f8ea6c765\" /\u003e\n\n## Portfolio\n[`MonsterLand`](https://github.com/deepelementlab/MonsterLand): Creative games and tooling apps built with clawcode.\n\n## Philosophy\n\nWe aim to build an open, excellent AI coding Swiss Army knife.\n\nIt starts with a coder agent framework (tool use, skills, memory, multi‑agent). On this we built Claw, adding more tools, OpenClaw skill compatibility, and computer‑use abilities.\n\nBut that's not enough. Our own projects generate valuable development data through iterations. We shouldn't waste them.\n\nSo we built a self‑improving subsystem: it uses that data to continuously enhance the agents. All data stays local, under your control. The system is open source, auditable, with no hidden telemetry.\n\nIn short: an experience‑based reinforcement learning framework that turns\n\nIdea → Memory → Plan → Code → Verify → Review → Learned Experience\n\ninto an executable, learnable, evolving engineering loop.\n\n\n\n\n---\n\n## Product vision\n\nClawCode is a creative dev tool aimed at real delivery. \n\n### Features:\n\n\u003cimg width=\"1376\" height=\"768\" alt=\"Generated_image\" src=\"https://github.com/user-attachments/assets/1a09bd15-9859-413d-a1f3-f0c573e12b99\" /\u003e\n\n### Core motivations:\n\n- **Turn ideas into runnable code quickly**  \n  From “I have an idea” to “implemented and verified,” with less context switching and tool friction.\n\n- **Stay vendor- and model-agnostic**  \n  Configurable providers/models and open extension paths reduce lock-in.\n\n- **Reuse strong UX patterns instead of reinventing habits**  \n  Learn from mature tools (e.g. Claude Code, Cursor) and preserve familiar workflows where possible.\n\n- **Remember usage and improve over time**  \n  Session persistence, experience write-back, and closed-loop learning let the system evolve with tasks and team practice.\n\n- **Execute “full-stack” engineering tasks end-to-end**  \n  Beyond one-off codegen: planning, delegation, execution, verification, review, and structured learning.\n\n## Design\nEnable the model to gain a deeper understanding of product design aesthetics.\n\n\u003cimg width=\"1376\" height=\"768\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cb02297f-1319-4df6-ae7a-5e42790efc2c\" /\u003e\n\nThe demo and baseline now adopt the Google Stitch open-source standard. And The demo provides 55 open-source real-world brand case studies. The coder workflow extensively references them during UI design and coding; you are also free to use them selectively.\n\n| Path | Purpose |\n|------|---------|\n| [`UI/`](./.claw/design/UI/) | Curated **product / brand UI references** — each brand folder includes `DESIGN.md`, previews, and notes. See **[`UI/README.md`](./.claw/design/UI/README.md)** for the full catalog and links. |\n\n\u003cimg width=\"1830\" height=\"620\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a77785c8-23e8-4678-a3c7-e541d1f12096\" /\u003e\n\n## Product Design with DesignTeam (/designteam)\n\nIn one line: DesignTeam is ClawCode’s product-design pipeline as a first-class slash command—spin up an Orchestrator plus specialist design agents from a single prompt and ship a structured system design document and specs that teams can hand off to engineering, not a one-off “chatty UI suggestion.”\n\n\u003cimg width=\"1376\" height=\"768\" alt=\"Clipboard - 2026-04-15 16 44 10\" src=\"https://github.com/user-attachments/assets/3bca5ec0-324a-4ce3-b520-7dc86fd2c7be\" /\u003e\n\n| Dimension | Typical \"AI design helpers\" | **ClawCode DesignTeam** |\n|-----------|----------------------------|-------------------------|\n| Deliverable | Fragmented tips, single-turn replies | **Structured system design doc** + phased artifacts, cumulative and reviewable |\n| Roles | Implicit single persona | **Explicit multi-agent roster** (Tier‑1: research, IXD, UI, product, visual/ops, experience)—orchestrator picks a **minimal sufficient** set |\n| Context \u0026 memory | Prompt-only | **TECAP + role ECAP** retrieval, plus optional `.claw/design/designteam/*.yaml` context |\n| Boundary with engineering | Often blurred with \"just build it\" | Clear split vs **`/clawteam`**: DesignTeam = **design docs \u0026 specs**; ClawTeam = **implementation \u0026 engineering delivery** |\n| Multi-turn closure | Rare or ad hoc | **`/designteam --deep_loop`**: **7-phase design workflow** with outer-loop iterations; **`DEEP_LOOP_EVAL_JSON` / `DEEP_LOOP_WRITEBACK_JSON`** for machine-readable convergence and learning-service writeback |\n\n## Development assistance functions\n\n### Architecture \u0026 review\n\n| Command | Function |\n|--------|----------|\n| `/architect` | Run architecture design/review workflow with trade-off analysis and ADR/checklist options. |\n| `/code-review` | Review local uncommitted changes with severity-ranked findings and commit gate. |\n| `/security-review` | Complete a security review of the pending changes on the current branch. |\n| `/review` | Review a pull request. |\n\n### Autocomplete / related planning \u0026 plugins\n\n| Command | Function |\n|--------|----------|\n| `/plan` | Enable plan mode or view the current session plan (handled in ChatScreen; listed for autocomplete). |\n| `/arc-plan` | Generate a one-shot alternative implementation plan (ARC planner). |\n| `/plugin` | Manage clawcode plugins. |\n\n### Test-driven development\n\n| Command | Function |\n|--------|----------|\n| `/tdd` | Run strict TDD workflow: scaffold, RED, GREEN, refactor, and coverage gate. |\n\n### Multi-role orchestration \u0026 engineering workflows\n\n| Command | Function |\n|--------|----------|\n| `/clawteam` | Run multi-role task orchestration, or target one role via `/clawteam:\u003cagent\u003e`. Supports `--deep_loop` for iterative convergence (see `docs/CLAWTEAM_SLASH_GUIDE.md`). |\n| `/clawteam-deeploop-finalize` | Parse `DEEP_LOOP_WRITEBACK_JSON` from pasted or last assistant text using pending deep-loop session metadata. |\n| `/multi-plan` | Run multi-model collaborative planning workflow (plan-only). |\n| `/multi-execute` | Run multi-model collaborative execution workflow with traceable artifacts. |\n| `/multi-backend` | Run backend-focused multi-model workflow (research through review, orchestrator writes code). |\n| `/multi-frontend` | Run frontend-focused multi-model workflow (UI/UX led, orchestrator writes code). |\n| `/multi-workflow` | Run full-stack multi-model workflow (backend + UI advisors, orchestrator writes code). |\n| `/orchestrate` | Run sequential multi-role workflow (HANDOFF between planner/TDD/review/security/architect); `/orchestrate show\\|list`. |\n\n\n### Learning loop: ECAP, TECAP \u0026 instincts\n\n| Command | Function |\n|--------|----------|\n| `/learn` | Learn reusable instincts from recent tool observations. |\n| `/learn-orchestrate` | Run observe → evolve → import-to-skill-store orchestration in one command. |\n| `/experience-create` | Create an ECAP experience capsule from recent observations/instincts. |\n| `/experience-status` | List available ECAP capsules with optional filters. |\n| `/experience-export` | Export an ECAP capsule as JSON/Markdown for model or human use. |\n| `/experience-import` | Import an ECAP capsule from local file or URL. |\n| `/experience-apply` | Apply an ECAP capsule as one-shot agent prompt context. |\n| `/experience-feedback` | Record success/failure feedback score for an ECAP capsule. |\n| `/team-experience-create` | Create a TECAP team-experience capsule from collaborative traces. |\n| `/team-experience-status` | List TECAP capsules with optional team/problem filters. |\n| `/team-experience-export` | Export a TECAP capsule as JSON/Markdown for agents and humans. |\n| `/team-experience-import` | Import a TECAP capsule from local file or URL. |\n| `/team-experience-apply` | Apply a TECAP capsule as collaboration context prompt. |\n| `/team-experience-feedback` | Record feedback score for a TECAP capsule. |\n| `/tecap-create` | Alias of `/team-experience-create`. |\n| `/tecap-status` | Alias of `/team-experience-status`. |\n| `/tecap-export` | Alias of `/team-experience-export`. |\n| `/tecap-import` | Alias of `/team-experience-import`. |\n| `/tecap-apply` | Alias of `/team-experience-apply`. |\n| `/tecap-feedback` | Alias of `/team-experience-feedback`. |\n| `/instinct-status` | Show learned instincts grouped by domain and confidence. |\n| `/instinct-import` | Import instincts from local file or URL into inherited set. |\n| `/instinct-export` | Export instincts with optional domain/confidence filters. |\n| `/evolve` | Cluster instincts and optionally generate evolved structures. |\n| `/experience-dashboard` | Show ECAP-first experience metrics dashboard (add `--json` or `--no-alerts`). |\n| `/closed-loop-contract` | Show closed-loop config contract coverage (consumed vs unconsumed keys). |\n\n### Observability, diagnostics \u0026 diffs\n\n| Command | Function |\n|--------|----------|\n| `/doctor` | Diagnose and verify your clawcode installation and settings. |\n| `/diff` | View uncommitted changes and per-turn diffs. |\n| `/debug` | Debug your current clawcode session via logs (bundled viewer). |\n| `/insights` | Generate a report analyzing your clawcode sessions. |\n\n### Claw mode \u0026 external CLIs\n\n| Command | Function |\n|--------|----------|\n| `/claw` | Enable Claw agent mode or show status (autocomplete entry; see `SLASH_AUTOCOMPLETE_EXTRA` in `builtin_slash.py`). |\n| `/claude` | Enable Claw mode then path A: Anthropic + Claude Code HTTP identity. |\n| `/claude-cli` | Enable Claw mode then path B: run claude / claude-code CLI in workspace. |\n| `/opencode-cli` | Enable Claw mode then path B′: run OpenCode opencode CLI in workspace. |\n| `/codex-cli` | Enable Claw mode then path B″: run OpenAI Codex CLI in workspace. |\n\n### Session, Git, workspace \u0026 engineering context\n\n| Command | Function |\n|--------|----------|\n| `/checkpoint` | Git workflow checkpoints: `create`, `verify`, `list`, `clear`. |\n| `/rewind` | Soft-archive chat after a message, or inspect/restore tracked git files. |\n| `/tasks` | List and manage background tasks (plan build, agent run). |\n| `/init` | Initialize CLAWCODE.md (or CLAW.md-style) codebase documentation in the project. |\n| `/add-dir` | Add a new working directory. |\n| `/agents` | Manage agent configurations. |\n| `/skills` | List available skills. |\n| `/mcp` | Manage MCP servers. |\n| `/hooks` | Manage hook configurations for tool events. |\n| `/permissions` | Manage allow \u0026 deny tool permission rules. |\n| `/memory` | Edit claw memory files. |\n| `/pr-comments` | Get comments from a GitHub pull request. |\n\n## System Architecture\n\u003cimg width=\"1376\" height=\"768\" alt=\"Generated_image_architecture\" src=\"https://github.com/user-attachments/assets/1bd96e39-8ca3-4e96-8698-dbc755ce94ab\" /\u003e\n\n\n## Compatible with Claude Code (config \u0026 plugins \u0026 skills)\n\nTo lower learning and migration cost, ClawCode offers **alignable** workflows where it matters.\n\n\u003cimg width=\"1937\" height=\"319\" alt=\"Screenshot - 2026-03-26 00 27 15\" src=\"https://github.com/user-attachments/assets/1a9adf68-bd07-4d0b-aa9b-20896c6fedc7\" /\u003e\n\n- If you want **polished product UX out of the box**, Claude Code has strengths.\n- If you want **deep terminal execution + team orchestration + learning loops + configurable extensions**, ClawCode emphasizes that combination.\n\nClawCode uses **alignment as a migration layer** and **closed-loop engineering evolution** as the core value layer.\n\n| Alignment | What it means | Extra value in ClawCode |\n|---|---|---|\n| Slash workflows | Organize work with `/` commands (e.g. `/clawteam`, `/clawteam --deep_loop`) | Goes from “command fired” to **multi-role orchestration + convergence + write-back** |\n| Skills | Reuse and extend skills; lower asset migration cost | Skills can plug into **experience loops** and improve per project |\n| Terminal-native | TUI/CLI habits and scripting | Analyze, execute, verify, and review **in one surface** |\n| Extensible tools | plugin / MCP / computer use | Progressive capability expansion under team policy |\n\n## Compatible with Claude Code (Agent \u0026 Subagent)\n\u003cimg width=\"1817\" height=\"1052\" alt=\"Screenshot - 2026-04-05 12 41 32\" src=\"https://github.com/user-attachments/assets/5a1eba89-1986-4253-a36b-431b54bd6059\" /\u003e\n\n## Agent roles \u0026 team (Claude Code–style)\n\nClawCode aligns with Claude Code’s **Agent** tool: the main agent spawns **subagents** with isolated context, custom prompts, and tool allowlists. Subagents **cannot** nest another `Agent` / `Task` (delegation is stripped for the inner run).\n\n### 1. Built-in subagent roles\n\n| Agent id | Purpose (short) |\n| --- | --- |\n| `explore` | Read-only exploration (`Read`/`Glob`/`Grep`/…) |\n| `plan` | Read-only research for planning |\n| `code-review` | Review-focused, read-only tools |\n| `general-purpose` | Full tool surface (minus delegate tools) when you omit a custom list |\n\n### 2. Built-in **clawteam** (multi-role “team”)\n\nUse these ids as `agent` / `subagent_type` the same way as `explore` / `plan`. Examples: `clawteam-system-architect`, `clawteam-rnd-backend`, `clawteam-qa`, `clawteam-product-manager`, … (all `clawteam-*` ids ship in the built-in registry).\n\n**Collaboration model:** the **orchestrator** is still the main agent—it calls `Agent` multiple times with different role ids and tasks. There is no separate “team scheduler” UI; “team work” is **sequential/parallel tool calls** decided by the model.\n\n### 3. Custom roles (project + user)\n\nDefinitions are **Markdown files** with **YAML frontmatter** (same idea as `.claude/agents/`).\n\n**User-wide (highest override of project defaults for same name):**\n\n- `~/.claude/agents/*.md`\n\n**Project (read merge order; later roots override earlier for the same `name`):**\n\n- `.claw/agents/*.md`\n- `.clawcode/agents/*.md`\n- `.claude/agents/*.md`\n\nFrontmatter fields (common):\n\n| Field | Meaning |\n| --- | --- |\n| `name` | Agent id (default: filename stem) |\n| `description` | Short blurb for routing / docs |\n| `tools` | Optional allowlist using **Claude-style names** (`Read`, `Write`, `Bash`, …) — mapped to ClawCode tools |\n| `disallowedTools` | Block list (same naming style) |\n| `model` | Optional override (`inherit`, `sonnet`, `opus`, `haiku`, or full model id) |\n| `maxTurns` | Cap on ReAct iterations for this subagent |\n| `isolation` | e.g. `none`, `worktree`, `fork` |\n| `permissionMode`, `background`, `mcpServers`, `hooks` | Passed through when set |\n\nBody markdown becomes the subagent **system prompt**.\n\n**Example** — `.claw/agents/api-guardian.md`:\n\n```markdown\n---\nname: api-guardian\ndescription: Reviews public HTTP API changes only.\ntools:\n  - Read\n  - Glob\n  - Grep\n  - diagnostics\nmaxTurns: 24\n---\n\nYou only analyze API routes and OpenAPI/contract files. Report breaking changes as a bullet list.\n```\n\n### 4. Invoking a subagent (`Agent` tool)\n\nThe model (or harness) calls **`Agent`** with at least a **task** and an **agent id**:\n\n```json\n{\n  \"agent\": \"plan\",\n  \"task\": \"Map how authentication is implemented; list key files.\"\n}\n```\n\nAliases:\n\n- `subagent_type` ↔ `agent`\n- `prompt` ↔ `task`\n- Optional: `context`, `timeout` (seconds), `max_iterations`, `isolation`, `allowed_tools` (override allowlist)\n\nUnknown `agent` → error listing **known ids** from the merged registry (built-ins + your files).\n\n### 5. Plan mode (`/plan`)\n\nOnly these subagents are allowed: `plan`, `explore`, `code-review` (plus internal `review` alias where applicable). Their tools are further restricted to **read-only** policy (no write/exec tools even if the definition asked for them).\n\n### 6. Optional: deep-loop / handoff settings (`.clawcode.json`)\n\nRuntime tuning for multi-round **clawteam-style** loops lives under settings such as `clawteam_deeploop_*` (enable flag, max iterations, convergence, handoff target, etc.). See project docs/snippets for a full example—this does **not** replace defining roles; it shapes how long/how strictly the loop runs.\n\n### 7. Relation to `agents` in `.clawcode.json`\n\nThe top-level `agents` map (`coder`, `task`, `title`, `summarizer`, …) configures **which model/provider** backs **main** flows. **Subagent roles** (`explore`, `clawteam-*`, custom `*.md`) are selected by the **`Agent` tool** and merged from the paths above—not by renaming those slots.\n\n---\n### Full-stack task execution stack (AI Coding + Claw framework + tools + computer use)\n\n“Full-stack” tasks are not a single codegen step—they chain **planning, coding, verification, review, environment actions, and learning** into one executable path. ClawCode implements three layers:\n\n| Layer | Role | Key components / commands | Typical tasks |\n|---|---|---|---|\n| Coder agent (default terminal runtime)\t| The default interactive path: Textual TUI wires sessions/messages, builds a coder runtime bundle from settings, and runs the main Agent loop (or ClawAgent.run_claw_turn when Claw mode is on). It owns send/finalize, HUD, plan state, and optional memory injection—without requiring /claw or workflow slash commands.|ChatScreen, _finalize_send_after_input, _start_agent_run, _process_message, build_coder_runtime, make_claw_agent / make_plain_agent, Agent.run, ClawAgent.run_claw_turn, _handle_agent_event, _rebuild_llm_stack|Everyday coding in the terminal: chat turns, file edits via tools, plan-style flows when /plan is active, model switch (e.g. Ctrl+O stack rebuild), non-Claw and Claw branches from the same screen|\n| Claw framework (agent runtime) | In Claw mode, `ClawAgent` runs multi-step work aligned with the main agent loop, with iteration budget and sub-agent coordination | `/claw`, `ClawAgent.run_claw_turn`, `run_agent` / `run_conversation` | Phased complex tasks, cross-turn context, bounded multi-round execution |\n| Tool orchestration (engineering execution) | Slash commands and tools drive plan-to-delivery flows: collaboration, review, diagnostics, learning | `/clawteam`, `/architect`, `/tdd`, `/code-review`, `/orchestrate`, `/multi-*` | Decompose requirements, implement, test, review, converge and write back |\n| Computer use (OS-level) | With `desktop.enabled`, `desktop_*` tools provide screenshots, mouse, and keyboard automation; complements `browser_*` | `desktop_screenshot`, `desktop_click`, `desktop_type`, `desktop_key`, `/doctor` | Cross-app actions, desktop checks, GUI-assisted verification | \n\n\u003e `desktop_*` is **off by default**. Enable explicitly and install optional extras (e.g. `pip install -e \".[desktop]\"` or equivalent). Prefer least privilege and a controlled environment.\n\nThat is why ClawCode combines **terminal execution + team orchestration + experience evolution** in one framework: a long-lived engineering partner—not a short Q\u0026A toy.\n\n---\n\n## Value at a glance\n\n| Dimension | Core capability | User value |\n|---|---|---|\n| Idea to delivery | Terminal-native execution + ReAct tool orchestration | Less switching; ideas become runnable results faster |\n| Long-horizon work | Local persistent sessions + master–slave agents + decomposition | Multi-round complex tasks with handoff and review |\n| Learning loop | deeploop + Experience + ECAP/TECAP | Not one-shot success—the system grows with your team |\n\n---\n\n## Who it’s for / Get started\n\n### Who it’s for\n\n- Developers who live in the terminal and want AI to **execute**, not only suggest.\n- Teams that need multi-role collaboration, governable flows, and reviewable outputs.\n- Leads who care about **long-term outcomes**, not a single answer.\n\n## Get started\n\n```bash\ncd clawcode\npython -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npip install -e \".[dev]\"\npython -m clawcode -c \"[your project dir]\"\n```\n\n---\n\n## Project highlights — beyond “just writing code”\n\n### 1) Long-horizon projects: durable memory + continuous context\n\nSessions and messages persist locally—not a throwaway chat. Split complex work across rounds, keep decisions and history, and support handoff and postmortems.\n\n**Why it matters:** Fits real long-cycle development, not one-off demos.\n\n### 2) `clawteam`: a schedulable virtual R\u0026D team\n\nWith `/clawteam`, the system can orchestrate roles and execution:\n- Professional role segmentation and extraction of mental models from years of industry experience.\n- Intelligent role pick and assignment\n- Serial/parallel flow planning\n- Per-role outputs and final integration\n- **10+** professional roles (product, architecture, backend, frontend, QA, SRE, …)\n\n#### `clawteam` roles (overview)\n\n| Role ID | Role | Responsibility \u0026 typical outputs |\n| --- | --- | --- |\n| [`clawteam-product-manager`](./.claw/agents/clawteam-product-manager.md) | Product manager | Priorities, roadmap, value hypotheses; scope and acceptance criteria |\n| [`clawteam-business-analyst`](./.claw/agents/clawteam-business-analyst.md) | Business analyst | Process and rules; requirements, edge cases, business acceptance |\n| [`clawteam-system-architect`](./.claw/agents/clawteam-system-architect.md) | System architect | Architecture and tech choices; modules, APIs, NFRs (performance, security, …) |\n| [`clawteam-ui-ux-designer`](./.claw/agents/clawteam-ui-ux-designer.md) | UI/UX | IA and interaction; page/component UX constraints |\n| [`clawteam-dev-manager`](./.claw/agents/clawteam-dev-manager.md) | Engineering manager | Rhythm and dependencies; risks, staffing, milestones |\n| [`clawteam-team-lead`](./.claw/agents/clawteam-team-lead.md) | Tech lead | Technical decisions and quality bar; split of work, review, integration |\n| [`clawteam-rnd-backend`](./.claw/agents/clawteam-rnd-backend.md) | Backend | Services, APIs, data layer; contracts and implementation |\n| [`clawteam-rnd-frontend`](./.claw/agents/clawteam-rnd-frontend.md) | Frontend | UI and front-end engineering; components, state, integration |\n| [`clawteam-rnd-mobile`](./.claw/agents/clawteam-rnd-mobile.md) | Mobile | Mobile/cross-platform; release constraints |\n| [`clawteam-devops`](./.claw/agents/clawteam-devops.md) | DevOps | CI/CD and release; pipelines, artifacts, environments |\n| [`clawteam-qa`](./.claw/agents/clawteam-qa.md) | QA | Test strategy and gates; cases, regression scope, severity |\n| [`clawteam-sre`](./.claw/agents/clawteam-sre.md) | SRE | Availability, capacity, observability; SLOs, alerts, runbooks |\n| [`clawteam-project-manager`](./.claw/agents/clawteam-project-manager.md) | Project manager | Scope, schedule, stakeholders; milestones and change control |\n| [`clawteam-scrum-master`](./.claw/agents/clawteam-scrum-master.md) | Scrum Master | Iteration rhythm and blockers; ceremony and collaboration norms |\n\nShort aliases (e.g. `qa`, `sre`, `product-manager`) map to the `clawteam-*` roles above—see `docs/CLAWTEAM_SLASH_GUIDE.md`.\n**Why it matters:** Moves from “one model, one thread” to **multi-role collaborative problem solving**.\n\n\u003cimg width=\"2549\" height=\"1728\" alt=\"Screenshot - 2026-04-01 13 00 35\" src=\"https://github.com/user-attachments/assets/d8115e02-fcdc-4781-8d42-41d0732200d0\" /\u003e\n\n### 3) `clawteam` deeploop: convergent closed-loop iteration\n\nSimulates the real‑world iterative development process of a project team, enabling deep collaborative development (this feature is still under improvement).\n\n`/clawteam --deep_loop` runs multiple converging rounds—not “one pass and done.”\n\n\u003cimg width=\"1938\" height=\"380\" alt=\"Screenshot - 2026-03-30 18 39 08\" src=\"https://github.com/user-attachments/assets/656adcf5-0cb0-457b-b990-c09a54837920\" /\u003e\n\n- Structured contract per round (goals, handoffs, gaps, …)\n- Parse `DEEP_LOOP_WRITEBACK_JSON` and write back automatically when configured\n- Tunable convergence thresholds, max iterations, rollback, consistency\n\n**Why it matters:** Turns “feels done” into **metric-driven convergence**.\n\n### 4) ECAP Closed-loop learning: \n\nClawCode treats **experience** as a first-class artifact—not only conclusions, but **portable structure**:\n\n\u003cimg width=\"2730\" height=\"1535\" alt=\"ECAP技术示例\" src=\"https://github.com/user-attachments/assets/480acf50-946f-44a1-8a06-d3254f0834f9\" /\u003e\n\n- **Experience:** An experience function representing the gap between a goal and its outcome. It is a learnable function extracted from the process of resolving the goal–outcome gap, using that gap as the driver for improvement. The dimensional experience objects include: model_experience, agent_experience, skill_experience, and team_experience.\n- **ECAP** A personal/task-level experience capsule representing an evolvable triplet knowledge structure: (Instinct, Experience, Skill).\n- **TECAP** (Team Experience Capsule): A team collaboration experience capsule that includes collaboration steps, topology, and handoffs, and associates a role-level ECAP triplet with each team role.\n- **instinct → experience → skill:** A reusable construction chain from (instinct) rules, through experience, to skills.\n- **Model → Agent → Team:** A reusable learning path from a model, to an agent, to team collaboration of agents.\n\n#### Implementation mapping (concept to code)\n\n| Object | Implementation | Commands / surfaces | Storage | Docs |\n|---|---|---|---|---|\n| Experience signals | Distill reusable signals from execution traces | `/learn`, `/learn-orchestrate`, `/instinct-status` | Observations under local data directory | `docs/ECAP_v2_USER_GUIDE.md` |\n| ECAP | `ecap-v2` schema: `solution_trace.steps`, `tool_sequence`, `outcome`, `transfer`, `governance`, … | `/experience-create`, `/experience-apply`, `/experience-feedback`, `/experience-export`, `/experience-import` | `\u003cdata\u003e/learning/experience/capsules/`, `exports/`, `feedback.jsonl` | `docs/ECAP_v2_USER_GUIDE.md` |\n| TECAP | `tecap-v1` → `tecap-v2` upgrade; fields like `team_topology`, `coordination_metrics`, `quality_gates`, `match_explain` | `/team-experience-create`, `/team-experience-apply`, `/team-experience-export`, `/tecap-*` | On-disk capsules + JSON/Markdown export (`--v1-compatible` optional) | `docs/TECAP_v2_UPGRADE.md` |\n| Deeploop write-back | Structured rounds + `DEEP_LOOP_WRITEBACK_JSON` + finalize | `/clawteam --deep_loop`, `/clawteam-deeploop-finalize` | Pending session metadata + `LearningService` path | `docs/CLAWTEAM_SLASH_GUIDE.md` |\n| Governance \u0026 migration | Privacy tiers, redaction, feedback scores, compatibility | `--privacy`, `--v1-compatible`, `--strategy`, `--explain` | Audit snapshots; export wrappers (`schema_meta`, `quality_score`, …) | `docs/ECAP_v2_USER_GUIDE.md`, `docs/TECAP_v2_UPGRADE.md` |\n\n\n#### Implementation view\n\n```mermaid\nflowchart LR\n  taskExec[Task execution and tool observations] --\u003e expSignal[Experience signal extraction]\n  expSignal --\u003e ecapCreate[ECAP create and structured store]\n  ecapCreate --\u003e ecapApply[ECAP retrieve and apply before new work]\n  ecapApply --\u003e taskOutcome[Outcome and verification]\n  taskOutcome --\u003e feedback[experience_feedback scores]\n  feedback --\u003e evolveSkill[instinct_experience_skill evolution]\n  evolveSkill --\u003e teamCollab[clawteam collaboration]\n  teamCollab --\u003e tecapCreate[TECAP create or upgrade to tecap_v2]\n  tecapCreate --\u003e teamApply[team_experience_apply context injection]\n  teamApply --\u003e loopGate[deep_loop convergence and write-back]\n  loopGate --\u003e expSignal\n```\n\n**Why it matters:** The system doesn’t only “do it once”—it **improves the next run** from feedback.\n\n### 5) Code Awareness: coding perception and trace visibility\n\nIn the TUI, Code Awareness helps with:\n\n- Read/write path awareness and behavioral traces\n- Clearer context around the working set and file relationships\n- Layering and impact scope\n\n**Why it matters:** Makes **what the AI is doing** visible and governable—not a black box.\n\n### 6) Master–slave agents + Plan / Execute\n\n- Master agent: strategy and control\n- Sub-agents / tasks: decomposition and execution\n- Plan-then-execute for stable progress\n\n**Why it matters:** Converge on a plan first, then land changes with less churn.\n\n### 7) Ecosystem alignment (migration-friendly) + extensions\n\n- Aligns with Claude Code / Codex / OpenCode workflow semantics (complementary positioning)\n- Reusable **plugin** and **skill** systems\n- **MCP** integration\n- Optional **computer use / desktop** (policy- and permission-gated)\n\n**Why it matters:** Lower migration cost first, then amplify unique capabilities; stay open to your existing toolchain.\n\n---\n\n## Capability matrix (definition–problem–value–entry)\n\n| Dimension | Definition | Problem solved | User value | Where to look |\n|---|---|---|---|---|\n| Personal velocity | Terminal-native loop (TUI + CLI + tools) | Chat vs real execution drift | Analyze, change, verify in one surface | `README.md`, `pyproject.toml`, `clawcode -p` |\n| Team orchestration | `clawteam` roles (parallel/serial) | One model can’t cover every function | Integrated multi-role output | `docs/CLAWTEAM_SLASH_GUIDE.md` |\n| Long-term evolution | `deeploop` + automatic write-back | Lessons lost when the task ends | Reusable structured experience | `docs/CLAWTEAM_SLASH_GUIDE.md` (deep_loop / write-back) |\n| Learning loop | Experience / ECAP / TECAP | Hard to migrate or audit “tribal knowledge” | Structured, portable, feedback-ready | `docs/ECAP_v2_USER_GUIDE.md`, `docs/TECAP_v2_UPGRADE.md` |\n| Observability | Code Awareness | Opaque tool paths | Clearer read/write traces and impact | `docs/技术架构详细说明.md`, TUI modules |\n| Extensibility | plugin / skill / MCP / computer use | Closed toolchain | Fit existing ecosystem and grow by scenario | `docs/plugins.md`, `CLAW_MODE.md`, `pyproject.toml` extras |\n\n---\n\n## Full-stack development loop (diagram)\n\n```mermaid\nflowchart LR\n  idea[Idea] --\u003e plan[Plan mode]\n  plan --\u003e team[clawteam roles]\n  team --\u003e execute[Execute and tools]\n  execute --\u003e deeploop[deeploop convergence]\n  deeploop --\u003e writeback[DEEP_LOOP_WRITEBACK_JSON write-back]\n  writeback --\u003e ecap[ECAP / TECAP store]\n  ecap --\u003e evolve[Experience evolution and reuse]\n  evolve --\u003e plan\n```\n\n---\n\n\n## How ClawCode compares\n\n| Dimension | Typical IDE chat | Typical API-only scripts | ClawCode |\n|---|---|---|---|\n| Primary surface | IDE panel | Custom scripts | **Terminal-native TUI + CLI** |\n| Execution depth | Often suggestion-first | Deep but DIY | **Built-in tool execution loop** |\n| Long-horizon continuity | Varies | Custom state | **Local persistence + write-back** |\n| Team orchestration | Weak / none | Build yourself | **`clawteam` roles and scheduling** |\n| Learning loop | Weak / none | Expensive to build | **ECAP/TECAP + deep loop** |\n| Observability \u0026 governance | Varies | DIY | **Config-driven, permission-aware, audit-friendly** |\n| Ecosystem | Vendor-bound | Flexible but heavy | **plugin / skill / MCP / computer-use paths** |\n\n\u003e **Scope note:** Capability and architecture comparison only—no “X% faster” claims; based on documented, verifiable behavior.\n\n---\n\n## Pro development: slash commands \u0026 tools \u0026 skills\n\nBeyond migration-friendly defaults, ClawCode ships **built-in pro workflows**: common multi-step flows as `/slash` commands, with **skills** to encode team practice.\n\n### 1) Built-in `/slash` commands (engineering workflows)\n\n| Cluster | Examples | Typical use |\n|---|---|---|\n| Multi-role \u0026 convergence | `/clawteam`, `/clawteam --deep_loop`, `/clawteam-deeploop-finalize` | Roles, converging iterations, structured write-back |\n| Architecture \u0026 quality gates | `/architect`, `/code-review`, `/security-review`, `/review` | Design/review, ranked findings, security pass |\n| Execution orchestration | `/orchestrate`, `/multi-plan`, `/multi-execute`, `/multi-workflow` | Phased plan → execute → deliver |\n| Test-driven dev | `/tdd` | RED → GREEN → Refactor with gates |\n| ECAP learning | `/learn`, `/learn-orchestrate`, `/experience-create`, `/experience-apply` | Distill experience and feed the next task |\n| TECAP team learning | `/team-experience-create`, `/team-experience-apply`, `/tecap-*` | Team-level capsules, migration, reuse |\n| Observability \u0026 diagnostics | `/experience-dashboard`, `/closed-loop-contract`, `/instinct-status`, `/doctor`, `/diff` | Metrics, config contract checks, environment and diff diagnostics |\n\n\u003e Full list: `clawcode/tui/builtin_slash.py`. Deep dives: `docs/CLAWTEAM_SLASH_GUIDE.md`, `docs/ARCHITECT_SLASH_GUIDE.md`, `docs/MULTI_PLAN_SLASH_GUIDE.md`.\n\n### 3) Built-in tools\n### 🔧 Tools (44 max)\n| Category | Tools | Description |\n| --- | --- | --- |\n| File I/O | `view`, `ls`, `write`, `edit`, `patch`, `glob`, `grep`, `fetch` | Read, list, mutate, and search files in the workspace with permission checks |\n| Shell \u0026 execution | `bash`, `terminal`, `process`, `execute_code` | Shell commands, PTY sessions, process control, and controlled code execution |\n| Search \u0026 diagnostics | `diagnostics`, `web_search`, `web_extract`, `session_search` | LSP diagnostics, web search/extract, and in-session message search |\n| Browser | `browser_*` (×11) | Local browser automation (registered when browser requirements pass) |\n| Agent | `Agent` | Spawn sub-agents with a filtered tool set (no nested delegation tools) |\n| Task \u0026 state | `TodoWrite`, `TodoRead`, `UpdateProjectState` | Persistent todos and project memo injected into future sessions |\n| Schedule | `cronjob` | Scheduled and deferred job entrypoint |\n| Skills \u0026 memory | `memory`, `skills_list`, `skill_view`, `skill_manage`, `experience_evolve_to_skills` | Durable memory and skill listing, inspection, management, and evolution |\n| Optional integrations | `mcp_call`, `sourcegraph`, `desktop_screenshot`, `desktop_move`, `desktop_click`, `desktop_type`, `desktop_key` | MCP proxy, Sourcegraph search, and desktop automation when configured and requirements pass |\n\n**Notes:** **44** is the maximum number of distinct built-in tool registrations from `get_builtin_tools()` (all optional rows active). A typical setup loads **37** (includes `browser_*` when requirements pass and always includes `web_search` / `web_extract`). MCP servers add more tool names at runtime.\n\n\n### 3) Bundled skills (reusable expertise)\n\n| Category | Examples | Delivery value |\n|---|---|---|\n| Backend \u0026 API | `backend-patterns`, `api-design`, `django-patterns`, `springboot-patterns` | Consistent API and backend design; less rework |\n| Frontend | `frontend-patterns` | Shared UI implementation patterns |\n| Languages | `python-patterns`, `golang-patterns` | Idiomatic reusable patterns per stack |\n| Data \u0026 migrations | `database-migrations`, `clickhouse-io` | Safer schema/data changes; verify rollback |\n| Shipping | `docker-patterns`, `deployment-patterns`, `coding-standards` | Build, release, and quality bars |\n| Cross-tool | `codex`, `opencode` | Easier multi-tool workflows |\n| Planning | `strategic-compact` | Dense, actionable plans for complex work |\n\n\u003e Paths: `clawcode/plugin/builtin_plugins/clawcode-skills/skills/`.  \n\u003e Suggested flow: frame execution with `/clawteam` or `/multi-plan`, then layer domain skills for consistency.\n\n---\n# 📊 Test Results\n\n| Suite | Tests | Status |\n| --- | --: | --- |\n| Unit + Integration | 833 | ✅ Agent, tools, and deep-loop regression (`max_iters=100` and runtime hard constraints) |\n| CLI Flags | 22 | ✅ CLI and provider `cli_bridge` paths |\n| Harness Features | 6 | ✅ Multi-step workflows, harness alignment, and closed-loop smoke |\n| Textual TUI | 3 | ✅ Welcome screen, HUD overlay, and status line |\n| TUI Interactions | 27 | ✅ Chat actions, permission dialogs, and Plan / Arc panels |\n| Real Skills + Plugins | 53 | ✅ Built-in skill registration/execution and plugin sandbox |\n\n**Collected:** 944 pytest items (including parametrized cases). **Latest full run:** 935 passed, 9 skipped, 0 failed.\n\n---\n\n## Quick start\n\n### Requirements\n\n- Python `\u003e=3.12`\n- At least one configured model provider credential\n\n### Install (source / dev)\n\n```bash\ncd clawcode\npython -m venv .venv\n# Windows PowerShell\n.\\.venv\\Scripts\\Activate.ps1\npip install -e \".[dev]\"\n```\n\n### Run\n\n```bash\nclawcode\n# or\npython -m clawcode\n```\n\n### Prompt mode\n\n```bash\nclawcode -p \"Summarize this repository’s architecture in five bullets.\"\n```\n\n### JSON output mode\n\n```bash\nclawcode -p \"Summarize recent changes\" -f json\n```\n\n---\n\n## Configuration \u0026 capability switches\n\nClawCode is configuration-driven. Main entry points:\n\n- `pyproject.toml` (metadata and dependencies)\n- `clawcode/config/settings.py` (runtime settings model)\n\nTypical knobs:\n\n- Provider / model selection\n- `/clawteam --deep_loop` convergence parameters\n- Experience / ECAP / TECAP behavior\n- Desktop / computer-use and other optional features\n\n---\n\n## Tiered onboarding\n\n### ~5 minutes (run it)\n\n1. Install and start `clawcode`  \n2. Run `clawcode -p \"...\"` once  \n3. In the TUI, try `/clawteam \u003cyour ask\u003e`\n\n### ~30 minutes (close the loop)\n\n1. Pick a small real task (fix / refactor / tests)  \n2. Run `/clawteam --deep_loop` for 2–3 rounds  \n3. Inspect `DEEP_LOOP_WRITEBACK_JSON` and write-back results\n\n### Team rollout (repeatable)\n\n1. Align model and policy (provider/model)  \n2. Inventory reusable skills/plugins and minimal conventions  \n3. Wire feedback into ECAP/TECAP\n\n---\n\n## High-value scenarios\n\n- Greenfield complexity: plan first, execute across converging rounds  \n- Legacy modernization: multi-role risk ordering and sequencing  \n- Handoffs: sessions and experience that can be reviewed and migrated  \n- Long-running work: iterate without losing thread  \n- Automation: CLI and scriptable batches\n\n---\n\n\n## What’s New\n\n- `clawteam --deep_loop` automatic write-back path and manual `/clawteam-deeploop-finalize` fallback  \n- Convergence-related settings such as `clawteam_deeploop_consistency_min`  \n- Deeploop event aggregation and test coverage improvements  \n- Documentation for `clawteam_deeploop_*` and closed-loop behavior  \n\n---\n\n## Roadmap\n\n- Richer Code Awareness (read/write traces mapped to architecture layers)  \n- Team-level experience dashboards (aggregated metrics)  \n- Slash workflow templates (task type → flow template)  \n- Stronger computer-use safety policies and extension hooks  \n\n---\n\n## Contributing\n\nContributions welcome. Before opening a PR:\n\n```bash\npytest\nruff check .\nmypy .\n```\n\nFor larger design changes, open an issue first to align scope and goals.\n\n---\n\n## Security\n\nAI tooling may run commands and modify files. Use ClawCode in a controlled environment, review outputs, and apply least privilege to credentials and capability switches.\n\n---\n\n## License\n\nGPL-3.0 license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepelementlab%2Fclawcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepelementlab%2Fclawcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepelementlab%2Fclawcode/lists"}