Skip to content

Commit 2c0583d

Browse files
authored
Merge pull request #433 from cipherstash/feat/allow-claude-yolo
feat(cli): allow user to opt into permissions bypass
2 parents 1175e86 + 4c9ebca commit 2c0583d

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.changeset/allow-claude-yolo.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stash": patch
3+
---
4+
5+
feat(cli): pass `--allow-dangerously-skip-permissions` when `stash init` launches Claude Code, so the user can opt in to skip-permissions mode mid-session without relaunching. Codex and Wizard handoffs are unchanged.

packages/cli/src/commands/impl/steps/handoff-claude.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const handoffClaudeStep: HandoffStep = {
4747
`Install: ${CLAUDE_INSTALL_URL}`,
4848
'',
4949
'Once installed, run:',
50-
` claude '${launchPrompt}'`,
50+
` claude --allow-dangerously-skip-permissions '${launchPrompt}'`,
5151
].join('\n'),
5252
'Files written — install Claude Code to run the handoff',
5353
)
@@ -58,7 +58,7 @@ export const handoffClaudeStep: HandoffStep = {
5858
const exitCode = await spawnAgent('claude', launchPrompt)
5959
if (exitCode !== 0) {
6060
p.log.warn(
61-
`Claude Code exited with code ${exitCode}. Re-run \`claude '${launchPrompt}'\` to resume.`,
61+
`Claude Code exited with code ${exitCode}. Re-run \`claude --allow-dangerously-skip-permissions '${launchPrompt}'\` to resume.`,
6262
)
6363
}
6464

packages/cli/src/commands/init/lib/handoff-helpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import {
1616
* prompt as a single argument. `stdio: 'inherit'` so the user sees tool
1717
* calls and approves edits live; the call resolves with the exit code.
1818
*
19+
* Claude is launched with `--allow-dangerously-skip-permissions` so the
20+
* user can opt in to skip-permissions mode for the integration handoff
21+
* without having to relaunch — the flag permits the toggle, it doesn't
22+
* force it on.
23+
*
1924
* Returns -1 if the binary isn't on PATH (the spawn `error` event fires
2025
* before `close` does). Init never aborts on a non-zero code — the
2126
* artifacts are already written, the user can re-run the agent.
@@ -24,8 +29,12 @@ export function spawnAgent(
2429
binary: 'claude' | 'codex',
2530
prompt: string,
2631
): Promise<number> {
32+
const args =
33+
binary === 'claude'
34+
? ['--allow-dangerously-skip-permissions', prompt]
35+
: [prompt]
2736
return new Promise((resolvePromise) => {
28-
const child = spawn(binary, [prompt], { stdio: 'inherit', shell: false })
37+
const child = spawn(binary, args, { stdio: 'inherit', shell: false })
2938
child.on('close', (code) => resolvePromise(code ?? 0))
3039
child.on('error', () => resolvePromise(-1))
3140
})

0 commit comments

Comments
 (0)