Skip to content

Introduce experimental session modes#67

Merged
agu-z merged 5 commits intomainfrom
session-modes
Sep 9, 2025
Merged

Introduce experimental session modes#67
agu-z merged 5 commits intomainfrom
session-modes

Conversation

@agu-z
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
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 and others added 4 commits September 8, 2025 11:42
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
@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 agentclientprotocol/claude-agent-acp that referenced this pull request Sep 9, 2025
Exposes all Claude Code permission modes as [ACP Session
modes](agentclientprotocol/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 <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Bennet <bennet@zed.dev>
agu-z added a commit to zed-industries/zed that referenced this pull request Sep 9, 2025
Adds support for [ACP session
modes](agentclientprotocol/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 <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
tidely pushed a commit to tidely/zed that referenced this pull request Sep 10, 2025
Adds support for [ACP session
modes](agentclientprotocol/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 <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
nerzhulart pushed a commit to nerzhulart/agent-client-protocol that referenced this pull request Oct 21, 2025
* Introduce experimental session modes

* Add `SessionUpdate::CurrentModeUpdate`

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>

* Add switch mode kind

* SessionModeId display impl

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
AObuchow pushed a commit to AObuchow/claude-code-acp that referenced this pull request Jan 12, 2026
)

Exposes all Claude Code permission modes as [ACP Session
modes](agentclientprotocol/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 agentclientprotocol#31

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Bennet <bennet@zed.dev>
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