-
Notifications
You must be signed in to change notification settings - Fork 3
feat(cli): allow user to opt into permissions bypass #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "stash": patch | ||
| --- | ||
|
|
||
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,11 @@ import { | |
| * prompt as a single argument. `stdio: 'inherit'` so the user sees tool | ||
| * calls and approves edits live; the call resolves with the exit code. | ||
| * | ||
| * Claude is launched with `--allow-dangerously-skip-permissions` so the | ||
| * user can opt in to skip-permissions mode for the integration handoff | ||
| * without having to relaunch — the flag permits the toggle, it doesn't | ||
| * force it on. | ||
| * | ||
| * Returns -1 if the binary isn't on PATH (the spawn `error` event fires | ||
| * before `close` does). Init never aborts on a non-zero code — the | ||
| * artifacts are already written, the user can re-run the agent. | ||
|
|
@@ -24,8 +29,12 @@ export function spawnAgent( | |
| binary: 'claude' | 'codex', | ||
| prompt: string, | ||
| ): Promise<number> { | ||
| const args = | ||
| binary === 'claude' | ||
| ? ['--allow-dangerously-skip-permissions', prompt] | ||
| : [prompt] | ||
|
Comment on lines
+32
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: It only adds bypassPermissions to the Shift+Tab permission-mode cycle; it does not immediately start “bypass permissions mode”. The docs describe Citations:
Use The current flag only adds bypassPermissions to the Shift+Tab permission-mode cycle without activating it immediately. Per Claude CLI documentation, 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it says in the PR description, this is the intended behaviour. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
|
||
| return new Promise((resolvePromise) => { | ||
| const child = spawn(binary, [prompt], { stdio: 'inherit', shell: false }) | ||
| const child = spawn(binary, args, { stdio: 'inherit', shell: false }) | ||
| child.on('close', (code) => resolvePromise(code ?? 0)) | ||
| child.on('error', () => resolvePromise(-1)) | ||
| }) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.