Notify when we enter plan mode (#277)

Closes #274
This commit is contained in:
Ben Brandt
2026-02-02 15:37:02 +01:00
committed by GitHub
parent c597cfae85
commit c5a49e7481
2 changed files with 38 additions and 10 deletions

View File

@@ -732,7 +732,23 @@ export class ClaudeAcpAgent implements Agent {
PostToolUse: [
...(userProvidedOptions?.hooks?.PostToolUse || []),
{
hooks: [createPostToolUseHook(this.logger)],
hooks: [
createPostToolUseHook(this.logger, {
onEnterPlanMode: async () => {
const session = this.sessions[sessionId];
if (session) {
session.permissionMode = "plan";
}
await this.client.sessionUpdate({
sessionId,
update: {
sessionUpdate: "current_mode_update",
currentModeId: "plan",
},
});
},
}),
],
},
],
},