Skip to content

Conversation

agu-z
Copy link
Contributor

@agu-z agu-z commented Sep 5, 2025

Enables the agent to expose a set of modes that the session can be put in at any given point. The main motivation for this is enabling a permission mode selector for Claude Code, allowing you to toggle between "default" and "plan" mode.

Note: This feature is experimental, and may be removed or changed at any point

@cla-bot cla-bot bot added the cla-signed label Sep 5, 2025
@agu-z agu-z changed the title [wip] Introduce experimental session modes Introduce experimental session modes Sep 5, 2025
@ConradIrwin
Copy link
Member

@agu-z Instead of making this stateful, I think it'd be cleaner to just add a mode: Option<mode> to session/prompt. (Assuming that you can't meaningfully changes this while the model is generating output).

@agu-z
Copy link
Contributor Author

agu-z commented Sep 6, 2025

@ConradIrwin yeah, that's a good idea!

That said, since making this PR I realized that a core feature of plan mode in CC is that it can ask the user to switch modes in the middle of a turn when it thinks it's ready for implementation. So it's not quite stateless.

I'm gonna try a few approaches for this mode switch on Monday. I think the simplest would be to request the switch via a tool call, but we'd also need a notification from the agent to let the client know that the mode changed. Another option is to add an explicit method to request a mode switch, in which case the notification wouldn't be needed.

@agu-z agu-z merged commit 6225be9 into main Sep 9, 2025
4 checks passed
@agu-z agu-z deleted the session-modes branch September 9, 2025 13:50
agu-z added a commit to zed-industries/claude-code-acp that referenced this pull request Sep 9, 2025
Exposes all Claude Code permission modes as [ACP Session
modes](zed-industries/agent-client-protocol#67).
This allows ACP clients to build mode selectors and to be notified when
the mode changes as a result of `ExitPlanMode`.

See a demo in the [Zed
PR](zed-industries/zed#37632).

Closes #31

---------

Co-authored-by: Bennet Bo Fenner <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
Co-authored-by: Bennet <[email protected]>
agu-z added a commit to zed-industries/zed that referenced this pull request Sep 9, 2025
Adds support for [ACP session
modes](zed-industries/agent-client-protocol#67)
enabling plan and other permission modes in CC:


https://github.com/user-attachments/assets/dea18d82-4da6-465e-983b-02b77c6dcf15


Release Notes:

- Claude Code: Add support for plan mode, and all other permission modes

---------

Co-authored-by: Bennet Bo Fenner <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
Co-authored-by: Danilo Leal <[email protected]>
tidely pushed a commit to tidely/zed that referenced this pull request Sep 10, 2025
Adds support for [ACP session
modes](zed-industries/agent-client-protocol#67)
enabling plan and other permission modes in CC:


https://github.com/user-attachments/assets/dea18d82-4da6-465e-983b-02b77c6dcf15


Release Notes:

- Claude Code: Add support for plan mode, and all other permission modes

---------

Co-authored-by: Bennet Bo Fenner <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
Co-authored-by: Danilo Leal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants