Skip to content

Conversation

jefflouisma
Copy link

Closes #39392

Summary

Fixes an issue where the "Bypass Permissions" setting (and other permission modes) in Claude Code agent would automatically revert when creating new threads or sessions.

Problem

When users selected a permission mode like "Bypass Permissions" from the dropdown:

  • The mode would change for the current session only
  • Creating a new thread or continuing work would revert to the previous default mode
  • Users had to manually re-select their preferred mode repeatedly

Solution

Modified the mode selector behavior in crates/agent_ui/src/acp/mode_selector.rs:

  • Mode selection now automatically persists as the default (saves to settings)
  • This ensures the selected mode is used for all new threads/sessions
  • Holding the secondary modifier key (Ctrl/Cmd) allows toggling/unsetting the default

Changes

  • When clicking a mode: Sets it for the current session and saves as default
  • When Ctrl/Cmd + clicking a mode: Toggles whether it's the default (allows unsetting)
  • Updated tooltip text to reflect this behavior

Testing

  • ✅ Passed ./script/clippy -p agent_ui
  • Verified mode persists across new threads

Release Notes:

  • Fixed: Claude Code permission mode (like "Bypass Permissions") now persists across sessions as expected

Fixes zed-industries#39392

When a user selects a permission mode (e.g., 'Bypass Permissions') in the
Claude Code agent, the mode now automatically persists as the default.
Previously, the mode would only change for the current session and revert
to the previous default when creating a new thread or session.

Changes:
- Mode selection now always saves as default (unless modifier key is held)
- Holding the secondary modifier key (Ctrl/Cmd) allows toggling/unsetting
  the default mode
- Updated tooltip text to reflect the new behavior

This ensures that user's permission mode preferences persist across sessions
as expected.
Copy link

cla-bot bot commented Oct 8, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @jefflouisma on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@jefflouisma
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 8, 2025
Copy link

cla-bot bot commented Oct 8, 2025

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title Fix: Persist agent permission mode selection across sessions Persist agent permission mode selection across sessions Oct 8, 2025
@SomeoneToIgnore SomeoneToIgnore added the ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: Claude Code "Bypass Permissions" setting reverts automatically

2 participants