Summary
The runVersion function in claude.ts and opencode.ts uses shell: true unconditionally when spawning the version check command. This is unnecessary on Linux/macOS when the command is already a resolved absolute path.
Current behavior
// claude.ts and opencode.ts
const proc = spawn(command, ['--version'], {
stdio: ['ignore', 'pipe', 'pipe'],
shell: true, // Always uses shell
});
Expected behavior
Match the pattern used by the newer agent plugins (codex, gemini, kiro):
// Only use shell on Windows where direct spawn may not work
const useShell = process.platform === 'win32';
const proc = spawn(command, ['--version'], {
stdio: ['ignore', 'pipe', 'pipe'],
shell: useShell,
});
Why this matters
- Avoids unnecessary shell invocation on Linux/macOS
- Reduces potential for shell interpretation issues
- Aligns with the established pattern in newer agent plugins
- Slightly more efficient (no shell process overhead)
Files to update
src/plugins/agents/builtin/claude.ts
src/plugins/agents/builtin/opencode.ts
Note
The droid plugin (src/plugins/agents/droid/index.ts) was checked and already uses conditional shell (isWindows check at line 174).
Related
The newer agents (codex.ts, gemini.ts, kiro.ts) already implement the correct conditional pattern.
Summary
The
runVersionfunction inclaude.tsandopencode.tsusesshell: trueunconditionally when spawning the version check command. This is unnecessary on Linux/macOS when the command is already a resolved absolute path.Current behavior
Expected behavior
Match the pattern used by the newer agent plugins (codex, gemini, kiro):
Why this matters
Files to update
src/plugins/agents/builtin/claude.tssrc/plugins/agents/builtin/opencode.tsNote
The droid plugin (
src/plugins/agents/droid/index.ts) was checked and already uses conditional shell (isWindowscheck at line 174).Related
The newer agents (codex.ts, gemini.ts, kiro.ts) already implement the correct conditional pattern.