wiki-worker spawns a headless `claude -p` per capture event: flashing console windows on Windows, ~5x process churn, continuous background API calls
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 40/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
- 領域
- cli, performance, tooling
調査の方向性
この issue は bundle/capture.js と bundle/wiki-worker.js にあります。まず、headless Claude プロセスを起動する wiki-worker.js の spawn ロジックを調べてください。Node.js の child_process.spawn 呼び出しを探し、Windows でコンソールウィンドウを非表示にするために windowsHide: true の追加を検討してください。また、プロセスの頻繁な生成を減らすため、capture イベントのバッチ処理またはデバウンスも調査してください。プラグインを実行し、tool activity に伴うプロセス生成を観察してテストしてください。
索引モデルが issue の本文から書いたものです。
説明
Bug report: wiki-worker spawns a headless Claude Code process per capture event, flashing console windows on Windows
Component: @deeplake/hivemind Claude Code plugin
Affected versions: 0.7.131 and 0.7.142 (spawn logic identical in both)
Platform: Windows 11 Home 26200 (behavior is Windows-specific in its visible symptom; the underlying spawn cost is cross-platform)
Severity: Medium. Not data-losing, but continuously disruptive, and it consumes CPU and model API calls in the background.
Summary
While a Claude Code session is doing any tool work, bundle/capture.js launches bundle/wiki-worker.js, and that worker launches a complete headless Claude Code process (claude -p --model <model> --permission-mode bypassPermissions) on a repeating basis.
On Windows, each of those child processes allocates a console, which Windows hands to WindowsTerminal.exe. The result is a black terminal window that appears on screen and takes focus roughly every 5 to 6 seconds for as long as the user is working.
The visible window is Claude Code's own IDE-detection probe, not hivemind code. But hivemind is what causes it to run on a loop, so the two are only a problem in combination.
Root cause: observed process ancestry
Captured with a WMI __InstanceCreationEvent subscription (WITHIN 0.05), resolving each new process's ancestor chain at creation time. Polling-based sampling misses these; they live well under 250ms.
node.exe .../hivemind/0.7.131/bundle/wiki-worker.js <tempfile deeplake-wiki-<session-id>>
└─ cmd.exe /d /s /c "…\npm\claude.cmd -p --no-session-persistence
--model haiku --permission-mode bypassPermissions"
└─ claude.exe (headless Claude Code)
└─ cmd.exe /d /s /c "tasklist | findstr /I "Code.exe Cursor.exe Windsurf.exe
Devin.exe idea64.exe pycharm64.exe webstorm64.exe
phpstorm64.exe rubymine64.exe clion64.exe goland64.exe
rider64.exe datagrip64.exe appcode.exe dataspell64.exe
aqua64.exe gateway64.exe fleet.exe studio64.exe""
└─ tasklist.exe + findstr.exe
└─ svchost → WindowsTerminal.exe -Embedding ← the visible window
Every level of that chain repeats on each capture event. capture.js is registered on UserPromptSubmit, PostToolUse, Stop, and SubagentStop, so ordinary tool traffic drives it.
Measurements
Two 45-second windows, comparable Claude Code tool activity in each (roughly 10 tool calls), same machine, same session type. Only enabledPlugins."hivemind@hivemind" differed.
| Processes created per 45s | hivemind enabled | hivemind disabled |
|---|---|---|
WindowsTerminal.exe (visible window) |
6 to 7 | 0 |
tasklist.exe / findstr.exe |
6 to 7 each | 0 |
headless claude.exe spawned |
17 to 20 | 0 |
node.exe |
25 to 31 | 8 |
conhost.exe |
81 to 108 | 15 |
bash.exe |
55 to 70 | 25 |
| total process creations | ~250 | ~55 |
Disabling the plugin removes the visible windows entirely and cuts total process creation by roughly 5x.
Version comparison: 0.7.131 vs 0.7.142
Updating did not change the behavior. The relevant logic is identical:
| 0.7.131 | 0.7.142 | |
|---|---|---|
bundle/wiki-worker.js present |
yes | yes |
capture.js references to wiki-worker |
3 | 3 |
spawns headless claude -p |
yes | yes |
--no-session-persistence |
yes | yes |
--permission-mode bypassPermissions |
yes | yes |
Confirmed by direct user observation on 0.7.142 after a clean plugin update via claude plugin update hivemind@hivemind.
Secondary impact
Defender CPU. Windows Defender real-time protection scans each process image at creation. At roughly 5.5 process creations per second sustained, MsMpEng.exe (Antimalware Service Executable) was observed holding around 19.6% CPU for the duration of active work. This disappears when the plugin is disabled.
Model API consumption. Each spawn is a real claude -p invocation against the configured model. At the observed rate this runs continuously in the background, invisible to the user, and is not obviously disclosed.
Permission posture. The spawned processes run with --permission-mode bypassPermissions. Given the spawn rate, users may not realize how many unattended agent processes are running under bypassed permissions.
Reproduction
- Windows 11, Claude Code desktop, hivemind plugin enabled.
- Start a session and give it continuous tool work for about a minute.
- Observe a console window appearing and taking focus every 5 to 6 seconds.
- Set
"hivemind@hivemind": falsein~/.claude/settings.json. This takes effect immediately, no restart required, since hook config is re-read per event. - Repeat step 2. The windows stop.
To capture the ancestry rather than eyeball it, subscribe to WMI __InstanceCreationEvent WITHIN 0.05 for Win32_Process and resolve ParentProcessId at event time. Snapshot polling at 250ms intervals misses these entirely and produces a false negative.
Notes on what did not fix it
- Setting Default terminal application to Windows Console Host (Settings > System > Advanced > Terminal). Measured before and after: no change, 6 to 7
WindowsTerminal.exelaunches in both. The handoff still occurs. - Updating the plugin 0.7.131 to 0.7.142.
Suggested fixes, roughly in order of preference
- Do not spawn a full Claude Code process per capture event. Batch, debounce, or defer wiki generation to session end. This is the fix that addresses CPU, API consumption, and the window flashing at once.
- Reuse a single long-lived worker instead of a new process per event.
- Pass
CREATE_NO_WINDOW(or equivalentwindowsHide: trueon the Nodespawnoptions) down the whole chain, so any console the children allocate is never shown. This addresses the visible symptom even if the spawn rate stays as-is. - Expose a documented off switch for the wiki worker specifically. Env vars such as
HIVEMIND_WIKI_WORKERandHIVEMIND_GRAPH_ON_STOPappear in the bundle but their semantics are not documented, so today the only reliable remedy is disabling the entire plugin and losing memory capture along with it.
Point 3 may belong upstream with Claude Code as well, since the IDE-detection probe (tasklist | findstr) is Claude Code's own startup behavior and it allocates a visible console on Windows. It is only noticeable because hivemind runs it hundreds of times per hour.
Current workaround
"hivemind@hivemind": false in ~/.claude/settings.json. Effective immediately, no restart. Costs all cross-session memory capture and recall.
- 主要言語
- TypeScript
- スター
- 1.6k
- フォーク
- 113
- 平均マージ
- 20時間 28分
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
activeloopai/hivemind のほかの issue
-
Transcript parsing aborts on a non-record JSON line対応中かも @DivyamTalwar が 24 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
activeloopai/hivemind#411 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
activeloopai/hivemind#330 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
activeloopai/hivemind#200 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
activeloopai/hivemind#184 ·
メンテナーはふだん 1 日以内に返信
-
embeddings: alternation patterns (a|b|c) skip the embedding daemon and fall back to lexical-only対応中かも @eastagiletracker が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
activeloopai/hivemind#86 ·
メンテナーはふだん 1 日以内に返信
activeloopai/hivemind の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
umami-software/umami#4637 ·
メンテナーはふだん 3 日以内に返信
-
Hotkeys fire when pressed with the Ctrl key, so browser shortcuts also trigger player actions対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
muxinc/media-chrome#1332 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
polarsource/polar#15580 ·
メンテナーはふだん 1 日以内に返信
-
accepted bug via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
pingdotgg/t3code#20931 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug/1-unconfirmed kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信