You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -524,6 +524,8 @@ cd frontend && npm run dev # Configures proxy to localhost:9000
524
524
525
525
21.**Enter Key Behavior**: Configurable Enter key behavior with persistent user preferences, supporting both traditional (Enter=Send) and modern (Enter=Newline) interaction patterns.
526
526
527
+
22.**Permission Mode Switching**: UI-driven plan mode functionality that allows users to toggle between normal execution and plan mode. When plan mode is selected, users can review and approve Claude's planned actions before execution through an intuitive interface.
@@ -590,6 +592,48 @@ The modular frontend architecture provides several key benefits:
590
592
-**Code Splitting**: Easier to implement lazy loading for large features
591
593
-**Memory Efficiency**: Reduced memory footprint with focused hooks
592
594
595
+
## Permission Mode Switching
596
+
597
+
This project implements a permission mode switching feature that allows users to toggle between normal execution and plan mode before sending messages to Claude.
598
+
599
+
### Features
600
+
601
+
-**Normal Mode**: Direct execution (default behavior)
602
+
-**Plan Mode**: Claude presents a plan for user review and approval before execution
603
+
-**UI Toggle**: Permission mode selector integrated into the chat input interface
604
+
-**Session Persistence**: Permission mode choice is maintained during the browser session
605
+
606
+
### Implementation Approach
607
+
608
+
The implementation uses a **UI-driven approach** with the `PlanPermissionInputPanel` component, providing:
609
+
610
+
-**Three-Option Interface**: "Accept with Edits", "Accept Default", or "Keep Planning"
611
+
-**Seamless Integration**: Built into the existing chat input component
612
+
-**Type Safety**: Full TypeScript support with comprehensive type definitions
613
+
-**State Management**: Uses the `usePermissionMode` hook for state tracking
614
+
615
+
### Technical Architecture
616
+
617
+
-**Frontend**: Permission mode state management via `usePermissionMode` hook
618
+
-**Backend**: `permissionMode` parameter passed to Claude Code SDK via the chat API
619
+
-**Types**: Shared type definitions in `shared/types.ts` with frontend extensions
620
+
-**UI Components**: `PlanPermissionInputPanel` for plan approval workflow
621
+
622
+
### Usage
623
+
624
+
1. Toggle permission mode using the cycle button in the chat input area
625
+
2. Send message in plan mode to activate plan review workflow
626
+
3. Review plan options in the permission input panel
627
+
4. Choose your preferred action: Accept with Edits, Accept Default, or Keep Planning
628
+
629
+
### Files Involved
630
+
631
+
-**Shared Types**: `shared/types.ts` - `ChatRequest.permissionMode` field
0 commit comments