clew-code 0.3.1 → 0.3.3
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 +181 -113
- package/dist/generated/version.json +1 -1
- package/dist/main.js +2948 -3258
- package/package.json +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/_config.yml +0 -3
- package/docs/architecture.html +0 -90
- package/docs/assets/clew-agent-loop.png +0 -0
- package/docs/assets/clew-general-architecture.png +0 -0
- package/docs/assets/clew-mcp-architecture.png +0 -0
- package/docs/assets/clew-p2p-swarm.png +0 -0
- package/docs/assets/clew.svg +0 -33
- package/docs/changelog.html +0 -141
- package/docs/cli-reference.html +0 -89
- package/docs/commands.html +0 -161
- package/docs/configuration.html +0 -85
- package/docs/contributing.html +0 -91
- package/docs/css/styles.css +0 -545
- package/docs/daemon.html +0 -62
- package/docs/features/bridge-mode.html +0 -62
- package/docs/features/evals.html +0 -58
- package/docs/features/searxng-search.html +0 -59
- package/docs/features/sentry-setup.html +0 -62
- package/docs/generated/providers.html +0 -625
- package/docs/generated/tools.html +0 -559
- package/docs/index.html +0 -182
- package/docs/installation.html +0 -77
- package/docs/internals/claude-ai-backend-dependencies.md +0 -278
- package/docs/internals/growthbook-ab-testing.html +0 -70
- package/docs/internals/hidden-features.html +0 -82
- package/docs/internals/long-term-memory-design.md +0 -173
- package/docs/js/main.js +0 -438
- package/docs/loop.html +0 -69
- package/docs/mcp.html +0 -99
- package/docs/models.html +0 -81
- package/docs/permission-model.html +0 -86
- package/docs/personal-profile.html +0 -113
- package/docs/plugins.html +0 -84
- package/docs/providers.html +0 -625
- package/docs/quick-start.html +0 -81
- package/docs/research-memory.html +0 -71
- package/docs/security.html +0 -71
- package/docs/skills.html +0 -67
- package/docs/swarm.html +0 -78
- package/docs/tools.html +0 -559
- package/docs/troubleshooting.html +0 -86
- package/docs/voice-mode.html +0 -79
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**The open-source AI coding agent — in your terminal and on your LAN.**
|
|
8
8
|
|
|
9
|
-
A multi-provider AI coding CLI that codes, learns your preferences, coordinates across machines, and runs autonomously on your own hardware. One Bun bundle. Local-first by design.
|
|
9
|
+
A multi-provider AI coding CLI that codes, learns your preferences, coordinates across machines, and runs autonomously on your own hardware. One Bun bundle. Local-first by design. MiMo-inspired memory system. Peer-to-peer LAN swarm. Gateway authentication at `clew-code.org`. 75+ built-in tools.
|
|
10
10
|
|
|
11
11
|
[](https://github.com/ClewCode/ClewCode/stargazers)
|
|
12
12
|
[](https://github.com/ClewCode/ClewCode/graphs/contributors)
|
|
@@ -15,9 +15,10 @@ A multi-provider AI coding CLI that codes, learns your preferences, coordinates
|
|
|
15
15
|
[](https://github.com/ClewCode/ClewCode/actions/workflows/ci.yml)
|
|
16
16
|
[](#license)
|
|
17
17
|
[](#installation)
|
|
18
|
+
[](https://clew-code.org)
|
|
18
19
|
[](https://bun.sh)
|
|
19
20
|
|
|
20
|
-
[GitHub](https://github.com/ClewCode/ClewCode) · [Latest Release](https://github.com/ClewCode/ClewCode/releases) · [
|
|
21
|
+
[GitHub](https://github.com/ClewCode/ClewCode) · [Website](https://clew-code.org) · [Latest Release](https://github.com/ClewCode/ClewCode/releases) · [Wiki](https://github.com/ClewCode/ClewCode/wiki) · [Issues](https://github.com/ClewCode/ClewCode/issues)
|
|
21
22
|
|
|
22
23
|
</div>
|
|
23
24
|
|
|
@@ -25,89 +26,9 @@ A multi-provider AI coding CLI that codes, learns your preferences, coordinates
|
|
|
25
26
|
|
|
26
27
|
## Hacking in public
|
|
27
28
|
|
|
28
|
-
Clew Code is a
|
|
29
|
+
Clew Code is a **multi-provider** AI coding agent — you're not locked into one API. As of this writing the project ships a MiMo-inspired memory system (SQLite-backed, budgeted injection, cross-session persistence), agent-to-agent LAN peer coordination with swarm execution and memory sync, 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 (Dream + Distill), and 27 provider adapters.
|
|
29
30
|
|
|
30
|
-
>
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Features
|
|
35
|
-
|
|
36
|
-
- **26+ providers** — 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. *(Anthropic provider removed — use [Claude Code](https://github.com/anthropics/claude-code) directly for Anthropic-first workflows.)*
|
|
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. **Swarm execution** broadcasts shell commands to all peers in parallel with aggregated results. **Message broker** (in-process queue) enables offline message delivery with correlation IDs.
|
|
38
|
-
|
|
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
|
-
- **55+ 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 including swarm + dashboard), MCP tools, ProcessPeer (exec/pty), MemoryFeedback (agent-driven memory curation), plan mode with full bypass permissions, multi-pass context compaction.
|
|
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
|
-
- **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
|
-
- **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`.
|
|
44
|
-
- **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).
|
|
45
|
-
- **Project memory promotion** — at the 70% checkpoint, stable information (active files, persistent decisions, notes) is promoted to `MEMORY.md` for cross-session persistence.
|
|
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
|
-
- **MCP — Model Context Protocol** — connect external tools via stdio (local subprocesses), SSE (remote servers with OAuth), or DirectConnect (in-process plugin servers).
|
|
48
|
-
- **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. Peer-to-peer memory sync across LAN. `/memory dashboard` shows unified status of MemoryDB, Dream, Distill, Peer Sync, and timeline.
|
|
49
|
-
- **Skills, plugins, hooks** — extend without touching source. Skills via `SKILL.md`, plugins with manifest, hooks at every lifecycle stage (PreToolUse, PostToolUse, PreBash, PostPrompt, PreAcceptEdit).
|
|
50
|
-
- **8 permission modes** — default, ask, plan, auto, acceptEdits, bypassPermissions, dontAsk, guardian. Granular allow/deny rules with pattern matching.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Concepts: Agents, Subagents, and Peers
|
|
55
|
-
|
|
56
|
-
Clew Code has several execution layers. They are related, but they do different jobs:
|
|
57
|
-
|
|
58
|
-
- **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`.
|
|
59
|
-
- **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.
|
|
60
|
-
- **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.
|
|
61
|
-
- **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.
|
|
62
|
-
- **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
|
-
|
|
64
|
-
Typical flows:
|
|
65
|
-
|
|
66
|
-
```text
|
|
67
|
-
User
|
|
68
|
-
-> main Clew agent
|
|
69
|
-
-> Agent tool
|
|
70
|
-
-> short-lived subagent, e.g. Explore
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
```text
|
|
74
|
-
Clew instance A
|
|
75
|
-
-> LAN Peer
|
|
76
|
-
-> Clew instance B
|
|
77
|
-
-> local agent, daemon task, or process worker
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Use the layers by intent:
|
|
81
|
-
|
|
82
|
-
- Need a quick independent read-only investigation? Use an `Explore` subagent.
|
|
83
|
-
- Need long-running coordination between named workers? Use teammates/swarm.
|
|
84
|
-
- Need another Clew instance on the LAN? Use `/peer`.
|
|
85
|
-
- Need Clew to run a local external worker such as Codex? Use Process Peer.
|
|
86
|
-
|
|
87
|
-
Other runtime concepts:
|
|
88
|
-
- **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.
|
|
89
|
-
- **Multi-pass compaction:** Automatic chunk-based context compression with recursive re-compaction when context exceeds the model window.
|
|
90
|
-
- **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).
|
|
91
|
-
- **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`.
|
|
92
|
-
- **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.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Profiles: Coding vs Personal
|
|
97
|
-
|
|
98
|
-
Clew Code has a **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.
|
|
99
|
-
|
|
100
|
-
### How personal delegation works
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
You → personal profile → understand requirement → plan approach
|
|
104
|
-
→ /delegate skill → ProcessPeer → Codex worker
|
|
105
|
-
→ worker implements → report back → you review
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
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.
|
|
109
|
-
|
|
110
|
-
Profile and last-used permission mode are saved between sessions.
|
|
31
|
+
> Rebuilt for every provider. Gateway-native auth at [clew-code.org](https://clew-code.org).
|
|
111
32
|
|
|
112
33
|
---
|
|
113
34
|
|
|
@@ -175,10 +96,16 @@ clew
|
|
|
175
96
|
# Or go local with Ollama
|
|
176
97
|
❯ /model ollama/llama3.3
|
|
177
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
|
+
|
|
178
105
|
# In-session commands
|
|
179
106
|
❯ /help # list everything
|
|
180
107
|
❯ /status # current provider, model, context info
|
|
181
|
-
❯ /goal "tests pass" # track task completion
|
|
108
|
+
❯ /goal "tests pass" # track task completion with verification
|
|
182
109
|
❯ /maxmode on # parallel candidate generation
|
|
183
110
|
❯ /peer discover # find other Clew instances on LAN
|
|
184
111
|
❯ /peer swarm clew -p "summarize CHANGELOG.md" # run on all peers
|
|
@@ -192,6 +119,9 @@ clew
|
|
|
192
119
|
❯ /memory init # bootstrap project memory (SQLite + scan)
|
|
193
120
|
❯ /memory rebuild # reconstruct context from ranked memories
|
|
194
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
|
|
195
125
|
|
|
196
126
|
# One-shot mode (pipe-friendly)
|
|
197
127
|
clew -p "summarize CHANGELOG.md"
|
|
@@ -216,19 +146,99 @@ export GEMINI_API_KEY=...
|
|
|
216
146
|
|
|
217
147
|
---
|
|
218
148
|
|
|
149
|
+
## Features
|
|
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:
|
|
170
|
+
|
|
171
|
+
- **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`.
|
|
172
|
+
- **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.
|
|
173
|
+
- **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.
|
|
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.
|
|
176
|
+
|
|
177
|
+
Typical flows:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
User
|
|
181
|
+
-> main Clew agent
|
|
182
|
+
-> Agent tool
|
|
183
|
+
-> short-lived subagent, e.g. Explore
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
Clew instance A
|
|
188
|
+
-> LAN Peer
|
|
189
|
+
-> Clew instance B
|
|
190
|
+
-> local agent, daemon task, or process worker
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Use the layers by intent:
|
|
194
|
+
|
|
195
|
+
- Need a quick independent read-only investigation? Use an `Explore` subagent.
|
|
196
|
+
- Need long-running coordination between named workers? Use teammates/swarm.
|
|
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.
|
|
199
|
+
|
|
200
|
+
Other runtime concepts:
|
|
201
|
+
- **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.
|
|
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.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Profiles: Coding vs Personal
|
|
210
|
+
|
|
211
|
+
Clew Code has a **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.
|
|
212
|
+
|
|
213
|
+
### How personal delegation works
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
You → personal profile → understand requirement → plan approach
|
|
217
|
+
→ /delegate skill → ProcessPeer → Codex worker
|
|
218
|
+
→ worker implements → report back → you review
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
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.
|
|
222
|
+
|
|
223
|
+
Profile and last-used permission mode are saved between sessions.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
219
227
|
## Commands
|
|
220
228
|
|
|
221
229
|
<details>
|
|
222
|
-
<summary><strong>
|
|
230
|
+
<summary><strong>100+ slash commands</strong></summary>
|
|
223
231
|
|
|
224
232
|
```
|
|
233
|
+
/login Sign in via Clew Gateway
|
|
234
|
+
/logout Sign out from Clew Gateway
|
|
225
235
|
/model Switch provider or model
|
|
226
236
|
/status Provider, session, context info
|
|
227
237
|
/doctor Diagnostics
|
|
228
|
-
/profile Personal profile mode
|
|
238
|
+
/profile Personal profile mode (coding / personal)
|
|
229
239
|
/context Active context usage
|
|
230
|
-
/compact Compress conversation history
|
|
231
|
-
/goal Track and verify task completion
|
|
240
|
+
/compact Compress conversation history + extract memories
|
|
241
|
+
/goal Track and verify task completion (chains, templates)
|
|
232
242
|
/maxmode Toggle parallel candidate generation
|
|
233
243
|
/mcp MCP server management
|
|
234
244
|
/code-review Review changed files for bugs
|
|
@@ -243,6 +253,25 @@ export GEMINI_API_KEY=...
|
|
|
243
253
|
/task Scheduled tasks
|
|
244
254
|
/memory Memory system: init, scan, rebuild, recall, feedback, dashboard, search
|
|
245
255
|
/tasks Curated task list management
|
|
256
|
+
/effort Set reasoning effort (including ultracode)
|
|
257
|
+
/stats Session statistics and cost breakdown
|
|
258
|
+
/guardian Auto-review mode using secondary LLM
|
|
259
|
+
/approve Override guardian denials
|
|
260
|
+
/pr GitHub PR lifecycle
|
|
261
|
+
/voice Voice input via browser Web Speech API
|
|
262
|
+
/buddy Companion card and naming
|
|
263
|
+
/team Team dashboard for in-process teammates
|
|
264
|
+
/bg Background sessions
|
|
265
|
+
/plan Plan mode
|
|
266
|
+
/vim Vim keybindings
|
|
267
|
+
/research Research dossier management
|
|
268
|
+
/workflow Multi-step workflow automation
|
|
269
|
+
/rewind Undo last response
|
|
270
|
+
/upgrade Check for updates
|
|
271
|
+
/session Session management
|
|
272
|
+
/theme Theme switcher
|
|
273
|
+
/skills List and manage skills
|
|
274
|
+
/ultracode UltraCode reasoning mode
|
|
246
275
|
```
|
|
247
276
|
|
|
248
277
|
</details>
|
|
@@ -257,20 +286,30 @@ export GEMINI_API_KEY=...
|
|
|
257
286
|
```
|
|
258
287
|
src/
|
|
259
288
|
├── main.tsx # Entry point
|
|
260
|
-
├──
|
|
289
|
+
├── QueryEngine.ts # Core query + tool loop
|
|
290
|
+
├── query.ts # Non-streaming query variant
|
|
261
291
|
├── agentRuntime/ # Background agent orchestration
|
|
262
|
-
├── commands/ #
|
|
263
|
-
├── tools/ #
|
|
292
|
+
├── commands/ # 100+ slash command implementations
|
|
293
|
+
├── tools/ # 75+ built-in tools
|
|
264
294
|
├── services/
|
|
265
|
-
│ ├── ai/ # Provider manager +
|
|
295
|
+
│ ├── ai/ # Provider manager + 27 providers
|
|
266
296
|
│ ├── mcp/ # MCP client + auth + transports
|
|
267
297
|
│ ├── plugins/ # Plugin hooks + marketplace
|
|
268
298
|
│ ├── autonomous/ # Agent loop + task queue + cron
|
|
299
|
+
│ ├── search/ # Web search providers (brave, duckduckgo, serper, tavily)
|
|
269
300
|
│ ├── checkpoint/ # Structured progress checkpoints
|
|
270
301
|
│ ├── goal/ # Goal evaluation and verification
|
|
271
302
|
│ ├── longTermMemory/ # Dream (7d) + Distill (30d) consolidation
|
|
272
303
|
│ ├── maxMode/ # Candidate runner + evaluator
|
|
304
|
+
│ ├── compact/ # Context compression and compaction
|
|
305
|
+
│ ├── autoDream/ # Dream process scheduling
|
|
306
|
+
│ ├── extractMemories/ # In-compact memory extraction
|
|
307
|
+
│ ├── api/ # API utilities (errors, retry)
|
|
308
|
+
│ ├── openaiOAuth/ # OpenAI OAuth device flow
|
|
273
309
|
│ ├── lsp/ # LSP integration
|
|
310
|
+
│ ├── voiceInput/ # Voice transcription pipeline
|
|
311
|
+
│ ├── sessionSearch/ # FTS5 session transcript search
|
|
312
|
+
│ ├── analytics/ # Session analytics
|
|
274
313
|
│ └── Supervisor/ # Agent supervisor IPC
|
|
275
314
|
├── peer/ # PeerServer + PeerDiscovery (agent-to-agent)
|
|
276
315
|
├── memory/ # MemoryDB + autoInit + scanner + hierarchy + feedback (MiMo-style)
|
|
@@ -291,7 +330,7 @@ bun run dev # Live reload
|
|
|
291
330
|
bun run build # Build to dist/
|
|
292
331
|
bun test # Vitest
|
|
293
332
|
bun x tsc --noEmit # Type-check
|
|
294
|
-
bun run check:ci #
|
|
333
|
+
bun run check:ci # Lint + format check (Biome CI)
|
|
295
334
|
```
|
|
296
335
|
|
|
297
336
|
**Windows:**
|
|
@@ -322,28 +361,59 @@ We welcome contributions. Read [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_COND
|
|
|
322
361
|
|
|
323
362
|
---
|
|
324
363
|
|
|
325
|
-
##
|
|
364
|
+
## Changelog
|
|
326
365
|
|
|
327
|
-
|
|
366
|
+
<details>
|
|
367
|
+
<summary><strong>v0.3.3 — unreleased</strong></summary>
|
|
328
368
|
|
|
329
|
-
|
|
369
|
+
- **Gateway auth system**: Login/signup via browser or terminal at `api.clew-code.org`. Token import from web dashboard. `/login` and `/logout` now gateway-native.
|
|
370
|
+
- **URL rebranding**: All `claude.ai` and `claude.com` URLs replaced with `clew-code.org`.
|
|
371
|
+
- **Marketing website**: Terminal-inspired design site at `clew-code.org`, moved to separate repo.
|
|
372
|
+
- **Context compaction**: Background auto-compaction with configurable threshold.
|
|
373
|
+
- **Interrupted prompt renamed**: Branded as "Clew".
|
|
374
|
+
- **AGENTS.md updated**: Gateway mode, dashboard deployment, removed commands documentation.
|
|
330
375
|
|
|
331
|
-
|
|
376
|
+
</details>
|
|
332
377
|
|
|
333
378
|
<details>
|
|
334
|
-
<summary><strong>v0.2
|
|
335
|
-
|
|
336
|
-
- **
|
|
337
|
-
- **
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
- **
|
|
345
|
-
|
|
346
|
-
|
|
379
|
+
<summary><strong>v0.3.2 — 2026-06-18</strong></summary>
|
|
380
|
+
|
|
381
|
+
- **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.
|
|
382
|
+
- **Fixed `generateSettingsJSONSchema()` crash**: Wrapped `toJSONSchema()` with try-catch to handle Zod v4 serialization failures.
|
|
383
|
+
|
|
384
|
+
</details>
|
|
385
|
+
|
|
386
|
+
<details>
|
|
387
|
+
<summary><strong>v0.3.1 — 2026-06-18</strong></summary>
|
|
388
|
+
|
|
389
|
+
- **Fixed PeerStore infinite recursion**: Removed 7 duplicate alias methods that called themselves recursively, fixing `Maximum call stack size exceeded` during `peer_discover`.
|
|
390
|
+
|
|
391
|
+
</details>
|
|
392
|
+
|
|
393
|
+
<details>
|
|
394
|
+
<summary><strong>v0.3.0 — 2026-06-18</strong></summary>
|
|
395
|
+
|
|
396
|
+
- **Peer memory sync**: `/peer memory sync` imports memories from all connected peers. Auto-sync on cron (`/peer memory auto on`).
|
|
397
|
+
- **Memory system dashboard**: `/memory dashboard` shows unified view of MemoryDB, Dream, Distill, Peer Sync, and timeline.
|
|
398
|
+
- **Legacy migration**: Auto-migrates old `session-memory.db` into MemoryDB during `/memory init`.
|
|
399
|
+
- **Redirected longTermMemory to MemoryDB**: Dream, graph, experience, cross-session all now read/write to MemoryDB instead of their own SQLite/JSON files.
|
|
400
|
+
- **MemoryDB — SQLite-backed memory store**: `memories` table (importance, confidence, access_count, type), `memory_timeline` table (event lifecycle). Budgeted querying, auto-eviction, timeline logging.
|
|
401
|
+
- **Memory hierarchy**: `.clew/memory/` directory with MEMORY.md, DECISIONS.md, TASTE.md. Auto-initializes on first use.
|
|
402
|
+
- **Budgeted injection**: Importance-ranked memory injection into system prompt, fits configurable token budget.
|
|
403
|
+
- **`/memory scan`**: Detects stack/language/package-manager/entrypoints, bootstraps seed memories.
|
|
404
|
+
- **`/memory rebuild`**: Reconstructs context from memories via budgeted injection with per-memory detail.
|
|
405
|
+
- **`/memory recall`**: Recalls memories ranked by combined score. Access count bump, `--verbose` for breakdown.
|
|
406
|
+
- **`/memory feedback`**: 7 signals (accepted, rejected, corrected, preferred, disliked, important, wrong). Updates importance/confidence, writes `preferred` to TASTE.md.
|
|
407
|
+
- **In-compact memory extraction**: Compact prompt asks LLM for `<memories>` block with structured facts; `parseCompactMemories()` extracts and saves to MemoryDB + markdown.
|
|
408
|
+
- **Peer task dashboard**: `/peer dashboard` command + `peer_dashboard` AI tool. Shows connected peers, tasks, and result summaries.
|
|
409
|
+
- **`/peer swarm`**: Sends shell command to ALL connected peers in parallel via `/peer-exec`, aggregates results. Supports `--timeout`, `--filter`, `--dry-run`.
|
|
410
|
+
- **`peer_swarm` tool**: New AI-callable tool — runs shell commands on all peers in parallel.
|
|
411
|
+
- **In-process message broker**: `POST /broker/send`, `GET /broker/recv` (long-poll), `POST /broker/reply`. Message queuing with correlation IDs inside existing PeerServer.
|
|
412
|
+
- **`/model` fetches from API for all providers**: `supportsModelFetching()` expanded to all providers (except google-assist).
|
|
413
|
+
- **Removed Anthropic provider**: clew-gateway + cline cover Anthropic models. Standalone `anthropic` entry removed.
|
|
414
|
+
- **Hidden `clew-gateway` provider**: Filtered from `PROVIDER_IDS`.
|
|
415
|
+
- **Auto memory lifecycle**: `ensureMemorySystem()` auto-inits DB + auto-scans on first access. Budgeted memories auto-injected every turn.
|
|
416
|
+
- **Memory tests**: 8 new tests for upsert idempotency, content-hash detection, recall ranking, feedback signals, and budget limits.
|
|
347
417
|
|
|
348
418
|
</details>
|
|
349
419
|
|
|
@@ -395,5 +465,3 @@ We welcome contributions. Read [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_COND
|
|
|
395
465
|
## License
|
|
396
466
|
|
|
397
467
|
[LICENSE.md](LICENSE.md) — covers only contributor-authored modifications and original additions. Does not grant rights to third-party software, models, or trademarks.
|
|
398
|
-
|
|
399
|
-
Clew Code is a fork of [Claude Code](https://github.com/anthropics/claude-code) (Anthropic). All original Claude Code code remains under its license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"BUILD_VERSION":"0.3.
|
|
1
|
+
{"BUILD_VERSION":"0.3.3","PACKAGE_URL":"clew-code","FEEDBACK_CHANNEL":"https://github.com/ClewCode/ClewCode/issues","ISSUES_EXPLAINER":"visit https://github.com/ClewCode/ClewCode/issues"}
|