wiki-worker spawns a headless `claude -p` per capture event: flashing console windows on Windows, ~5x process churn, continuous background API calls
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 40/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- cli, performance, tooling
Research direction
The issue is in bundle/capture.js and bundle/wiki-worker.js. Start by examining the spawn logic in wiki-worker.js that launches the headless Claude process. Look for Node.js child_process.spawn calls and consider adding windowsHide: true to suppress the console window on Windows. Also investigate batching or debouncing capture events to reduce process churn. Test by running the plugin and observing process creation with tool activity.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 107
- Avg merge
- 21h 4m
- Merged PRs (30d)
- 13
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from activeloopai/hivemind
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
activeloopai/hivemind#411 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
activeloopai/hivemind#330 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
activeloopai/hivemind#200 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
activeloopai/hivemind#184 ·
Maintainers usually reply within 1 day
-
embeddings: alternation patterns (a|b|c) skip the embedding daemon and fall back to lexical-onlyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
activeloopai/hivemind#86 ·
Maintainers usually reply within 1 day
All issues in activeloopai/hivemind
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
supabase/agent-skills#611 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
polka-codes/test#345 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
GoogleChromeLabs/project-sesame#217 ·
Maintainers usually reply within 12 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
solana-foundation/solana-com#2202 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100