clew-code 0.3.6 → 0.4.1
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 +118 -320
- package/dist/main.js +2602 -2775
- package/package.json +161 -166
- package/scripts/bun-run.mjs +1 -1
- package/scripts/install.ps1 +129 -21
package/README.md
CHANGED
|
@@ -4,31 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
# Clew Code
|
|
6
6
|
|
|
7
|
-
**The open-source AI coding agent — in your terminal and on your LAN.**
|
|
7
|
+
**The open-source, multi-provider AI coding agent — in your terminal and on your LAN.**
|
|
8
8
|
|
|
9
|
-
A
|
|
9
|
+
A local-first coding CLI that writes code, learns your preferences, coordinates across machines, and runs autonomously on your own hardware. One Bun bundle, 27 provider adapters, a persistent memory system, and a peer-to-peer LAN swarm.
|
|
10
10
|
|
|
11
11
|
[](https://github.com/ClewCode/ClewCode/stargazers)
|
|
12
|
-
[](https://github.com/ClewCode/ClewCode/graphs/contributors)
|
|
13
12
|
[](https://github.com/ClewCode/ClewCode/releases)
|
|
14
13
|
[](https://www.npmjs.com/package/clew-code)
|
|
15
14
|
[](https://github.com/ClewCode/ClewCode/actions/workflows/ci.yml)
|
|
16
15
|
[](#license)
|
|
17
|
-
[](#
|
|
18
|
-
[](https://clew-code.org)
|
|
16
|
+
[](#install)
|
|
19
17
|
[](https://bun.sh)
|
|
20
18
|
|
|
21
|
-
[GitHub](https://github.com/ClewCode/ClewCode) · [Website](https://clew-code.org) · [
|
|
19
|
+
[GitHub](https://github.com/ClewCode/ClewCode) · [Website](https://clew-code.org) · [Releases](https://github.com/ClewCode/ClewCode/releases) · [Wiki](https://github.com/ClewCode/ClewCode/wiki) · [Issues](https://github.com/ClewCode/ClewCode/issues)
|
|
22
20
|
|
|
23
21
|
</div>
|
|
24
22
|
|
|
25
23
|
---
|
|
26
24
|
|
|
27
|
-
##
|
|
25
|
+
## What is Clew Code?
|
|
28
26
|
|
|
29
|
-
Clew Code is
|
|
27
|
+
Clew Code is an AI coding agent that lives in your terminal. Unlike single-vendor tools, it is **provider-agnostic** — bring an API key from OpenAI, Google, DeepSeek, Groq, OpenRouter, a local Ollama model, or any of 27 supported providers, and switch between them mid-session.
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
It is built around three ideas:
|
|
30
|
+
|
|
31
|
+
- **Local-first.** Your code, memory, and configuration stay on your machine. Ships as a single Bun bundle with no required cloud backend.
|
|
32
|
+
- **It remembers.** A SQLite-backed memory system learns your decisions, taste, and project structure, then budgets that context back into every prompt.
|
|
33
|
+
- **It scales across machines.** Discover other Clew instances on your LAN, assign tasks, sync memory, and broadcast commands to a swarm.
|
|
32
34
|
|
|
33
35
|
---
|
|
34
36
|
|
|
@@ -36,33 +38,25 @@ Clew Code is a **multi-provider** AI coding agent — you're not locked into one
|
|
|
36
38
|
|
|
37
39
|
### One-liner (recommended)
|
|
38
40
|
|
|
39
|
-
Installs Bun
|
|
41
|
+
Installs Bun if missing, then installs `clew-code` and drops you into a ready terminal.
|
|
40
42
|
|
|
41
|
-
macOS / Linux
|
|
43
|
+
**macOS / Linux**
|
|
42
44
|
```bash
|
|
43
45
|
curl -fsSL https://raw.githubusercontent.com/ClewCode/ClewCode/main/scripts/install.sh | bash
|
|
44
46
|
```
|
|
45
47
|
|
|
46
|
-
Windows (PowerShell as Admin)
|
|
48
|
+
**Windows (PowerShell as Admin)**
|
|
47
49
|
```powershell
|
|
48
50
|
irm https://raw.githubusercontent.com/ClewCode/ClewCode/main/scripts/install.ps1 | iex
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
###
|
|
53
|
+
### npm
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
56
|
npm install -g clew-code
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
# Then run inside any project
|
|
59
|
-
cd my-project
|
|
60
|
-
clew
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Requires [Bun](https://bun.sh) 1.3+, Node.js 18+, Git, and one provider API key.
|
|
64
|
-
|
|
65
|
-
### Build from source
|
|
59
|
+
### From source
|
|
66
60
|
|
|
67
61
|
```bash
|
|
68
62
|
git clone https://github.com/ClewCode/ClewCode.git
|
|
@@ -70,69 +64,27 @@ cd ClewCode
|
|
|
70
64
|
bun install && bun run build && bun run start
|
|
71
65
|
```
|
|
72
66
|
|
|
67
|
+
**Requirements:** [Bun](https://bun.sh) 1.3+, Git, and at least one provider API key. Node.js 18+ is supported as a fallback runtime.
|
|
68
|
+
|
|
73
69
|
<details>
|
|
74
70
|
<summary><b>Platform notes</b></summary>
|
|
75
71
|
|
|
76
|
-
- **macOS** — works out of the box (Apple Silicon & Intel)
|
|
77
|
-
- **Linux** — no special dependencies
|
|
78
|
-
- **Windows** — requires Git Bash, WSL, or PowerShell.
|
|
72
|
+
- **macOS** — works out of the box (Apple Silicon & Intel).
|
|
73
|
+
- **Linux** — no special dependencies.
|
|
74
|
+
- **Windows** — requires Git Bash, WSL, or PowerShell. The ComputerUse tool also works on macOS/Linux with `ENABLE_COMPUTER_USE=1`.
|
|
79
75
|
</details>
|
|
80
76
|
|
|
81
77
|
---
|
|
82
78
|
|
|
83
79
|
## Quick start
|
|
84
80
|
|
|
85
|
-
```
|
|
86
|
-
#
|
|
81
|
+
```bash
|
|
82
|
+
# Launch in any project — pick a provider on first run
|
|
83
|
+
cd my-project
|
|
87
84
|
clew
|
|
88
|
-
|
|
89
|
-
# Configure a provider (inside the REPL)
|
|
90
|
-
❯ /provider openai
|
|
91
|
-
❯ /model gpt-5.5
|
|
92
|
-
|
|
93
|
-
# Or try DeepSeek
|
|
94
|
-
❯ /model deepseek-v4-pro
|
|
95
|
-
|
|
96
|
-
# Or go local with Ollama
|
|
97
|
-
❯ /model ollama/llama3.3
|
|
98
|
-
|
|
99
|
-
# Sign in via Clew Gateway (api.clew-code.org)
|
|
100
|
-
❯ /login
|
|
101
|
-
|
|
102
|
-
# Token import from web dashboard
|
|
103
|
-
clew auth login --token <token>
|
|
104
|
-
|
|
105
|
-
# In-session commands
|
|
106
|
-
❯ /help # list everything
|
|
107
|
-
❯ /status # current provider, model, context info
|
|
108
|
-
❯ /goal "tests pass" # track task completion with verification
|
|
109
|
-
❯ /maxmode on # parallel candidate generation
|
|
110
|
-
❯ /peer discover # find other Clew instances on LAN
|
|
111
|
-
❯ /peer swarm clew -p "summarize CHANGELOG.md" # run on all peers
|
|
112
|
-
❯ /peer dashboard # show peer task checklist
|
|
113
|
-
❯ /peer memory sync # import memories from all peers
|
|
114
|
-
❯ /peer memory auto on # auto-sync memories every 60 min
|
|
115
|
-
❯ /mcp list # connected MCP servers
|
|
116
|
-
❯ /daemon # background autonomous loop
|
|
117
|
-
❯ /compact # compress context + auto-extract durable memories
|
|
118
|
-
❯ /memory dashboard # unified memory system status
|
|
119
|
-
❯ /memory init # bootstrap project memory (SQLite + scan)
|
|
120
|
-
❯ /memory rebuild # reconstruct context from ranked memories
|
|
121
|
-
❯ /memory recall --verbose # recall ranked memories
|
|
122
|
-
❯ /profile personal # command-center mode with delegation
|
|
123
|
-
❯ /login # sign in via Clew Gateway
|
|
124
|
-
❯ /logout # sign out
|
|
125
|
-
|
|
126
|
-
# One-shot mode (pipe-friendly)
|
|
127
|
-
clew -p "summarize CHANGELOG.md"
|
|
128
|
-
|
|
129
|
-
# Resume last session
|
|
130
|
-
clew --resume last
|
|
131
85
|
```
|
|
132
86
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
## Provider setup
|
|
87
|
+
Set a provider key via environment variable, or configure it inside the REPL:
|
|
136
88
|
|
|
137
89
|
```bash
|
|
138
90
|
export OPENAI_API_KEY=sk-...
|
|
@@ -141,94 +93,71 @@ export DEEPSEEK_API_KEY=...
|
|
|
141
93
|
export GROQ_API_KEY=...
|
|
142
94
|
export OPENROUTER_API_KEY=...
|
|
143
95
|
export OLLAMA_HOST=http://localhost:11434
|
|
144
|
-
export GEMINI_API_KEY=...
|
|
145
96
|
```
|
|
146
97
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- **27 providers** — OpenAI, Google Gemini & Code Assist, DeepSeek, Groq, xAI (Grok), Mistral, Cohere, Perplexity, Cerebras, Moonshot (Kimi), Zhipu (GLM), NVIDIA NIM, OpenRouter, OpenCode, OpenCode Go, KiloCode, Ollama (local), Together AI, Fireworks AI, Deep Infra, SiliconFlow, Hugging Face, Poe, DigitalOcean, Cline, custom. Switch mid-session. *(Anthropic accessible via OpenRouter.)*
|
|
152
|
-
- **Memory system (MiMo-inspired)** — SQLite-backed memory store with importance ranking, confidence scoring, access tracking, and timeline event logging. Auto-init + legacy migration + scan on first use. Budgeted memory injection into system prompt selects memories by importance × recency × confidence to fit the token budget. **In-compact extraction** automatically saves durable facts (`[decision]`, `[architecture]`, `[taste]`, `[bug]`) during context compaction. **Dream** (7-day) + **Distill** (30-day) auto-consolidate. Dream output synced to MemoryDB automatically. `/memory dashboard` shows unified status of MemoryDB, Dream, Distill, Peer Sync, and timeline.
|
|
153
|
-
- **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. **Swarm execution** broadcasts shell commands to all peers in parallel with aggregated results. **Peer memory sync** imports memories from all peers into local MemoryDB; auto-sync on cron. **Message broker** (in-process queue) enables offline message delivery with correlation IDs. **Peer dashboard** shows task checklists across all peers.
|
|
154
|
-
- **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.
|
|
155
|
-
- **Gateway auth** (`/login` / `/logout`): Sign in at `api.clew-code.org` with browser or terminal login. Token import from web dashboard via `clew auth login --token`. Gateway token stored locally for `ClewGatewayProvider`.
|
|
156
|
-
- **75+ built-in tools** — Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, Browser (Playwright), NotebookEdit, JsonPath, ReadArtifact, peer tools (15+ LAN coordination tools including swarm + dashboard), MCP tools, ProcessPeer (exec/pty), MemoryFeedback (agent-driven memory curation), plan mode with full bypass permissions, multi-pass context compaction.
|
|
157
|
-
- **Goal system** — `/goal` tracks task completion with heuristic pre-checks (exit codes, test output, lint results). Goal chains with `then` syntax. Templates for common workflows (`fix-build`, `green-tests`, `refactor`). Auto-integrates with AFK mode and the autonomous loop. Independent LLM verifier reviews completion and reports gaps.
|
|
158
|
-
- **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`.
|
|
159
|
-
- **Structured checkpoints** — automatic progress snapshots at 20%/45%/70% milestones with notes scratchpad (`notes.md`) for main-agent findings. Multi-cycle rebuild from checkpoints during compaction preserves layered context (decisions → notes → blockers → next steps). Project memory promotion at 70% checkpoint.
|
|
160
|
-
- **Personal profile** — `/profile personal` sets command-center mode with plan/split/delegate workflow to Codex workers via ProcessPeer. Profile + last permission mode saved between sessions.
|
|
161
|
-
- **MCP — Model Context Protocol** — connect external tools via stdio (local subprocesses), SSE (remote servers with OAuth), or DirectConnect (in-process plugin servers).
|
|
162
|
-
- **Skills, plugins, hooks** — extend without touching source. Skills via `SKILL.md`, plugins with manifest, hooks at every lifecycle stage (PreToolUse, PostToolUse, PreBash, PostPrompt, PreAcceptEdit).
|
|
163
|
-
- **8 permission modes** — default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk, guardian. Granular allow/deny rules with pattern matching.
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Concepts: Agents, Subagents, and Peers
|
|
168
|
-
|
|
169
|
-
Clew Code has several execution layers. They are related, but they do different jobs:
|
|
98
|
+
```bash
|
|
99
|
+
# One-shot mode (pipe-friendly)
|
|
100
|
+
clew -p "summarize CHANGELOG.md"
|
|
170
101
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- **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.
|
|
175
|
-
- **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.
|
|
102
|
+
# Resume your last session
|
|
103
|
+
clew --resume last
|
|
104
|
+
```
|
|
176
105
|
|
|
177
|
-
|
|
106
|
+
Inside the REPL:
|
|
178
107
|
|
|
179
108
|
```text
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
109
|
+
❯ /model gpt-5.5 # switch provider/model mid-session
|
|
110
|
+
❯ /model ollama/llama3.3 # go fully local
|
|
111
|
+
❯ /status # provider, model, context usage
|
|
112
|
+
❯ /goal "tests pass" # track + verify task completion
|
|
113
|
+
❯ /memory dashboard # memory system status
|
|
114
|
+
❯ /peer discover # find Clew instances on the LAN
|
|
115
|
+
❯ /mcp list # connected MCP servers
|
|
116
|
+
❯ /help # list everything
|
|
184
117
|
```
|
|
185
118
|
|
|
186
|
-
|
|
187
|
-
Clew instance A
|
|
188
|
-
-> LAN Peer
|
|
189
|
-
-> Clew instance B
|
|
190
|
-
-> local agent, daemon task, or process worker
|
|
191
|
-
```
|
|
119
|
+
---
|
|
192
120
|
|
|
193
|
-
|
|
121
|
+
## Features
|
|
194
122
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- Need another Clew instance on the LAN? Use `/peer`.
|
|
198
|
-
- Need Clew to run a local external worker such as Codex? Use Process Peer.
|
|
123
|
+
### Multi-provider
|
|
124
|
+
**27 providers** — OpenAI, Google Gemini & Code Assist, DeepSeek, Groq, xAI (Grok), Mistral, Cohere, Perplexity, Cerebras, Moonshot (Kimi), Zhipu (GLM), NVIDIA NIM, OpenRouter, OpenCode, KiloCode, Sakana AI, Ollama, Together AI, Fireworks AI, Deep Infra, SiliconFlow, Hugging Face, Poe, DigitalOcean, Cline, and custom endpoints. Switch any time with `/model`. *(Anthropic models are reachable via OpenRouter or Cline.)*
|
|
199
125
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
- **Multi-pass compaction:** Automatic chunk-based context compression with recursive re-compaction when context exceeds the model window.
|
|
203
|
-
- **Goal verification:** When the agent declares a task done, an independent LLM call reviews the conversation against the goal text and reports specific gaps if unsatisfied (attached as `goalGap` in result metadata).
|
|
204
|
-
- **Max Mode:** Generates N parallel candidate responses per turn via forked agents, then selects the best one via LLM judge with heuristic fallback. Toggle with `/maxmode`.
|
|
205
|
-
- **Checkpoints:** Structured snapshots at 20%/45%/70% progress milestones. Includes a `notes.md` scratchpad for the main agent's findings. Used for layered multi-cycle rebuild during compaction.
|
|
126
|
+
### Memory system (MiMo-inspired)
|
|
127
|
+
A SQLite-backed memory store with importance ranking, confidence scoring, access tracking, and timeline logging. It auto-initializes and scans your project on first use, then injects a token-budgeted selection of memories (ranked by importance × recency × confidence) into the system prompt each turn. Durable facts are extracted automatically during context compaction, and **Dream** (7-day) + **Distill** (30-day) jobs consolidate memory over time. See it all in `/memory dashboard`.
|
|
206
128
|
|
|
207
|
-
|
|
129
|
+
### Peer-to-peer LAN swarm
|
|
130
|
+
Discover other Clew instances on the same machine (file registry) or across the LAN (UDP multicast). Assign tasks, set roles, and broadcast shell commands to every peer in parallel with `/peer swarm`. Memory syncs between peers on demand or on a cron. All endpoints are protected by a per-instance auth token, with a 10 MB request-body limit.
|
|
208
131
|
|
|
209
|
-
|
|
132
|
+
### Autonomous agent loop
|
|
133
|
+
A file-backed persistent task queue with lease-based concurrency, exponential-backoff retry, and dead-letter handling. A cron scheduler runs recurring jobs, up to 3 concurrent workers.
|
|
210
134
|
|
|
211
|
-
|
|
135
|
+
### Goals & verification
|
|
136
|
+
`/goal` tracks task completion with heuristic pre-checks (exit codes, test output, lint results), chained goals via `then`, and templates like `fix-build` and `green-tests`. When the agent declares a task done, an independent LLM verifier reviews the conversation against the goal and reports any gaps.
|
|
212
137
|
|
|
213
|
-
###
|
|
138
|
+
### 70+ built-in tools
|
|
139
|
+
Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, Browser (Playwright), NotebookEdit, LSP, subagent dispatch (`Agent`), 17 LAN peer-coordination tools, MCP tools, `delegate` (exec/pty to external CLIs), and agent-driven memory curation.
|
|
214
140
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
```
|
|
141
|
+
### Extensible
|
|
142
|
+
- **MCP** — connect external tools over stdio, SSE (with OAuth), or in-process DirectConnect.
|
|
143
|
+
- **Skills, plugins, hooks** — extend without touching source. Skills via `SKILL.md`, plugins via manifest, and hooks at every lifecycle stage (PreToolUse, PostToolUse, PreBash, PostPrompt, PreAcceptEdit).
|
|
144
|
+
- **8 permission modes** — default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk, guardian, with granular allow/deny pattern rules.
|
|
220
145
|
|
|
221
|
-
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Execution layers
|
|
222
149
|
|
|
223
|
-
|
|
150
|
+
Clew Code runs work at several layers, each for a different job:
|
|
224
151
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
152
|
+
| Layer | What it is | Use it for |
|
|
153
|
+
|-------|-----------|------------|
|
|
154
|
+
| **Agent** | An AI worker with a prompt, model, tools, and permissions. The main chat is an agent; custom ones live in `.clew/agents/*.md`. | The session itself. |
|
|
155
|
+
| **Subagent** | A short-lived child launched via the `Agent` tool (e.g. read-only `Explore`). | Independent investigation, test triage, review. |
|
|
156
|
+
| **Teammate / Swarm** | A longer-lived agent with identity, mailbox, and task coordination. | Multi-turn collaboration between named workers. |
|
|
157
|
+
| **LAN Peer** | Another Clew instance on the same machine or network, reached via `/peer`. | Distributing work across machines. |
|
|
158
|
+
| **Process Peer** | A local worker that delegates to an external CLI (e.g. Codex) via `exec`/`pty`. | Running another coding tool as a subprocess. |
|
|
230
159
|
|
|
231
|
-
|
|
160
|
+
Other runtime concepts: **Plan mode** (full-access planning that persists to `.clew/plans/`), **multi-pass compaction** (recursive context compression when the window fills), and **structured checkpoints** (progress snapshots at 20/45/70% with a `notes.md` scratchpad, used for layered rebuild during compaction).
|
|
232
161
|
|
|
233
162
|
---
|
|
234
163
|
|
|
@@ -238,48 +167,38 @@ Profile and last-used permission mode are saved between sessions.
|
|
|
238
167
|
<summary><strong>100+ slash commands</strong></summary>
|
|
239
168
|
|
|
240
169
|
```
|
|
241
|
-
/login Sign in via Clew Gateway
|
|
242
|
-
/logout Sign out from Clew Gateway
|
|
243
170
|
/model Switch provider or model
|
|
244
171
|
/status Provider, session, context info
|
|
245
172
|
/doctor Diagnostics
|
|
246
|
-
/profile Personal profile mode (coding / personal)
|
|
247
173
|
/context Active context usage
|
|
248
|
-
/compact Compress
|
|
249
|
-
/goal Track and verify task completion
|
|
250
|
-
/
|
|
174
|
+
/compact Compress history + extract memories
|
|
175
|
+
/goal Track and verify task completion
|
|
176
|
+
/memory Memory: init, scan, rebuild, recall, feedback, dashboard, search
|
|
177
|
+
/peer LAN peers: discover, send, swarm, dashboard, memory sync/auto
|
|
178
|
+
/daemon Autonomous daemon dashboard
|
|
179
|
+
/task Scheduled tasks
|
|
251
180
|
/mcp MCP server management
|
|
181
|
+
/plugin Plugin and hook management
|
|
182
|
+
/skills List and manage skills
|
|
252
183
|
/code-review Review changed files for bugs
|
|
253
184
|
/simplify Cleanup-focused review
|
|
254
|
-
/
|
|
255
|
-
/bridge Bridge mode config
|
|
256
|
-
/agent Background agent dispatch & subcommands
|
|
257
|
-
/agents TUI Agent dashboard (operational view)
|
|
258
|
-
/peer LAN peers: share, discover, join, send, swarm, dashboard, memory sync/auto
|
|
259
|
-
/remote WebSocket remote control
|
|
260
|
-
/daemon Autonomous daemon dashboard
|
|
261
|
-
/task Scheduled tasks
|
|
262
|
-
/memory Memory system: init, scan, rebuild, recall, feedback, dashboard, search
|
|
263
|
-
/tasks Curated task list management
|
|
264
|
-
/effort Set reasoning effort (including ultracode)
|
|
265
|
-
/stats Session statistics and cost breakdown
|
|
266
|
-
/guardian Auto-review mode using secondary LLM
|
|
185
|
+
/guardian Auto-review mode using a secondary LLM
|
|
267
186
|
/approve Override guardian denials
|
|
268
187
|
/pr GitHub PR lifecycle
|
|
269
|
-
/voice Voice input via browser Web Speech API
|
|
270
|
-
/buddy Companion card and naming
|
|
271
|
-
/team Team dashboard for in-process teammates
|
|
272
|
-
/bg Background sessions
|
|
273
188
|
/plan Plan mode
|
|
274
|
-
/
|
|
275
|
-
/research Research dossier management
|
|
276
|
-
/workflow Multi-step workflow automation
|
|
189
|
+
/fork Fork conversation into a new session
|
|
277
190
|
/rewind Undo last response
|
|
278
|
-
/
|
|
191
|
+
/effort Set reasoning effort
|
|
192
|
+
/stats Session statistics and cost breakdown
|
|
193
|
+
/voice Voice input via browser Web Speech API
|
|
194
|
+
/remote WebSocket remote control
|
|
195
|
+
/bridge Bridge mode config
|
|
279
196
|
/session Session management
|
|
280
197
|
/theme Theme switcher
|
|
281
|
-
/
|
|
282
|
-
/
|
|
198
|
+
/vim Vim keybindings
|
|
199
|
+
/login Sign in via Clew Gateway
|
|
200
|
+
/logout Sign out
|
|
201
|
+
/upgrade Check for updates
|
|
283
202
|
```
|
|
284
203
|
|
|
285
204
|
</details>
|
|
@@ -293,38 +212,25 @@ Profile and last-used permission mode are saved between sessions.
|
|
|
293
212
|
|
|
294
213
|
```
|
|
295
214
|
src/
|
|
296
|
-
├── main.tsx
|
|
297
|
-
├── QueryEngine.ts
|
|
298
|
-
├──
|
|
299
|
-
├──
|
|
300
|
-
├── commands/ # 100+ slash command implementations
|
|
301
|
-
├── tools/ # 75+ built-in tools
|
|
215
|
+
├── main.tsx # Entry point
|
|
216
|
+
├── QueryEngine.ts # Core query + tool loop
|
|
217
|
+
├── commands/ # Slash command implementations
|
|
218
|
+
├── tools/ # Built-in tools
|
|
302
219
|
├── services/
|
|
303
|
-
│ ├── ai/
|
|
304
|
-
│ ├── mcp/
|
|
305
|
-
│ ├── plugins/
|
|
306
|
-
│ ├── autonomous/
|
|
307
|
-
│ ├── search/
|
|
308
|
-
│ ├── checkpoint/
|
|
309
|
-
│ ├── goal/
|
|
310
|
-
│ ├── longTermMemory/
|
|
311
|
-
│
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
│ ├── lsp/ # LSP integration
|
|
318
|
-
│ ├── voiceInput/ # Voice transcription pipeline
|
|
319
|
-
│ ├── sessionSearch/ # FTS5 session transcript search
|
|
320
|
-
│ ├── analytics/ # Session analytics
|
|
321
|
-
│ └── Supervisor/ # Agent supervisor IPC
|
|
322
|
-
├── peer/ # PeerServer + PeerDiscovery (agent-to-agent)
|
|
323
|
-
├── memory/ # MemoryDB + autoInit + scanner + hierarchy + feedback (MiMo-style)
|
|
324
|
-
├── bridge/ # WebSocket bridge + relay
|
|
325
|
-
├── components/ # Ink terminal UI components
|
|
326
|
-
├── state/ # AppState management
|
|
327
|
-
└── hooks/ # React hooks
|
|
220
|
+
│ ├── ai/ # Provider manager + adapters
|
|
221
|
+
│ ├── mcp/ # MCP client + auth + transports
|
|
222
|
+
│ ├── plugins/ # Plugin hooks + marketplace
|
|
223
|
+
│ ├── autonomous/ # Agent loop + task queue + cron
|
|
224
|
+
│ ├── search/ # Web search providers
|
|
225
|
+
│ ├── checkpoint/ # Structured progress checkpoints
|
|
226
|
+
│ ├── goal/ # Goal evaluation and verification
|
|
227
|
+
│ ├── longTermMemory/ # Dream (7d) + Distill (30d)
|
|
228
|
+
│ └── compact/ # Context compression
|
|
229
|
+
├── peer/ # PeerServer + PeerDiscovery
|
|
230
|
+
├── memory/ # MemoryDB + scanner + feedback
|
|
231
|
+
├── bridge/ # WebSocket bridge + relay
|
|
232
|
+
├── components/ # Ink terminal UI
|
|
233
|
+
└── hooks/ # React hooks
|
|
328
234
|
```
|
|
329
235
|
|
|
330
236
|
</details>
|
|
@@ -336,146 +242,38 @@ src/
|
|
|
336
242
|
```bash
|
|
337
243
|
bun run dev # Live reload
|
|
338
244
|
bun run build # Build to dist/
|
|
339
|
-
bun test #
|
|
245
|
+
bun test # Run tests
|
|
340
246
|
bun x tsc --noEmit # Type-check
|
|
341
247
|
bun run check:ci # Lint + format check (Biome CI)
|
|
342
248
|
```
|
|
343
249
|
|
|
344
|
-
**Windows
|
|
250
|
+
**Windows**
|
|
345
251
|
```powershell
|
|
346
252
|
Remove-Item -Recurse -Force node_modules
|
|
347
|
-
bun install
|
|
253
|
+
bun install; bun run dev
|
|
348
254
|
```
|
|
349
255
|
|
|
350
256
|
---
|
|
351
257
|
|
|
352
|
-
##
|
|
353
|
-
|
|
354
|
-
We welcome contributions. Read [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), [SECURITY.md](SECURITY.md), and [LICENSE.md](LICENSE.md) before submitting.
|
|
258
|
+
## Contributing
|
|
355
259
|
|
|
356
|
-
|
|
260
|
+
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), and [SECURITY.md](SECURITY.md) first.
|
|
357
261
|
|
|
358
|
-
|
|
262
|
+
**Good first issues**
|
|
263
|
+
- Add a provider adapter in `src/services/ai/`
|
|
359
264
|
- Write tests for untested tools
|
|
360
|
-
-
|
|
265
|
+
- Improve docs and examples
|
|
361
266
|
- Build a plugin or MCP server
|
|
362
267
|
- Improve Windows support
|
|
363
268
|
|
|
364
|
-
### Contributors
|
|
365
|
-
|
|
366
269
|
<a href="https://github.com/ClewCode/ClewCode/graphs/contributors">
|
|
367
270
|
<img src="https://contrib.rocks/image?repo=ClewCode/ClewCode" alt="Contributors" />
|
|
368
271
|
</a>
|
|
369
272
|
|
|
370
273
|
---
|
|
371
274
|
|
|
372
|
-
## Changelog
|
|
373
|
-
|
|
374
|
-
<details>
|
|
375
|
-
<summary><strong>v0.3.3 — unreleased</strong></summary>
|
|
376
|
-
|
|
377
|
-
- **MACRO globals fix**: `clew update` no longer crashes with `TypeError` — globals now injected at build time.
|
|
378
|
-
- **17 dead stub commands removed** (`ant-trace`, `bughunter`, `env`, `issue`, `onboarding`, etc.) plus `/looplock` and `/agents`.
|
|
379
|
-
- **Compact Orchestrator**: Unified entry point for all compaction strategies.
|
|
380
|
-
- **CLAUDE → CLEW full rename**: All remaining `.claude/` references renamed to `.clew/` across 83 files.
|
|
381
|
-
- **URL rebranding**: All `claude.ai` and `claude.com` URLs replaced with `clew-code.org`.
|
|
382
|
-
- **Gateway auth system**: Login/signup via browser or terminal at `api.clew-code.org`. `/login` and `/logout` now gateway-native.
|
|
383
|
-
- **Windows clipboard fix**: PowerShell `Set-Clipboard` with UTF-8 replaces `clip.exe` (corrupted non-ASCII text).
|
|
384
|
-
- **Cross-platform Computer Use Tool**: macOS/Linux support added alongside Windows.
|
|
385
|
-
- **Onboarding wizard redesigned**: 27 providers, direct API key entry, no OAuth step.
|
|
386
|
-
- **Auto-compact threshold adjusted**: Background compaction triggers earlier (0.65).
|
|
387
|
-
- **MCP URLs rebranded**: Diagnostics now link to `clew-code.org`.
|
|
388
|
-
- **AGENTS.md updated**: Gateway mode, dashboard deployment, removed commands documentation.
|
|
389
|
-
|
|
390
|
-
</details>
|
|
391
|
-
|
|
392
|
-
<details>
|
|
393
|
-
<summary><strong>v0.3.2 — 2026-06-18</strong></summary>
|
|
394
|
-
|
|
395
|
-
- **Fixed `schema._zod.def` crash**: `zodToJsonSchema()` now checks for `_zod` branding before calling `toJSONSchema()`, preventing crashes when a non-Zod value is passed as a tool schema.
|
|
396
|
-
- **Fixed `generateSettingsJSONSchema()` crash**: Wrapped `toJSONSchema()` with try-catch to handle Zod v4 serialization failures.
|
|
397
|
-
|
|
398
|
-
</details>
|
|
399
|
-
|
|
400
|
-
<details>
|
|
401
|
-
<summary><strong>v0.3.1 — 2026-06-18</strong></summary>
|
|
402
|
-
|
|
403
|
-
- **Fixed PeerStore infinite recursion**: Removed 7 duplicate alias methods that called themselves recursively, fixing `Maximum call stack size exceeded` during `peer_discover`.
|
|
404
|
-
|
|
405
|
-
</details>
|
|
406
|
-
|
|
407
|
-
<details>
|
|
408
|
-
<summary><strong>v0.3.0 — 2026-06-18</strong></summary>
|
|
409
|
-
|
|
410
|
-
- **Peer memory sync**: `/peer memory sync` imports memories from all connected peers. Auto-sync on cron (`/peer memory auto on`).
|
|
411
|
-
- **Memory system dashboard**: `/memory dashboard` shows unified view of MemoryDB, Dream, Distill, Peer Sync, and timeline.
|
|
412
|
-
- **Legacy migration**: Auto-migrates old `session-memory.db` into MemoryDB during `/memory init`.
|
|
413
|
-
- **Redirected longTermMemory to MemoryDB**: Dream, graph, experience, cross-session all now read/write to MemoryDB instead of their own SQLite/JSON files.
|
|
414
|
-
- **MemoryDB — SQLite-backed memory store**: `memories` table (importance, confidence, access_count, type), `memory_timeline` table (event lifecycle). Budgeted querying, auto-eviction, timeline logging.
|
|
415
|
-
- **Memory hierarchy**: `.clew/memory/` directory with MEMORY.md, DECISIONS.md, TASTE.md. Auto-initializes on first use.
|
|
416
|
-
- **Budgeted injection**: Importance-ranked memory injection into system prompt, fits configurable token budget.
|
|
417
|
-
- **`/memory scan`**: Detects stack/language/package-manager/entrypoints, bootstraps seed memories.
|
|
418
|
-
- **`/memory rebuild`**: Reconstructs context from memories via budgeted injection with per-memory detail.
|
|
419
|
-
- **`/memory recall`**: Recalls memories ranked by combined score. Access count bump, `--verbose` for breakdown.
|
|
420
|
-
- **`/memory feedback`**: 7 signals (accepted, rejected, corrected, preferred, disliked, important, wrong). Updates importance/confidence, writes `preferred` to TASTE.md.
|
|
421
|
-
- **In-compact memory extraction**: Compact prompt asks LLM for `<memories>` block with structured facts; `parseCompactMemories()` extracts and saves to MemoryDB + markdown.
|
|
422
|
-
- **Peer task dashboard**: `/peer dashboard` command + `peer_dashboard` AI tool. Shows connected peers, tasks, and result summaries.
|
|
423
|
-
- **`/peer swarm`**: Sends shell command to ALL connected peers in parallel via `/peer-exec`, aggregates results. Supports `--timeout`, `--filter`, `--dry-run`.
|
|
424
|
-
- **`peer_swarm` tool**: New AI-callable tool — runs shell commands on all peers in parallel.
|
|
425
|
-
- **In-process message broker**: `POST /broker/send`, `GET /broker/recv` (long-poll), `POST /broker/reply`. Message queuing with correlation IDs inside existing PeerServer.
|
|
426
|
-
- **`/model` fetches from API for all providers**: `supportsModelFetching()` expanded to all providers (except google-assist).
|
|
427
|
-
- **Removed Anthropic provider**: clew-gateway + cline cover Anthropic models. Standalone `anthropic` entry removed.
|
|
428
|
-
- **Hidden `clew-gateway` provider**: Filtered from `PROVIDER_IDS`.
|
|
429
|
-
- **Auto memory lifecycle**: `ensureMemorySystem()` auto-inits DB + auto-scans on first access. Budgeted memories auto-injected every turn.
|
|
430
|
-
- **Memory tests**: 8 new tests for upsert idempotency, content-hash detection, recall ranking, feedback signals, and budget limits.
|
|
431
|
-
|
|
432
|
-
</details>
|
|
433
|
-
|
|
434
|
-
<details>
|
|
435
|
-
<summary><strong>v0.2.6 — 2026-06-10</strong></summary>
|
|
436
|
-
|
|
437
|
-
- **Peer HTTP heartbeat** — 60s liveness checks, offline peers detected immediately
|
|
438
|
-
- **Removed GitHub Copilot** — provider and all references cleaned out
|
|
439
|
-
- **`/agents` visual polish** — redesigned dashboard, cleaner layout
|
|
440
|
-
- **Auto-updater** — switched from Anthropic GCS to npm registry
|
|
441
|
-
|
|
442
|
-
</details>
|
|
443
|
-
|
|
444
|
-
<details>
|
|
445
|
-
<summary><strong>v0.2.5 — 2026-06-10</strong></summary>
|
|
446
|
-
|
|
447
|
-
- **Rebranded to Clew Code** — docs, UI copy, and package updated
|
|
448
|
-
- **Memory search** — `/memory search` for stored entries
|
|
449
|
-
- **Peer tools** — 14 AI coordination tools, peer help, connection count in footer
|
|
450
|
-
- **Fixed `/providers`** — duplicate `const info` runtime error fixed
|
|
451
|
-
|
|
452
|
-
</details>
|
|
453
|
-
|
|
454
|
-
<details>
|
|
455
|
-
<summary><strong>v0.2.4 — 2026-06-08</strong></summary>
|
|
456
|
-
|
|
457
|
-
- **Peer-to-peer** — UDP multicast discovery, file registry, 14 AI coordination tools, interactive PeerMenu
|
|
458
|
-
- **Autonomous agents** — agent loop, supervisor integration, task queue, Loop Lock
|
|
459
|
-
- **Workflow Rainbow** — per-character gradient highlight for "workflow" keyword
|
|
460
|
-
|
|
461
|
-
</details>
|
|
462
|
-
|
|
463
|
-
<details>
|
|
464
|
-
<summary><strong>v0.2.3 — 2026-06-07</strong></summary>
|
|
465
|
-
|
|
466
|
-
- `/effort` works with any provider exposing `reasoningEffort` (NVIDIA, DeepSeek, OpenRouter, etc.)
|
|
467
|
-
- `/model` fetches live model list from provider APIs
|
|
468
|
-
- Relay server for cross-network remote control
|
|
469
|
-
- Bridge v2: provider-agnostic remote control
|
|
470
|
-
- `/pr create/list/view/review/merge/status`
|
|
471
|
-
- Security: PowerShell rules, malformed tool call guard, 100 MB bash output cap
|
|
472
|
-
|
|
473
|
-
</details>
|
|
474
|
-
|
|
475
|
-
[Full changelog](CHANGELOG.md)
|
|
476
|
-
|
|
477
|
-
---
|
|
478
|
-
|
|
479
275
|
## License
|
|
480
276
|
|
|
481
|
-
[LICENSE.md](LICENSE.md)
|
|
277
|
+
See [LICENSE.md](LICENSE.md). The license covers only contributor-authored modifications and original additions; it does not grant rights to third-party software, models, or trademarks.
|
|
278
|
+
|
|
279
|
+
Full version history: [CHANGELOG.md](CHANGELOG.md).
|