clew-code 0.2.20 → 0.2.22

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.
Files changed (66) hide show
  1. package/dist/main.js +1888 -1883
  2. package/docs/architecture.html +91 -148
  3. package/docs/assets/clew-agent-loop.png +0 -0
  4. package/docs/assets/clew-general-architecture.png +0 -0
  5. package/docs/assets/clew-mcp-architecture.png +0 -0
  6. package/docs/assets/clew-p2p-swarm.png +0 -0
  7. package/docs/changelog.html +150 -0
  8. package/docs/cli-reference.html +90 -0
  9. package/docs/commands.html +156 -265
  10. package/docs/configuration.html +85 -147
  11. package/docs/contributing.html +91 -0
  12. package/docs/css/styles.css +425 -425
  13. package/docs/daemon.html +62 -129
  14. package/docs/features/bridge-mode.html +61 -66
  15. package/docs/features/evals.html +57 -149
  16. package/docs/features/searxng-search.html +58 -118
  17. package/docs/features/sentry-setup.html +61 -124
  18. package/docs/index.html +137 -125
  19. package/docs/installation.html +77 -105
  20. package/docs/internals/growthbook-ab-testing.html +69 -91
  21. package/docs/internals/hidden-features.html +81 -143
  22. package/docs/js/main.js +29 -0
  23. package/docs/loop.html +69 -181
  24. package/docs/mcp.html +99 -247
  25. package/docs/models.html +69 -110
  26. package/docs/permission-model.html +86 -102
  27. package/docs/plugins.html +84 -102
  28. package/docs/providers.html +87 -127
  29. package/docs/quick-start.html +81 -93
  30. package/docs/research-memory.html +71 -102
  31. package/docs/security.html +71 -0
  32. package/docs/skills.html +67 -117
  33. package/docs/swarm.html +78 -236
  34. package/docs/tools.html +152 -151
  35. package/docs/troubleshooting.html +86 -106
  36. package/docs/voice-mode.html +79 -0
  37. package/package.json +1 -1
  38. package/docs/architecture.th.html +0 -79
  39. package/docs/clew-code-architecture.html +0 -1126
  40. package/docs/commands.th.html +0 -269
  41. package/docs/configuration.th.html +0 -108
  42. package/docs/daemon.th.html +0 -73
  43. package/docs/features/bridge-mode.th.html +0 -62
  44. package/docs/features/evals.th.html +0 -62
  45. package/docs/features/searxng-search.th.html +0 -67
  46. package/docs/features/sentry-setup.th.html +0 -69
  47. package/docs/features/swarm.html +0 -156
  48. package/docs/generated/providers.html +0 -625
  49. package/docs/generated/tools.html +0 -558
  50. package/docs/index.th.html +0 -292
  51. package/docs/installation.th.html +0 -105
  52. package/docs/internals/growthbook-ab-testing.th.html +0 -60
  53. package/docs/internals/hidden-features.th.html +0 -107
  54. package/docs/loop.th.html +0 -227
  55. package/docs/mcp.th.html +0 -207
  56. package/docs/models.th.html +0 -61
  57. package/docs/permission-model.th.html +0 -67
  58. package/docs/plugins.th.html +0 -79
  59. package/docs/prompts-and-features.html +0 -806
  60. package/docs/providers.th.html +0 -81
  61. package/docs/quick-start.th.html +0 -89
  62. package/docs/research-memory.th.html +0 -72
  63. package/docs/skills.th.html +0 -90
  64. package/docs/swarm.th.html +0 -280
  65. package/docs/tools.th.html +0 -84
  66. package/docs/troubleshooting.th.html +0 -85
@@ -1,806 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Complete Prompt &amp; Feature Reference — Clew</title>
7
- <meta name="description" content="Complete reference for all prompts, commands, tools, providers, and features in Clew Code — the multi-provider AI coding assistant.">
8
- <link rel="preconnect" href="https://fonts.googleapis.com">
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
- <style>
14
- .toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin: 2rem 0; }
15
- .toc-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 1.25rem; }
16
- .toc-card:hover { border-color: var(--border-accent); }
17
- .toc-card h3 { font-size: var(--text-base); margin-bottom: 0.5rem; }
18
- .toc-card ul { list-style: none; padding: 0; }
19
- .toc-card li { font-size: var(--text-sm); color: var(--text-secondary); padding: 0.15rem 0; }
20
- .toc-card li::before { content: '→ '; color: var(--accent); }
21
- .section-divider { border: none; border-top: 1px solid var(--border-default); margin: 3rem 0; }
22
- .feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
23
- .feature-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 1.5rem; }
24
- .feature-card h3 { color: var(--accent); font-size: var(--text-base); margin-bottom: 0.5rem; }
25
- .feature-card p { font-size: var(--text-sm); color: var(--text-secondary); }
26
- .feature-card code { font-size: 0.75rem; }
27
- .badge { display: inline-block; background: var(--accent-muted); color: var(--accent); font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; margin-left: 0.4rem; }
28
- .badge-warn { background: rgba(244, 168, 88, 0.12); color: var(--warn); }
29
- .badge-info { background: rgba(112, 168, 255, 0.12); color: var(--info); }
30
- .prompt-box { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 8px; padding: 1rem; margin: 0.75rem 0; font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.6; color: var(--code-text); white-space: pre-wrap; overflow-x: auto; }
31
- h2 { margin-top: 2.5rem; }
32
- h3 { margin-top: 1.75rem; }
33
- .cmd-desc { font-size: var(--text-sm); color: var(--text-secondary); margin: 0.25rem 0 0.75rem 0; }
34
- .provider-group { margin: 1rem 0; }
35
- .provider-group details { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.4rem 0; }
36
- .provider-group summary { cursor: pointer; font-weight: 600; font-size: var(--text-sm); }
37
- </style>
38
- </head>
39
- <body>
40
-
41
- <header class="header"></header>
42
-
43
- <div class="app"><aside class="sidebar" id="sidebar"></aside><div class="sidebar-overlay" id="sidebarOverlay"></div>
44
- <div class="content-wrap"><main class="content">
45
-
46
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Prompts &amp; Features</span></div>
47
-
48
- <h1>Complete Prompt &amp; Feature Reference</h1>
49
- <p class="section-subtitle">Every command, tool, provider, and system feature in Clew Code — documented in one place. Covers <strong>120+ slash commands</strong>, <strong>76+ built-in tools</strong>, <strong>29+ AI providers</strong>, and the full plugin/skill/MCP/peer ecosystem.</p>
50
-
51
- <!-- ── Table of Contents ── -->
52
- <div class="toc-grid">
53
- <div class="toc-card"><h3>�� Slash Commands</h3><ul>
54
- <li>Session & Context</li><li>Model & Provider</li><li>Tools & Permissions</li>
55
- <li>Extensions (Plugins, MCP, Skills)</li><li>Collaboration</li>
56
- <li>Agents</li><li>System & Diagnostics</li>
57
- <li>Configuration</li><li>Git & Code Review</li>
58
- <li>Research & Search</li><li>Utilities</li>
59
- <li>Feature-Gated</li>
60
- </ul></div>
61
- <div class="toc-card"><h3>��️ Tools</h3><ul>
62
- <li>File & Code Operations</li><li>Shell & System</li>
63
- <li>Search & Web</li><li>Browser & Automation</li>
64
- <li>Agent & Task Management</li><li>Peer-to-Peer</li>
65
- <li>Git & PR</li><li>MCP</li><li>AI & Codex</li>
66
- </ul></div>
67
- <div class="toc-card"><h3>�� AI Providers</h3><ul>
68
- <li>Anthropic, OpenAI, Google</li><li>OpenRouter, OpenCode, DeepSeek</li>
69
- <li>Groq, xAI, Mistral, Cohere</li><li>KiloCode, Ollama</li>
70
- <li>Together, Fireworks, NVIDIA</li><li>DeepInfra, Perplexity, Cerebras</li>
71
- <li>SiliconFlow, Moonshot, Zhipu</li><li>HuggingFace, Poe, DigitalOcean</li>
72
- <li>Gemini Code Assist (OAuth)</li>
73
- </ul></div>
74
- <div class="toc-card"><h3>⚡ Features</h3><ul>
75
- <li>Multi-Provider Routing</li><li>Peer-to-Peer Swarm</li>
76
- <li>MCP Server Support</li><li>Plugin System</li>
77
- <li>Skills Framework</li><li>Voice Mode</li>
78
- <li>Agent System</li><li>Daemon / 24/7 Automation</li>
79
- <li>Bridge Remote Control</li><li>Adapter Layer</li>
80
- </ul></div>
81
- </div>
82
-
83
- <hr class="section-divider">
84
-
85
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
86
- <!-- SECTION 1: SLASH COMMANDS -->
87
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
88
-
89
- <h2 id="commands">1. Slash Commands</h2>
90
- <p>Clew ships with <strong>120+ slash commands</strong> (411 files across 120+ directories) plus dynamically loaded skills and plugin commands. Type <code>/</code> in the REPL to see all available commands.</p>
91
-
92
- <h3 id="cmd-session">Session &amp; Context</h3>
93
- <table>
94
- <tr><th>Command</th><th>Description</th></tr>
95
- <tr><td><code>/clear</code></td><td>Clear conversation history and free up context</td></tr>
96
- <tr><td><code>/compact</code></td><td>Compress session context — multi-pass chunk+re-compact automatic fallback</td></tr>
97
- <tr><td><code>/context</code></td><td>Visualize current context usage as a colored grid</td></tr>
98
- <tr><td><code>/resume</code></td><td>Resume a previous conversation</td></tr>
99
- <tr><td><code>/rename</code></td><td>Rename the current conversation</td></tr>
100
- <tr><td><code>/rewind</code></td><td>Restore code and/or conversation to a previous point</td></tr>
101
- <tr><td><code>/copy</code></td><td>Copy Clew's last response to clipboard (or /copy N for Nth-latest)</td></tr>
102
- <tr><td><code>/export</code></td><td>Export the current conversation to a file or clipboard</td></tr>
103
- <tr><td><code>/session</code></td><td>Show remote session URL and QR code</td></tr>
104
- <tr><td><code>/branch</code></td><td>Create a branch of the current conversation at this point</td></tr>
105
- <tr><td><code>/files</code></td><td>List all files currently in context</td></tr>
106
- </table>
107
-
108
- <h3 id="cmd-model">Model &amp; Provider</h3>
109
- <table>
110
- <tr><th>Command</th><th>Description</th></tr>
111
- <tr><td><code>/model</code></td><td>Switch model or provider � fetches live models from provider API. <code>s</code>=session-only, Enter=save default</td></tr>
112
- <tr><td><code>/provider-select</code></td><td>Show or change the active AI provider and model</td></tr>
113
- <tr><td><code>/taste</code></td><td>Open taste preference-learning interactive menu (learn, forget, profile, events, decay, eval, on/off)</td></tr>
114
- <tr><td><code>/effort</code></td><td>Set effort level for model reasoning (low, medium, high, xhigh, max, ultracode, auto)</td></tr>
115
- <tr><td><code>/ultracode</code></td><td>Toggle ultracode mode � xhigh effort + auto-triggered dynamic workflows</td></tr>
116
- <tr><td><code>/cost</code></td><td>Show the total cost and duration of the current session</td></tr>
117
- <tr><td><code>/usage</code></td><td>Show plan usage limits</td></tr>
118
- <tr><td><code>/usage-credits</code></td><td>Configure usage credits to keep working when limits are hit</td></tr>
119
- <tr><td><code>/stats</code></td><td>Show your Clew usage statistics and activity</td></tr>
120
- <tr><td><code>/rate-limit-options</code></td><td>Show options when rate limit is reached</td></tr>
121
- <tr><td><code>/upgrade</code></td><td>Upgrade to Max for higher rate limits and more Opus</td></tr>
122
- </table>
123
-
124
- <h3 id="cmd-tools">Tools &amp; Permissions</h3>
125
- <table>
126
- <tr><th>Command</th><th>Description</th></tr>
127
- <tr><td><code>/tools</code></td><td>List all tools with usage stats and estimated token cost</td></tr>
128
- <tr><td><code>/permissions</code></td><td>Manage allow &amp; deny tool permission rules</td></tr>
129
- <tr><td><code>/plan</code></td><td>Enable plan mode or view the current session plan</td></tr>
130
- <tr><td><code>/privacy-settings</code></td><td>View and update your privacy settings</td></tr>
131
- <tr><td><code>/datadog</code></td><td>Manage individual telemetry and analytics settings</td></tr>
132
- <tr><td><code>/capabilities</code></td><td>Show available system capabilities (git, tmux, browser, network, shells)</td></tr>
133
- <tr><td><code>/hooks</code></td><td>View hook configurations for tool events</td></tr>
134
- <tr><td><code>/sandbox-toggle</code></td><td>Toggle sandbox mode for tool execution</td></tr>
135
- </table>
136
-
137
- <h3 id="cmd-extensions">Extensions (Plugins, MCP, Skills)</h3>
138
- <table>
139
- <tr><th>Command</th><th>Description</th></tr>
140
- <tr><td><code>/plugin</code></td><td>Manage plugins � list, install, remove</td></tr>
141
- <tr><td><code>/plugin-details</code></td><td>Show plugin component inventory, hooks, MCP servers, and per-session token cost</td></tr>
142
- <tr><td><code>/reload-plugins</code></td><td>Activate pending plugin changes in the current session</td></tr>
143
- <tr><td><code>/mcp</code></td><td>Manage MCP servers (list, add, remove, approve)</td></tr>
144
- <tr><td><code>/skill</code></td><td>List available skills or show skill details</td></tr>
145
- <tr><td><code>/skills</code></td><td>List available skills</td></tr>
146
- <tr><td><code>/code-review</code></td><td>Review changed code (low/medium/high effort; <code>--fix</code> applies changes, <code>--comment</code> posts PR comments)</td></tr>
147
- <tr><td><code>/simplify</code></td><td>Cleanup-only code review (reuse, efficiency, altitude) with auto-fix</td></tr>
148
- </table>
149
-
150
- <h3 id="cmd-collab">Collaboration</h3>
151
- <table>
152
- <tr><th>Command</th><th>Description</th></tr>
153
- <tr><td><code>/swarm</code></td><td>Open interactive LAN swarm menu (share, discover, join, inbox)</td></tr>
154
- <tr><td><code>/swarm share</code></td><td>Start advertising this Clew instance as a worker</td></tr>
155
- <tr><td><code>/swarm share stop</code></td><td>Stop advertising and shut down the local swarm server</td></tr>
156
- <tr><td><code>/swarm discover</code></td><td>Scan for available LAN workers</td></tr>
157
- <tr><td><code>/swarm join &lt;host&gt;:&lt;port&gt;</code></td><td>Connect to a remote Clew swarm peer</td></tr>
158
- <tr><td><code>/swarm todo &lt;peer&gt; &lt;task&gt;</code></td><td>Assign a task to a worker</td></tr>
159
- <tr><td><code>/swarm inbox</code></td><td>View pending messages and tasks</td></tr>
160
- <tr><td><code>/bridge</code></td><td>Bridge mode for remote-control sessions <span class="badge badge-warn">BRIDGE_MODE=1</span></td></tr>
161
- </table>
162
-
163
- <h3 id="cmd-agents">Agents</h3>
164
- <table>
165
- <tr><th>Command</th><th>Description</th></tr>
166
- <tr><td><code>/agent</code></td><td>Manage AI Agents execution, state checkpoints, and approvals</td></tr>
167
- <tr><td><code>/agents</code></td><td>Open interactive agent dashboard with grouped sessions, PR columns, AI summaries</td></tr>
168
- <tr><td><code>!bg &lt;cmd&gt;</code></td><td>Run a shell command as a persistent background agent task</td></tr>
169
- <tr><td><code>/tasks</code></td><td>List and manage background tasks</td></tr>
170
- <tr><td><code>/daemon</code></td><td>Open interactive 24/7 autonomous daemon control panel</td></tr>
171
- <tr><td><code>/task</code></td><td>Create scheduled tasks with interactive form</td></tr>
172
- <tr><td><code>/loop</code></td><td>Run a prompt or slash command on a recurring interval</td></tr>
173
- <tr><td><code>/autofix-pr</code></td><td>Fix CI errors and address review comments on a PR using Clew on the web</td></tr>
174
- </table>
175
-
176
- <h3 id="cmd-system">System &amp; Diagnostics</h3>
177
- <table>
178
- <tr><th>Command</th><th>Description</th></tr>
179
- <tr><td><code>/help</code></td><td>Show help and available commands</td></tr>
180
- <tr><td><code>/status</code></td><td>Show Clew status (version, model, account, API connectivity, tool statuses)</td></tr>
181
- <tr><td><code>/doctor</code></td><td>Diagnose and verify your Clew installation and settings</td></tr>
182
- <tr><td><code>/exit</code></td><td>Exit the REPL</td></tr>
183
- <tr><td><code>/version</code></td><td>Show version</td></tr>
184
- <tr><td><code>/release-notes</code></td><td>View release notes</td></tr>
185
- </table>
186
-
187
- <h3 id="cmd-config">Configuration</h3>
188
- <table>
189
- <tr><th>Command</th><th>Description</th></tr>
190
- <tr><td><code>/config</code></td><td>Open config panel</td></tr>
191
- <tr><td><code>/theme</code></td><td>Change the theme</td></tr>
192
- <tr><td><code>/color</code></td><td>Set the prompt bar color for this session</td></tr>
193
- <tr><td><code>/keybindings</code></td><td>Open or create your keybindings configuration file</td></tr>
194
- <tr><td><code>/scroll-speed</code></td><td>Set mouse wheel scroll speed multiplier (1-20)</td></tr>
195
- <tr><td><code>/output-style</code></td><td>Change output style (deprecated � use /config)</td></tr>
196
- <tr><td><code>/remote-env</code></td><td>Configure default remote environment for teleport sessions</td></tr>
197
- <tr><td><code>/init</code></td><td>Run Setup hooks with init trigger</td></tr>
198
- </table>
199
-
200
- <h3 id="cmd-git">Git &amp; Code Review</h3>
201
- <table>
202
- <tr><th>Command</th><th>Description</th></tr>
203
- <tr><td><code>/diff</code></td><td>View uncommitted changes and per-turn diffs</td></tr>
204
- <tr><td><code>/commit</code></td><td>Stage and commit changes</td></tr>
205
- <tr><td><code>/commit-push-pr</code></td><td>Commit, push, and create a PR</td></tr>
206
- <tr><td><code>/review</code></td><td>Review code changes</td></tr>
207
- <tr><td><code>/security-review</code></td><td>Run a security review</td></tr>
208
- <tr><td><code>/pr-comments</code></td><td>Get comments from a GitHub pull request</td></tr>
209
- <tr><td><code>/install-github-app</code></td><td>Set up Clew GitHub Actions for a repository</td></tr>
210
- <tr><td><code>/pr</code></td><td>GitHub PR management (create, list, view, review, merge, status)</td></tr>
211
- </table>
212
-
213
- <h3 id="cmd-research">Research &amp; Search</h3>
214
- <table>
215
- <tr><th>Command</th><th>Description</th></tr>
216
- <tr><td><code>/research</code></td><td>Deep source-grounded research across local files, wiki, and memory</td></tr>
217
- <tr><td><code>/memory</code></td><td>Memory management &mdash; <code>save</code>, <code>timeline</code>, <code>stats</code>, <code>digest</code>, <code>search</code>, <code>preview</code>, <code>consolidate</code></td></tr>
218
- <tr><td><code>/memory-search</code></td><td>Search memories using semantic search (cross-lingual)</td></tr>
219
- <tr><td><code>/searxng</code></td><td>Start, stop, or check status of local SearXNG Docker container</td></tr>
220
- <tr><td><code>/explorer</code></td><td>Toggle file explorer sidebar</td></tr>
221
- </table>
222
-
223
- <h3 id="cmd-utils">Utilities</h3>
224
- <table>
225
- <tr><th>Command</th><th>Description</th></tr>
226
- <tr><td><code>/btw</code></td><td>Ask a quick side question without interrupting main conversation</td></tr>
227
- <tr><td><code>/buddy</code></td><td>Configure your AI companion (Buddy)</td></tr>
228
- <tr><td><code>/desktop</code></td><td>Continue current session in Clew Web UI</td></tr>
229
- <tr><td><code>/mobile</code></td><td>Show QR code to download Clew mobile app</td></tr>
230
- <tr><td><code>/powerup</code></td><td>Interactive lessons teaching Clew features with animated demos</td></tr>
231
- <tr><td><code>/feedback</code></td><td>Submit feedback about Clew</td></tr>
232
- <tr><td><code>/onboarding</code></td><td>Run the interactive onboarding wizard</td></tr>
233
- <tr><td><code>/team-onboarding</code></td><td>Generate a teammate ramp-up guide from your local usage</td></tr>
234
- <tr><td><code>/add-dir</code></td><td>Add a new working directory</td></tr>
235
- <tr><td><code>/goal</code></td><td>Set a session goal</td></tr>
236
- <tr><td><code>/heapdump</code></td><td>Dump the JS heap to ~/Desktop</td></tr>
237
- <tr><td><code>/stickers</code></td><td>Order Clew stickers</td></tr>
238
- <tr><td><code>/thinkback</code></td><td>Your Clew Year in Review</td></tr>
239
- <tr><td><code>/eval</code></td><td>Evaluate AI agent performance with verification harness</td></tr>
240
- </table>
241
-
242
- <h3 id="cmd-feature-gated">Feature-Gated Commands</h3>
243
- <table>
244
- <tr><th>Command</th><th>Flag</th><th>Description</th></tr>
245
- <tr><td><code>/voice</code></td><td><code>VOICE_MODE=1</code></td><td>Toggle voice mode � microphone recording + Whisper transcription</td></tr>
246
- <tr><td><code>/bridge</code></td><td><code>BRIDGE_MODE=1</code></td><td>Bridge mode for WebSocket remote-control sessions</td></tr>
247
- <tr><td><code>/brief</code></td><td><code>KAIROS=1</code></td><td>Brief command for mobile push notifications</td></tr>
248
- <tr><td><code>/assistant</code></td><td><code>KAIROS=1</code></td><td>Assistant mode</td></tr>
249
- <tr><td><code>/ant</code></td><td><code>USER_TYPE=ant</code></td><td>Toggle ant-only beta features</td></tr>
250
- <tr><td><code>/ultraplan</code></td><td>Internal</td><td>Extended plan mode</td></tr>
251
- <tr><td><code>/bughunter</code></td><td>Internal</td><td>Bug hunting workflow</td></tr>
252
- <tr><td><code>/computer-use</code></td><td><code>ENABLE_COMPUTER_USE=1</code></td><td>Windows computer-use automation</td></tr>
253
- <tr><td><code>/worktree</code></td><td>Built-in</td><td>Create/exit isolated git worktrees</td></tr>
254
- </table>
255
-
256
- <hr class="section-divider">
257
-
258
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
259
- <!-- SECTION 2: SYSTEM TOOLS WITH PROMPTS -->
260
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
261
-
262
- <h2 id="tools">2. System Tools � Prompts &amp; Descriptions</h2>
263
- <p>Clew provides <strong>76+ built-in tools</strong> (353 files across 76 directories) plus dynamically loaded MCP tools. Tools are invoked by the AI model via <code>tool_use</code> blocks. Each tool below includes its system prompt as seen by the AI.</p>
264
-
265
- <h3 id="tools-file">File &amp; Code Operations</h3>
266
-
267
- <details><summary><code>Read</code> (FileReadTool) � Read files with line numbers, supports images, PDFs, Jupyter notebooks <span class="badge">Zod</span></summary>
268
- <div class="cmd-desc">Reads a file from the local filesystem. Supports plain text, images (PNG, JPG, GIF, WebP), PDFs, and Jupyter notebooks.</div>
269
- </details>
270
-
271
- <details><summary><code>Write</code> (FileWriteTool) � Create new files with full content <span class="badge">Zod</span></summary>
272
- <div class="cmd-desc">Writes a file to the local filesystem. Overwrites existing files. Requires reading the file first if it already exists.</div>
273
- </details>
274
-
275
- <details><summary><code>Edit</code> (FileEditTool) � Exact string replacement edits <span class="badge">Zod</span></summary>
276
- <div class="cmd-desc">Performs exact string replacements in files. Uses <code>old_string</code>/<code>new_string</code> pairs. Supports <code>replace_all</code> for bulk renaming.</div>
277
- </details>
278
-
279
- <details><summary><code>Glob</code> (GlobTool) � Fast file pattern matching <span class="badge">Zod</span></summary>
280
- <div class="cmd-desc">Fast file pattern matching tool that works with any codebase size. Supports glob patterns like <code>**/*.js</code>. Returns matching file paths sorted by modification time.</div>
281
- </details>
282
-
283
- <details><summary><code>Grep</code> (GrepTool) � Regex content search <span class="badge">Zod</span></summary>
284
- <div class="cmd-desc">Powerful search tool built on ripgrep. Supports regex patterns, context lines (<code>-A</code>, <code>-B</code>, <code>-C</code>), multiline matching, file type filtering, and case-insensitive search.</div>
285
- </details>
286
-
287
- <details><summary><code>NotebookEdit</code> (NotebookEditTool) � Jupyter notebook cell editing <span class="badge">Zod</span></summary>
288
- <div class="cmd-desc">Completely replaces the contents of a specific cell in a Jupyter notebook. Supports replace, insert, and delete modes.</div>
289
- </details>
290
-
291
- <details><summary><code>JsonPath</code> (JsonPathTool) � JSON query &amp; transform <span class="badge">Zod</span></summary>
292
- <div class="cmd-desc">Query, validate, format, minify, and convert JSON data using JSONPath expressions. Supports nested key paths and array indices.</div>
293
- </details>
294
-
295
- <h3 id="tools-shell">Shell &amp; System</h3>
296
-
297
- <details><summary><code>Bash</code> (BashTool) � Execute shell commands <span class="badge">Zod</span></summary>
298
- <div class="prompt-box">Executes a given bash command and returns its output.
299
-
300
- The working directory persists between commands, but shell state does not. The shell environment is initialized from the user's profile (bash or zsh).
301
-
302
- IMPORTANT: Avoid using this tool to run find, grep, cat, head, tail, sed, awk, or echo commands � use Glob, Grep, Read, Edit, Write tools instead.
303
-
304
- Parameters:
305
- - command: The command to execute
306
- - description: Clear description of what this command does
307
- - timeout: Optional timeout in milliseconds (max 600000)
308
- - run_in_background: Set to true for non-blocking execution
309
- - dangerouslyDisableSandbox: Override sandbox mode</div>
310
- </details>
311
-
312
- <details><summary><code>Monitor</code> (MonitorTool) � Stream task output <span class="badge">Zod</span></summary>
313
- <div class="cmd-desc">Streams stdout/stderr from background tasks in real-time. Takes a <code>task_id</code> and optional <code>timeout</code>. Ideal for watching logs and build output.</div>
314
- </details>
315
-
316
- <details><summary><code>PowerShell</code> (PowerShellTool) � Windows PowerShell <span class="badge badge-warn">Windows</span></summary>
317
- <div class="cmd-desc">PowerShell execution on Windows systems. Feature-gated for cross-platform compatibility.</div>
318
- </details>
319
-
320
- <h3 id="tools-search">Search &amp; Web</h3>
321
-
322
- <details><summary><code>WebSearch</code> (WebSearchTool) � Web search <span class="badge">Zod</span></summary>
323
- <div class="prompt-box">Allows Claude to search the web and use the results to inform responses.
324
- Provides up-to-date information for current events and recent data.
325
- Returns search result information formatted as search result blocks, including links as markdown hyperlinks.
326
- Supports domain filtering (include/block specific websites).
327
-
328
- CRITICAL: After answering, you MUST include a "Sources:" section with all relevant URLs.</div>
329
- </details>
330
-
331
- <details><summary><code>WebFetch</code> (WebFetchTool) � URL content fetch <span class="badge">Zod</span></summary>
332
- <div class="cmd-desc">Fetches content from a specified URL, converts HTML to markdown, and processes with an AI model. Includes a self-cleaning 15-minute cache. HTTP URLs are auto-upgraded to HTTPS.</div>
333
- </details>
334
-
335
- <details><summary><code>SessionSearch</code> (SessionSearchTool) � Past session search <span class="badge">Zod</span></summary>
336
- <div class="cmd-desc">Full-text search (FTS5) across all past session transcripts in the current project. Results are ranked by BM25 relevance and include session ID, role, and content excerpt.</div>
337
- </details>
338
-
339
- <details><summary><code>ToolSearch</code> (ToolSearchTool) � Keyword tool search <span class="badge">Zod</span></summary>
340
- <div class="cmd-desc">Keyword search for deferred/lazy-loaded tools. Helps the AI discover tools that may not be loaded in the current session.</div>
341
- </details>
342
-
343
- <details><summary><code>Research</code> (ResearchTool) � Deep research <span class="badge">Zod</span></summary>
344
- <div class="cmd-desc">Deep source-grounded research across local files, wiki, memory, and web. Uses multi-round search and synthesis for comprehensive answers.</div>
345
- </details>
346
-
347
- <h3 id="tools-browser">Browser &amp; Automation</h3>
348
-
349
- <details><summary><code>Browser</code> (BrowserTool) � Stealth Playwright browser <span class="badge">Zod</span></summary>
350
- <div class="prompt-box">Control a stealth web browser (Playwright). Most actions return URL/title/text only for speed; call screenshot when you need to inspect the page visually.
351
-
352
- TARGETING: click, click_at, click_text, click_role, hover, focus
353
- FORM FILLING: fill, type, type_at, fill_label, clear, select, check, uncheck, upload, press
354
- NAVIGATION: navigate, go_back, go_forward, reload
355
- CONTENT: screenshot, extract, get_text, get_attribute, get_value, get_links, get_inputs, evaluate, search
356
- WAITING: wait_for, wait_for_url
357
- IFRAME: frame_click, frame_fill
358
- TABS: open_new_tab, switch_tab (by index), close_tab, list_tabs
359
- SESSION: close (saves cookies for next session)</div>
360
- </details>
361
-
362
- <details><summary><code>BrowserAgent</code> (BrowserAgentTool) — Autonomous web agent</summary>
363
- <div class="prompt-box">Run an autonomous web agent that uses browser automation to achieve complex goals.<br>
364
- <br>
365
- <b>Modes:</b><br>
366
- - <code>vision</code> (default) — uses screenshots, requires vision-capable model<br>
367
- - <code>text</code> — uses accessibility tree + element selectors (<code>data-cl-id</code>), works with any text model<br>
368
- <br>
369
- <b>Example:</b> "Go to github.com/JonusNattapong and summarize" (<code>mode: "text"</code>)<br>
370
- <b>Example:</b> "Find the cheapest flight from BKK to NRT next Monday"<br>
371
- <br>
372
- <b>Features:</b> Multi-step AI planning, anti-bot stealth, CAPTCHA detection, anti-loop detection, blocked URL policy, debug replay.<br>
373
- <br>
374
- <b>Tab management:</b> <code>open_new_tab</code>, <code>switch_tab</code>, <code>close_tab</code>, <code>list_tabs</code> via BrowserSession singleton</div>
375
- </details>
376
- <details><summary><code>ComputerUse</code> (ComputerUseTool) � Windows automation <span class="badge badge-warn">ENABLE_COMPUTER_USE=1</span></summary>
377
- <div class="cmd-desc">Windows-only computer use automation. Feature-gated behind the ENABLE_COMPUTER_USE environment variable.</div>
378
- </details>
379
-
380
- <h3 id="tools-agent">Agent &amp; Task Management</h3>
381
- <table>
382
- <tr><th>Tool</th><th>Description</th></tr>
383
- <tr><td><code>Skill</code> (SkillTool)</td><td>Invoke skills and prompt-type commands by name. Skills are user-defined or built-in automations.</td></tr>
384
- <tr><td><code>AskUserQuestion</code></td><td>Ask the user interactive questions during execution. Supports single/multi-select, options with previews.</td></tr>
385
- <tr><td><code>SendMessage</code></td><td>Send messages between agents in coordinator/swarm mode.</td></tr>
386
- <tr><td><code>EnterPlanMode</code></td><td>Enter structured plan mode for complex implementation tasks. Includes codebase exploration and design.</td></tr>
387
- <tr><td><code>ExitPlanMode</code></td><td>Exit plan mode with user approval of the plan. Proceeds to implementation.</td></tr>
388
- <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Create/exit isolated git worktrees for parallel branches.</td></tr>
389
- <tr><td><code>TaskCreate / TaskUpdate / TaskList / TaskGet</code></td><td>Full task tracking system � create, update, list, get task details with dependency management.</td></tr>
390
- <tr><td><code>TaskOutput / TaskStop</code></td><td>Get output from running tasks or stop them.</td></tr>
391
- <tr><td><code>TodoWrite</code></td><td>Write todo list items to track progress during complex tasks.</td></tr>
392
- </table>
393
-
394
- <h3 id="tools-peer">Peer-to-Peer Tools</h3>
395
- <table>
396
- <tr><th>Tool</th><th>Description</th></tr>
397
- <tr><td><code>peer_discover</code></td><td>Scan LAN for other Clew instances sharing as workers. Supports UDP multicast + file registry. Returns hostname, IP, port, CWD, shell type.</td></tr>
398
- <tr><td><code>peer_share</code></td><td>Start/stop advertising this instance as a worker on the LAN.</td></tr>
399
- <tr><td><code>peer_join</code></td><td>Connect to a remote peer by host:port via HTTP.</td></tr>
400
- <tr><td><code>peer_info</code></td><td>Get detailed info about a specific peer (hostname, IP, port, CWD, shell, platform, status).</td></tr>
401
- <tr><td><code>peer_list_roles</code></td><td>List all discovered peers with display names and assigned roles.</td></tr>
402
- <tr><td><code>peer_set_name / peer_set_role</code></td><td>Assign human-readable names and functional roles to peers.</td></tr>
403
- <tr><td><code>peer_send_message</code></td><td>Send chat messages to peers. Supports waitResponse, chunking for long messages.</td></tr>
404
- <tr><td><code>peer_broadcast</code></td><td>Broadcast a task to ALL connected peers simultaneously.</td></tr>
405
- <tr><td><code>peer_run</code></td><td>Execute a shell command on a remote worker peer via HTTP API.</td></tr>
406
- <tr><td><code>peer_spawn</code></td><td>Spawn a new local peer terminal window running Clew. Auto-joins and registers.</td></tr>
407
- <tr><td><code>peer_ping</code></td><td>Ping a peer to check online status. Supports wait mode.</td></tr>
408
- <tr><td><code>peer_disconnect</code></td><td>Remove a peer from the local connection list.</td></tr>
409
- <tr><td><code>peer_list_messages</code></td><td>List peer chat message history. Chunked messages auto-reassembled.</td></tr>
410
- <tr><td><code>peer_help</code></td><td>Complete guide to peer-to-peer tools, flow, and best practices.</td></tr>
411
- </table>
412
-
413
- <h3 id="tools-git">Git &amp; PR Tools</h3>
414
- <table>
415
- <tr><th>Tool</th><th>Description</th></tr>
416
- <tr><td><code>PR</code> (PRTool)</td><td>Full GitHub PR lifecycle � create, list, view, review (AI diff analysis), merge (squash), status (CI checks). Uses <code>gh</code> CLI.</td></tr>
417
- <tr><td><code>VerifyPlanExecution</code></td><td>Verify that a plan was executed correctly by checking code changes.</td></tr>
418
- </table>
419
-
420
- <h3 id="tools-mcp">MCP Tools</h3>
421
- <table>
422
- <tr><th>Tool</th><th>Description</th></tr>
423
- <tr><td><code>ListMcpResourcesTool</code></td><td>List available resources from configured MCP servers, with optional server filter.</td></tr>
424
- <tr><td><code>ReadMcpResourceTool</code></td><td>Read a specific resource from an MCP server by server name and resource URI.</td></tr>
425
- <tr><td><code>MCPTool</code> (MCPTool)</td><td>Generic MCP tool interaction � delegates to configured MCP servers via stdio or SSE.</td></tr>
426
- <tr><td><code>McpAuthTool</code></td><td>Handle MCP OAuth authentication flows for MCP servers that require authorization.</td></tr>
427
- </table>
428
-
429
- <h3 id="tools-ai">AI &amp; Codex</h3>
430
- <table>
431
- <tr><th>Tool</th><th>Description</th></tr>
432
- <tr><td><code>codex_peer</code> (CodexPeerTool)</td><td>Run a process-backed Codex CLI peer for one task. Supports exec (child_process.spawn) and pty (node-pty) modes. PTY mode renders a live terminal progress box.</td></tr>
433
- <tr><td><code>process_peer</code> (ProcessPeerTool)</td><td>Run a process-backed AI peer for one task. Supports exec and pty modes. Available providers: codex.</td></tr>
434
- </table>
435
-
436
- <h3 id="tools-other">Other Tools</h3>
437
- <table>
438
- <tr><th>Tool</th><th>Description</th></tr>
439
- <tr><td><code>ConfigTool</code></td><td>Read/write configuration settings. Supports global and project-local settings.</td></tr>
440
- <tr><td><code>REPLTool</code></td><td>Execute REPL commands programmatically.</td></tr>
441
- <tr><td><code>ScheduleCronTool</code></td><td>Schedule recurring tasks via cron expressions.</td></tr>
442
- <tr><td><code>SleepTool</code></td><td>Sleep for a specified duration (used in automation workflows).</td></tr>
443
- <tr><td><code>SyntheticOutputTool</code></td><td>Generate synthetic test output for testing purposes.</td></tr>
444
- <tr><td><code>RequestShutdownTool</code></td><td>Request graceful shutdown of the application.</td></tr>
445
- <tr><td><code>RemoteTriggerTool</code></td><td>Trigger actions on remote Clew instances.</td></tr>
446
- <tr><td><code>WorkflowTool</code></td><td>Execute multi-step workflows defined in YAML/JSON.</td></tr>
447
- <tr><td><code>TungstenTool</code></td><td>Tungsten telemetry and diagnostics tool.</td></tr>
448
- <tr><td><code>PrSubscriptionTool</code></td><td>Manage PR subscriptions for notifications.</td></tr>
449
- <tr><td><code>TeamCreate / TeamDelete</code></td><td>Create and delete AI agent teams for swarm collaboration.</td></tr>
450
- <tr><td><code>SuggestBackgroundPRTool</code></td><td>Suggest creating a PR for background work.</td></tr>
451
- <tr><td><code>BriefTool</code></td><td>Quick brief/summary generation.</td></tr>
452
- <tr><td><code>AgentTool</code></td><td>Agent mode tools for delegation and coordination.</td></tr>
453
- </table>
454
-
455
- <hr class="section-divider">
456
-
457
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
458
- <!-- SECTION 3: AI PROVIDERS -->
459
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
460
-
461
- <h2 id="providers">3. AI Providers</h2>
462
- <p>Clew supports <strong>29 AI providers</strong> with a unified adapter layer. Switch between providers at runtime with <code>/model</code> or <code>/provider-select</code>. Provider config is declared in <code>providers.json</code> and managed by <strong>ProviderManager</strong>.</p>
463
-
464
- <h3 id="providers-full">All Providers</h3>
465
- <table>
466
- <tr><th>Provider</th><th>Env Key</th><th>Default Model</th><th>Capabilities</th><th>Auth</th></tr>
467
- <tr><td><strong>Anthropic</strong></td><td><code>ANTHROPIC_API_KEY</code></td><td>claude-sonnet-4-7</td><td>Native TC, Vision, Reasoning, 1M ctx</td><td>API Key / OAuth</td></tr>
468
- <tr><td><strong>OpenAI</strong></td><td><code>OPENAI_API_KEY</code></td><td>gpt-5.5</td><td>TC, Vision, Reasoning, 1M+ ctx</td><td>API Key / OAuth / Azure</td></tr>
469
- <tr><td><strong>Google Gemini</strong></td><td><code>GOOGLE_API_KEY</code></td><td>gemini-3.1-pro-preview</td><td>TC, Vision, 2M ctx</td><td>API Key / Vertex / OAuth</td></tr>
470
- <tr><td><strong>Gemini Code Assist</strong><span class="badge badge-info">NEW</span></td><td><code>GEMINI_API_KEY*</code></td><td>gemini-2.5-flash</td><td>Vision, Streaming, 1M ctx</td><td>OAuth (<code>~/.gemini/</code>)</td></tr>
471
- <tr><td><strong>OpenRouter</strong></td><td><code>OPENROUTER_API_KEY</code></td><td>�</td><td>TC, Vision, 100+ models</td><td>API Key</td></tr>
472
- <tr><td><strong>DeepSeek</strong></td><td><code>DEEPSEEK_API_KEY</code></td><td>deepseek-v4-pro</td><td>TC, Vision, 1M ctx</td><td>API Key</td></tr>
473
- <tr><td><strong>OpenCode</strong></td><td><code>OPENCODE_API_KEY</code></td><td>claude-opus-4-7</td><td>TC, Vision, 1M ctx, 41 models</td><td>API Key</td></tr>
474
- <tr><td><strong>OpenCode Go</strong></td><td><code>OPENCODE_GO_API_KEY</code></td><td>minimax-m2.7</td><td>Low-cost open models</td><td>API Key</td></tr>
475
- <tr><td><strong>Cline API</strong></td><td><code>CLINE_API_KEY</code></td><td>anthropic/claude-opus-4-7</td><td>TC, Vision, routed</td><td>API Key</td></tr>
476
- <tr><td><strong>Groq</strong></td><td><code>GROQ_API_KEY</code></td><td>llama-3.3-70b-versatile</td><td>Fast inference, 128K ctx</td><td>API Key</td></tr>
477
- <tr><td><strong>xAI</strong></td><td><code>XAI_API_KEY</code></td><td>grok-4.3</td><td>TC, Vision, 128K ctx</td><td>API Key</td></tr>
478
- <tr><td><strong>Mistral</strong></td><td><code>MISTRAL_API_KEY</code></td><td>mistral-small-latest</td><td>TC, Vision, 128K ctx</td><td>API Key</td></tr>
479
- <tr><td><strong>KiloCode</strong></td><td><code>KILOCODE_API_KEY</code></td><td>kilo-auto/free</td><td>500+ models, free tier</td><td>API Key</td></tr>
480
- <tr><td><strong>Ollama (Local)</strong></td><td><code>OLLAMA_API_KEY</code></td><td>llama3.3</td><td>Local/offline, any model</td><td>Local</td></tr>
481
- <tr><td><strong>Together AI</strong></td><td><code>TOGETHER_API_KEY</code></td><td>�</td><td>TC, Vision, Llama 4</td><td>API Key</td></tr>
482
- <tr><td><strong>Fireworks AI</strong></td><td><code>FIREWORKS_API_KEY</code></td><td>�</td><td>Fast inference, Llama 4</td><td>API Key</td></tr>
483
- <tr><td><strong>NVIDIA NIM</strong></td><td><code>NVIDIA_API_KEY</code></td><td>�</td><td>DeepSeek, Llama, Nemotron</td><td>API Key</td></tr>
484
- <tr><td><strong>Cohere</strong></td><td><code>COHERE_API_KEY</code></td><td>command-a-plus-05-2026</td><td>128K ctx, no vision</td><td>API Key</td></tr>
485
- <tr><td><strong>DeepInfra</strong></td><td><code>DEEPINFRA_API_KEY</code></td><td>�</td><td>Llama 4 Scout, 327K ctx</td><td>API Key</td></tr>
486
- <tr><td><strong>Perplexity</strong></td><td><code>PERPLEXITY_API_KEY</code></td><td>�</td><td>Sonar, online search</td><td>API Key</td></tr>
487
- <tr><td><strong>Cerebras</strong></td><td><code>CEREBRAS_API_KEY</code></td><td>�</td><td>WSI, ultra-fast, Qwen 3</td><td>API Key</td></tr>
488
- <tr><td><strong>SiliconFlow</strong></td><td><code>SILICONFLOW_API_KEY</code></td><td>�</td><td>DeepSeek V4, China-based</td><td>API Key</td></tr>
489
- <tr><td><strong>Moonshot (Kimi)</strong></td><td><code>MOONSHOT_API_KEY</code></td><td>kimi-latest</td><td>TC, Vision, 128K ctx</td><td>API Key</td></tr>
490
- <tr><td><strong>Zhipu (GLM)</strong></td><td><code>ZHIPU_API_KEY</code></td><td>glm-4</td><td>128K ctx</td><td>API Key</td></tr>
491
- <tr><td><strong>HuggingFace</strong></td><td><code>HUGGINGFACE_API_KEY</code></td><td>�</td><td>Inference API, Llama 3.1</td><td>API Key</td></tr>
492
- <tr><td><strong>Poe</strong></td><td><code>POE_API_KEY</code></td><td>�</td><td>Claude 3.7 via Poe gateway</td><td>API Key</td></tr>
493
- <tr><td><strong>DigitalOcean</strong></td><td><code>DIGITALOCEAN_API_KEY</code></td><td>�</td><td>Serverless inference</td><td>API Key</td></tr>
494
- </table>
495
- <p><small>* <code>google-assist</code> uses OAuth tokens from <code>~/.gemini/oauth_creds.json</code> (Gemini CLI), not an API key.</small></p>
496
-
497
- <h3 id="providers-flow">Provider Selection Flow</h3>
498
- <div class="prompt-box">ProviderManager resolves the active provider by:
499
- 1. Session override (/provider-select session)
500
- 2. AI_PROVIDER environment variable
501
- 3. provider.json config file
502
- 4. CLEW_CODE_USE_BEDROCK / VERTEX / FOUNDRY env vars
503
- 5. Default provider (openai)
504
-
505
- API Key resolution chain:
506
- 1. Session API keys (set via /provider key)
507
- 2. ChatGPT subscriber token / Google OAuth token
508
- 3. provider.json apiKeys
509
- 4. Environment variable (e.g. ANTHROPIC_API_KEY)
510
- 5. Local config files (~/.gemini/oauth_creds.json, ~/.codex/auth.json)</div>
511
-
512
- <hr class="section-divider">
513
-
514
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
515
- <!-- SECTION 4: SYSTEM FEATURES -->
516
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
517
-
518
- <h2 id="features">4. System Features</h2>
519
-
520
- <div class="feature-grid">
521
-
522
- <div class="feature-card">
523
- <h3>�� Multi-Provider Routing</h3>
524
- <p>Switch between 29 AI providers at runtime. Each provider has its own model set, capabilities, and adapter. The adapter layer normalizes content blocks, tool calls, streaming, errors, and usage across all providers.</p>
525
- <code>/model</code> <code>/provider-select</code>
526
- </div>
527
-
528
- <div class="feature-card">
529
- <h3>�� Peer-to-Peer Swarm</h3>
530
- <p>LAN-based multi-agent coordination. Discover peers via UDP multicast, share as worker, assign tasks, send messages, spawn sub-agents. Full P2P toolset with role management and broadcast.</p>
531
- <code>/swarm</code> <code>peer_*</code> tools
532
- </div>
533
-
534
- <div class="feature-card">
535
- <h3>�� MCP Server Support</h3>
536
- <p>Full Model Context Protocol implementation � stdio and SSE-based JSON-RPC clients. Dynamic MCP server management, OAuth for MCP auth, resource listing/reading, and tool delegation.</p>
537
- <code>/mcp</code> <code>.mcp.json</code>
538
- </div>
539
-
540
- <div class="feature-card">
541
- <h3>�� Plugin System</h3>
542
- <p>Hot-reloadable plugin architecture with hook execution (PreToolUse, PostToolUse, MessageDisplay, SessionStart). Plugin Marketplace for discovery and installation. Per-plugin token cost tracking.</p>
543
- <code>/plugin</code> <code>/reload-plugins</code>
544
- </div>
545
-
546
- <div class="feature-card">
547
- <h3>�� Skills Framework</h3>
548
- <p>User-defined and built-in skills (e.g., /commit, /review, /verify, /precommit). Skills can be invoked by name from prompts. Compatible with Clew Code skill format.</p>
549
- <code>/skill</code> <code>/skills</code>
550
- </div>
551
-
552
- <div class="feature-card">
553
- <h3>�� Voice Mode</h3>
554
- <p>Microphone recording via node-record-lpcm16 + OpenAI Whisper API for speech-to-text. Supports F2 key for push-to-talk. Audio captured as 16kHz mono WAV.</p>
555
- <code>/voice</code> <span class="badge badge-warn">VOICE_MODE=1</span>
556
- </div>
557
-
558
- <div class="feature-card">
559
- <h3>�� Agent System</h3>
560
- <p>Multi-agent execution with state checkpoints, approval workflows, background agents, and interactive dashboard. Supports daemon (24/7 autonomous), scheduled tasks, and recurring loops.</p>
561
- <code>/agent</code> <code>/agents</code> <code>/daemon</code>
562
- </div>
563
-
564
- <div class="feature-card">
565
- <h3>�� Bridge Remote Control</h3>
566
- <p>WebSocket-based remote control for headless/remote sessions. Bridge mode connects local terminal to remote Clew instance for mobile or web access.</p>
567
- <code>/bridge</code> <span class="badge badge-warn">BRIDGE_MODE=1</span>
568
- </div>
569
-
570
- <div class="feature-card">
571
- <h3>�� Plan Mode</h3>
572
- <p>Structured planning for complex tasks. Codebase exploration, architecture design, multi-file change planning, and user approval before implementation. Supports plan mode exit with permission prompts.</p>
573
- <code>/plan</code>
574
- </div>
575
-
576
- <div class="feature-card">
577
- <h3>�� Evaluation Harness</h3>
578
- <p>AI agent performance evaluation with verification checks. Run benchmarks, validate outputs, score accuracy across tasks, and track regressions.</p>
579
- <code>/eval</code>
580
- </div>
581
-
582
- <div class="feature-card">
583
- <h3>��️ Safety &amp; Permissions</h3>
584
- <p>Granular tool permission system with allow/deny rules, sandbox mode, path validation, command safety gates, and approval policies. Supports classifier-based permission rules.</p>
585
- <code>/permissions</code> <code>/sandbox-toggle</code>
586
- </div>
587
-
588
- <div class="feature-card">
589
- <h3>�� Long-Term Memory</h3>
590
- <p>Cross-session persistent memory: <strong>knowledge graph</strong> (entities+relationships), <strong>XP system</strong> (levels, expertise, streaks), <strong>auto-inject</strong> at session start, <strong>human-like consolidation</strong> (recent=detail, old=weekly/monthly digests). Powered by bun:sqlite + recursive CTE.</p>
591
- <code>/memory save</code> <code>/memory graph</code> <code>/memory xp</code> <code>/memory timeline</code>
592
- </div>
593
-
594
- <div class="feature-card">
595
- <h3>�� Research &amp; Search</h3>
596
- <p>Deep source-grounded research across local files, wiki, memory, and web. Multi-round search with synthesis. Full-text session search, semantic memory search, web search (Tavily, Brave, SearXNG).</p>
597
- <code>/research</code>
598
- </div>
599
-
600
- <div class="feature-card">
601
- <h3>�� Telemetry &amp; Analytics</h3>
602
- <p>Datadog integration for telemetry and analytics. Configurable per-session, per-provider. Usage tracking, cost estimation, and rate-limit management.</p>
603
- <code>/datadog</code> <code>/stats</code>
604
- </div>
605
-
606
- <div class="feature-card">
607
- <h3>�� OAuth Login Providers</h3>
608
- <p>Multi-provider OAuth support � Anthropic (Console + Claude.ai), Google (Gemini CLI / Code Assist), OpenAI (ChatGPT Plus/Pro). Automatic token refresh and secure local storage.</p>
609
- <code>/login</code>
610
- </div>
611
-
612
- <div class="feature-card">
613
- <h3>��️ Remote Control Web UI</h3>
614
- <p>Web-based remote control bridge for managing Clew sessions from a browser. Supports QR code sharing, session URL, and mobile connectivity.</p>
615
- <code>/session</code> <code>/remote-env</code>
616
- </div>
617
-
618
- <div class="feature-card">
619
- <h3>�� Code Review &amp; Git</h3>
620
- <p>Integrated code review (correctness, security, simplify), GitHub PR management (create, review, merge, comment), commit workflow, diff visualization. Supports CI error auto-fix.</p>
621
- <code>/review</code> <code>/pr</code> <code>/commit</code>
622
- </div>
623
-
624
- <div class="feature-card">
625
- <h3>�� Onboarding &amp; Learning</h3>
626
- <p>Interactive onboarding wizard, powerup lessons with animated demos, taste preference learning system, buddy companion configuration, and team onboarding guides.</p>
627
- <code>/onboarding</code> <code>/powerup</code>
628
- </div>
629
-
630
- </div>
631
-
632
- <hr class="section-divider">
633
-
634
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
635
- <!-- SECTION 5: SYSTEM PROMPTS -->
636
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
637
-
638
- <h2 id="prompts">5. System Prompts</h2>
639
- <p>The AI model receives these system prompts at session start. They define the tool interface, behavior rules, and environment context.</p>
640
-
641
- <h3>Core System Prompt Structure</h3>
642
- <div class="prompt-box">You are Clew Code, a CLI coding agent.
643
-
644
- You are an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
645
-
646
- # System
647
- - All text you output outside of tool use is displayed to the user...
648
- - Tools are executed in a user-selected permission mode...
649
- - The system will automatically compress prior messages...
650
-
651
- # Doing tasks
652
- - You are highly capable and often allow users to complete ambitious tasks...
653
- - In general, do not propose changes to code you haven't read...
654
- - Do not create files unless they're absolutely necessary...
655
- - Avoid giving time estimates or predictions...
656
-
657
- # Tone and style
658
- - Only use emojis if the user explicitly requests it.
659
- - Keep text output brief and direct.
660
- - When referencing code, include file_path:line_number format.</div>
661
-
662
- <h3>Peer Workflow Prompt Template</h3>
663
- <div class="prompt-box">PEER PROMPT TEMPLATE (use this structure when writing prompts):
664
-
665
- 1. **PEER CONTEXT** � "Sender: Clew Code", "stdout = result"
666
- 2. **TASK** � scoped, specific, one task only
667
- 3. **COMMANDS & TOOLS** � what tools to use, --help to discover
668
- 4. **WORKFLOW** � explicit numbered flow: plan → gather → execute → output
669
- 5. **OUTPUT FORMAT** � JSON, diff, summary, or plain text
670
- 6. **WORKING DIRECTORY** � absolute path for file operations
671
- 7. **ERROR HANDLING** � try --help, adapt, never give up without attempting
672
-
673
- Do not send secrets, credentials, API keys, or private env data.</div>
674
-
675
- <h3>Extension System Prompts</h3>
676
-
677
- <details><summary><code>ListMcpResourcesTool</code> Prompt</summary>
678
- <div class="prompt-box">Lists available resources from configured MCP servers.
679
- Each resource object includes a 'server' field indicating which server it's from.
680
-
681
- Parameters:
682
- - server (optional): The name of a specific MCP server to get resources from. If not provided, resources from all servers will be returned.</div>
683
- </details>
684
-
685
- <details><summary><code>ReadMcpResourceTool</code> Prompt</summary>
686
- <div class="prompt-box">Reads a specific resource from an MCP server, identified by server name and resource URI.
687
-
688
- Parameters:
689
- - server (required): The name of the MCP server from which to read the resource
690
- - uri (required): The URI of the resource to read</div>
691
- </details>
692
-
693
- <details><summary><code>peer_list_roles</code> Prompt</summary>
694
- <div class="prompt-box">Lists all discovered peer workers and their assigned metadata (display name, role).
695
- Use peer_set_name to assign custom names and peer_set_role to assign roles to workers.
696
- Use `wait: true` with `timeout` and `minPeers` to wait for peers to appear on the network, instead of polling in a loop.
697
-
698
- This helps keep track of which worker does what.</div>
699
- </details>
700
-
701
- <details><summary><code>peer_broadcast</code> Prompt</summary>
702
- <div class="prompt-box">This tool sends the same task to every connected peer simultaneously.
703
- It returns a summary of which peers received the task and which failed.
704
- The `task` parameter should be a clear description of what needs to be done.
705
- Use peer_list_roles first to confirm which peers will receive the broadcast.</div>
706
- </details>
707
-
708
- <details><summary><code>peer_info</code> Prompt</summary>
709
- <div class="prompt-box">Fetches detailed information about a peer worker from the local peer store, or directly from the peer via HTTP if not cached. Returns hostname, IP, port, current working directory, shell type, platform, and online status.
710
-
711
- Use `wait: true` with `timeout` to wait for a worker to appear, instead of polling.</div>
712
- </details>
713
-
714
- <hr class="section-divider">
715
-
716
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
717
- <!-- SECTION 6: ARCHITECTURE -->
718
- <!-- ═══════════════════════════════════════════════════════════════════════ -->
719
-
720
- <h2 id="arch">6. Architecture Overview</h2>
721
-
722
- <div class="feature-card" style="grid-column: 1/-1; padding: 1.5rem;">
723
- <h3>System Architecture</h3>
724
- <div class="prompt-box">CLI Entrypoint (index.ts / main.tsx)
725
-
726
- ├── Session (Ink REPL)
727
- │ ├── Command Router → 120+ slash commands
728
- │ ├── Tool Registry → 76+ built-in tools
729
- │ └── Skill Loader → user/built-in skills
730
-
731
- ├── Orchestrator
732
- │ ├── Agent Loop → tool_use / tool_result cycle
733
- │ ├── Session App → Ink UI, modals, streaming
734
- │ └── Swarm Engine → multi-agent coordination
735
-
736
- ├── Provider Layer
737
- │ ├── ProviderManager → key resolution, config
738
- │ ├── ProviderRegistry → 29 providers
739
- │ ├── Adapter Layer → AnthropicAdapter / GoogleAdapter
740
- │ └── Tool Call Parser → cross-provider normalization
741
-
742
- ├── Tool System
743
- │ ├── StreamingToolExecutor
744
- │ ├── Permission Gate
745
- │ └── Hook System (Pre/Post Tool Use)
746
-
747
- ├── Extension System
748
- │ ├── MCP Client → stdio + SSE servers
749
- │ ├── Plugin Loader → hot-reload, marketplace
750
- │ └── Skills Engine → name-based invocation
751
-
752
- └── Context & Memory
753
- ├── Session Logger → .session/ JSON logs
754
- ├── Memory Store → persistent auto-memory
755
- └── Compactor → context summarization</div>
756
- </div>
757
-
758
- <div class="feature-grid">
759
- <div class="feature-card">
760
- <h3>Tool Execution Flow</h3>
761
- <div class="prompt-box" style="font-size: 0.7rem;">Model emits tool_use
762
- → Tool call normalization
763
- → Permission check
764
- → PreToolUse hooks
765
- → Tool execution
766
- → PostToolUse hooks
767
- → Result as tool_result
768
- → Query loop continues</div>
769
- </div>
770
-
771
- <div class="feature-card">
772
- <h3>Provider Resolution</h3>
773
- <div class="prompt-box" style="font-size: 0.7rem;">1. Session override
774
- 2. AI_PROVIDER env
775
- 3. provider.json config
776
- 4. Legacy env flags
777
- 5. Default (openai)
778
-
779
- Key: env → config → local file</div>
780
- </div>
781
-
782
- <div class="feature-card">
783
- <h3>Adapter Layer</h3>
784
- <div class="prompt-box" style="font-size: 0.7rem;">Content blocks normalization
785
- Tool call parsing (per-provider)
786
- Streaming chunk normalization
787
- Error normalization (retry/rate-limit)
788
- Usage/cost estimation
789
- All → Anthropic-compatible format</div>
790
- </div>
791
- </div>
792
-
793
- <hr class="section-divider">
794
-
795
- <div class="callout callout-tip">
796
- <strong>Pro Tip</strong>
797
- This reference is auto-generated from source code. For the most up-to-date list of commands, type <code>/</code> in the REPL. For tool prompts, the AI model receives these as system messages at session start.
798
- </div>
799
-
800
- </main></div></div>
801
-
802
- <script src="js/sidebar.js"></script>
803
- <script src="js/header.js"></script>
804
- <script src="./js\main.js"></script>
805
- </body>
806
- </html>