Add --bare flag to algorithm.ts subprocess spawns#988
Open
catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
Open
Add --bare flag to algorithm.ts subprocess spawns#988catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
catchingknives wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Algorithm loop mode spawns `claude -p` subprocesses for both parallel workers and sequential iterations. Without `--bare`, each subprocess loads all hooks, LSP, plugins, and walks skill directories — overhead that compounds with parallel agents and causes unintended side-effects (voice notifications, session state writes, rating capture) in headless automation context. `--bare` (added in Claude Code v2.1.81) skips hooks, LSP init, plugin sync, and skill directory walks for scripted `-p` calls. Interactive mode (line 1227) is intentionally left unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--bareflag to bothclaude -psubprocess calls inalgorithm.ts(parallel workers at line 669, sequential iteration at line 1114)Problem
Algorithm loop mode spawns
claude -psubprocesses that load the full Claude Code environment — all hooks, LSP, plugin sync, and skill directory walks. This causes:Fix
--barewas added in Claude Code v2.1.81 specifically for scripted-pcalls. It skips hooks, LSP initialization, plugin synchronization, and skill directory walks — giving clean headless execution.Impact
Every PAI user running Algorithm loop mode benefits. The fix is 2 lines with zero behavioral change to the actual agent work — only the subprocess boot path is streamlined.
🤖 Generated with Claude Code