clew-code 0.2.28 → 0.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,8 +12,8 @@ A multi-provider AI coding CLI that codes, learns your preferences, coordinates
12
12
  [![Contributors](https://img.shields.io/github/contributors/ClewCode/ClewCode.svg)](https://github.com/ClewCode/ClewCode/graphs/contributors)
13
13
  [![Release](https://img.shields.io/github/v/release/ClewCode/ClewCode)](https://github.com/ClewCode/ClewCode/releases)
14
14
  [![npm](https://img.shields.io/npm/v/clew-code)](https://www.npmjs.com/package/clew-code)
15
- [![CI](https://img.shields.io/github/actions/workflow/status/ClewCode/ClewCode/release.yml?branch=main)](https://github.com/ClewCode/ClewCode/actions)
16
- [![License: MIT](https://img.shields.io/badge/license-GPL3-blue.svg)](#license)
15
+ [![CI](https://img.shields.io/github/actions/workflow/status/ClewCode/ClewCode/ci.yml?branch=main)](https://github.com/ClewCode/ClewCode/actions/workflows/ci.yml)
16
+ [![License](https://img.shields.io/badge/license-GPL--3.0-blue.svg)](#license)
17
17
  [![Platform](https://img.shields.io/badge/platform-macOS%20·%20Windows%20·%20Linux-lightgrey.svg)](#installation)
18
18
  [![Built with Bun](https://img.shields.io/badge/built%20with-Bun-ff69b4.svg)](https://bun.sh)
19
19
 
@@ -25,7 +25,7 @@ A multi-provider AI coding CLI that codes, learns your preferences, coordinates
25
25
 
26
26
  ## Hacking in public
27
27
 
28
- Clew Code is a reverse-engineered reimplementation of [Claude Code](https://github.com/anthropics/claude-code) (Anthropic), rebuilt from the ground up to be **multi-provider** — you're not locked into one API. As of this writing the project ships agent-to-agent LAN mesh coordination, a preference-learning engine, autonomous background loops, multi-pass context compaction, MCP integration, plan mode with full bypass permissions, goal verification, Max Mode parallel candidates, structured checkpoints, automated memory consolidation, and 27+ provider adapters.
28
+ Clew Code is a reverse-engineered reimplementation of [Claude Code](https://github.com/anthropics/claude-code) (Anthropic), rebuilt from the ground up to be **multi-provider** — you're not locked into one API. As of this writing the project ships agent-to-agent LAN peer coordination, a preference-learning engine, autonomous background loops, multi-pass context compaction, MCP integration, plan mode with full bypass permissions, goal verification, Max Mode parallel candidates, structured checkpoints, automated memory consolidation, and 27+ provider adapters.
29
29
 
30
30
  > Reverse-engineered from Claude Code. Rebuilt for every provider.
31
31
 
@@ -34,10 +34,10 @@ Clew Code is a reverse-engineered reimplementation of [Claude Code](https://gith
34
34
  ## Features
35
35
 
36
36
  - **27+ providers** — Anthropic, OpenAI, Google Gemini & Code Assist, DeepSeek, Groq, xAI (Grok), Mistral, Cohere, Perplexity, Cerebras, Moonshot (Kimi), Zhipu (GLM), NVIDIA NIM, OpenRouter, OpenCode, KiloCode, Ollama (local), Together AI, Fireworks AI, Deep Infra, SiliconFlow, Hugging Face, Poe, DigitalOcean, Cline, OpenCode Go. Switch mid-session.
37
- - **Agent-to-agent mesh** — find other Clew instances on the same machine (file registry) or across machines (UDP multicast). Assign tasks, set roles, execute remote commands — 15 mesh AI tools (discover, run, spawn, share, join, ping, broadcast, send_message, list_roles, list_messages, set_name, set_role, disconnect, info, help) let your agent coordinate autonomously via `/mesh` commands.
37
+ - **Peer-to-peer LAN** — find other Clew instances on the same machine (file registry) or across machines (UDP multicast). Assign tasks, set roles, execute remote commands — 15 peer AI tools let your agent coordinate autonomously via `/peer` commands.
38
38
 
39
39
  - **Autonomous agent loop** — file-backed persistent task queue, lease-based concurrency, exponential backoff retry, dead-letter management. Cron scheduler for recurring jobs. Max 3 concurrent workers.
40
- - **50+ built-in tools** — Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, Browser (Playwright), PR (create/list/view/review/merge/status), NotebookEdit, JsonPath, ReadArtifact, mesh tools (15 LAN coordination tools), MCP tools, ProcessMesh (exec/pty), plan mode with full bypass permissions, multi-pass context compaction.
40
+ - **50+ built-in tools** — Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, Browser (Playwright), PR (create/list/view/review/merge/status), NotebookEdit, JsonPath, ReadArtifact, peer tools (15 LAN coordination tools), MCP tools, ProcessPeer (exec/pty), plan mode with full bypass permissions, multi-pass context compaction.
41
41
  - **Goal system** — `/goal` tracks task completion with heuristic pre-checks (exit codes, test output, lint results). Goal chains with `then` syntax. Auto-integrates with AFK mode and the autonomous loop.
42
42
  - **Goal Verifier** — When the agent attempts to terminate, an independent LLM verifier reviews the conversation against the goal text. If unsatisfied, the gap is reported as metadata for automatic re-prompting.
43
43
  - **Max Mode** — parallel candidate generation (default 3 per turn) using forked agents. Selects the best response via LLM judge (model-as-judge) with heuristic fallback. Toggle with `/maxmode`.
@@ -46,20 +46,19 @@ Clew Code is a reverse-engineered reimplementation of [Claude Code](https://gith
46
46
  - **Automated memory consolidation** — Dream process (7-day cycle) merges duplicate insights and creates weekly digests. Distill process (30-day cycle) extracts reusable patterns and generates skill suggestions.
47
47
  - **MCP — Model Context Protocol** — connect external tools via stdio (local subprocesses), SSE (remote servers with OAuth), or DirectConnect (in-process plugin servers).
48
48
  - **Skills, plugins, hooks** — extend without touching source. Skills via `SKILL.md`, plugins with manifest, hooks at every lifecycle stage (PreToolUse, PostToolUse, PreBash, PostPrompt, PreAcceptEdit).
49
- - **7 permission modes** — default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk. Granular allow/deny rules with pattern matching.
49
+ - **8 permission modes** — default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk, guardian. Granular allow/deny rules with pattern matching.
50
50
 
51
51
  ---
52
52
 
53
- ## Concepts: Agents, Subagents, Mesh, and ACP
53
+ ## Concepts: Agents, Subagents, and Peers
54
54
 
55
55
  Clew Code has several execution layers. They are related, but they do different jobs:
56
56
 
57
57
  - **Agent:** An AI worker with a prompt, model, tools, and permissions. The main chat session is an agent. Custom agents live in `.clew/agents/*.md`, and built-ins include `Explore`, `Plan`, and `general-purpose`.
58
58
  - **Subagent:** A short-lived child agent launched by another agent through the `Agent` tool. Use subagents for independent work such as codebase exploration, test triage, or review. The built-in `Explore` agent is read-only and is the right choice for parallel "go inspect this area" tasks.
59
59
  - **Teammate / Swarm:** A longer-lived agent team member with an identity, mailbox, task coordination, and optional pane/tmux or in-process execution. Use this when agents need to keep working together across multiple turns, not for isolated one-shot exploration.
60
- - **LAN Mesh:** A network of Clew instances on the same machine or LAN. `/mesh` discovers peers, sends messages, assigns tasks, and runs commands on other Clew nodes.
61
- - **Process Mesh:** A local process-backed worker layer. It delegates a prompt to an external CLI/provider such as Codex using `exec` or `pty`, then returns stdout, stderr, exit code, timeout state, and progress.
62
- - **ACP:** An external protocol boundary. Editors, IDEs, REST clients, or other agents can send work into Clew through ACP. ACP should normalize the external request and route execution through Clew's internal layers instead of hardcoding a provider in every ACP entry point.
60
+ - **LAN Peer:** A network of Clew instances on the same machine or LAN. `/peer` discovers peers, sends messages, assigns tasks, and runs commands on other Clew nodes.
61
+ - **Process Peer:** A local process-backed worker layer. It delegates a prompt to an external CLI/provider such as Codex using `exec` or `pty`, then returns stdout, stderr, exit code, timeout state, and progress.
63
62
 
64
63
  Typical flows:
65
64
 
@@ -70,17 +69,9 @@ User
70
69
  -> short-lived subagent, e.g. Explore
71
70
  ```
72
71
 
73
- ```text
74
- External editor / external agent
75
- -> ACP
76
- -> shared ACP-to-mesh boundary
77
- -> Process Mesh provider, e.g. codex
78
- -> external CLI process
79
- ```
80
-
81
72
  ```text
82
73
  Clew instance A
83
- -> LAN Mesh
74
+ -> LAN Peer
84
75
  -> Clew instance B
85
76
  -> local agent, daemon task, or process worker
86
77
  ```
@@ -89,9 +80,8 @@ Use the layers by intent:
89
80
 
90
81
  - Need a quick independent read-only investigation? Use an `Explore` subagent.
91
82
  - Need long-running coordination between named workers? Use teammates/swarm.
92
- - Need another Clew instance on the LAN? Use `/mesh`.
93
- - Need an external editor or agent to call into Clew? Use ACP.
94
- - Need Clew to run a local external worker such as Codex? Use Process Mesh.
83
+ - Need another Clew instance on the LAN? Use `/peer`.
84
+ - Need Clew to run a local external worker such as Codex? Use Process Peer.
95
85
 
96
86
  Other runtime concepts:
97
87
  - **Plan mode:** Full-access planning mode with bypass permissions — explore, read, write, and edit files freely. Plan files persist to `.clew/plans/long-term-plan.md` with task progress snapshot.
@@ -102,6 +92,27 @@ Other runtime concepts:
102
92
 
103
93
  ---
104
94
 
95
+ ## Profiles: Coding vs Personal
96
+
97
+ Clew Code has two profiles you switch between with `/profile`:
98
+
99
+ - **Coding profile** (`/profile coding`) — default. Directly implement software changes: inspect repo, edit files, run validation.
100
+ - **Personal profile** (`/profile personal`) — command center mode. Plan, split tasks, **delegate** code work to a Codex worker via `process_peer`, then review and summarize results.
101
+
102
+ ### How personal delegation works
103
+
104
+ ```
105
+ You → personal profile → understand requirement → plan approach
106
+ → /delegate skill → ProcessPeer → Codex worker
107
+ → worker implements → report back → you review
108
+ ```
109
+
110
+ In personal profile, you never edit files directly — the `delegate` skill spawns a Codex worker with a structured task prompt (goal, scope, constraints, validation criteria) and reports what was done, what passed/failed, and what's blocked. Use personal profile when you want to orchestrate rather than implement.
111
+
112
+ Profile and last-used permission mode are saved between sessions.
113
+
114
+ ---
115
+
105
116
  ## Install
106
117
 
107
118
  ```bash
@@ -155,9 +166,9 @@ clew
155
166
  ❯ /status # current provider, model, context info
156
167
  ❯ /goal "tests pass" # track task completion
157
168
  ❯ /maxmode on # parallel candidate generation
158
- ❯ /mesh discover # find other Clew instances on LAN
169
+ ❯ /peer discover # find other Clew instances on LAN
159
170
  ❯ /mcp list # connected MCP servers
160
- ❯ /loop start # background autonomous loop
171
+ ❯ /daemon # background autonomous loop
161
172
 
162
173
  # One-shot mode (pipe-friendly)
163
174
  clew -p "summarize CHANGELOG.md"
@@ -186,7 +197,7 @@ export GEMINI_API_KEY=...
186
197
  ## Commands
187
198
 
188
199
  <details>
189
- <summary><strong>22 slash commands</strong></summary>
200
+ <summary><strong>21 slash commands</strong></summary>
190
201
 
191
202
  ```
192
203
  /model Switch provider or model
@@ -204,9 +215,8 @@ export GEMINI_API_KEY=...
204
215
  /bridge Bridge mode config
205
216
  /agent Background agent dispatch & subcommands
206
217
  /agents TUI Agent dashboard (operational view)
207
- /mesh Collaborate with Clew instances on LAN
218
+ /peer Collaborate with Clew instances on LAN
208
219
  /remote WebSocket remote control
209
- /loop 24/7 autonomous agent loop
210
220
  /daemon Autonomous daemon dashboard
211
221
  /task Scheduled tasks
212
222
  /memory Long-term memory search and management
@@ -240,7 +250,7 @@ src/
240
250
  │ ├── maxMode/ # Candidate runner + evaluator
241
251
  │ ├── lsp/ # LSP integration
242
252
  │ └── Supervisor/ # Agent supervisor IPC
243
- ├── mesh/ # MeshServer + MeshDiscovery (agent-to-agent)
253
+ ├── peer/ # PeerServer + PeerDiscovery (agent-to-agent)
244
254
  ├── memory/ # Long-term memory (SQLite, FTS5)
245
255
  ├── bridge/ # WebSocket bridge + relay
246
256
  ├── components/ # Ink terminal UI components