[FEATURE] Task-scoped permission approval for multi-step operations
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Missing middle-ground permission scope between "just this once" and "for this session"
Current situation:
Permission prompts offer three options:
- "Just this once" - Approve each individual command use
- "For this session" - Approve until conversation/session ends
- "Permanent" - Approve forever across all projects
Problem:
When executing multi-step operations (e.g., "test all 4 models on 2 videos" = 8 commands), users face a poor choice:
- Choose "just this once" → Click approve 8 times (terrible UX)
- Choose "for this session" → Grant blanket approval for hours of unrelated work (security risk)
Example scenario showing the issue:
10:00 AM - User: "Test all models on these videos"
Approve "for this session" → runs 8 commands ✓
10:15 AM - User: "Now refactor the authentication system"
Runs automatically (still in session) ✗
User didn't intend to auto-approve unrelated file modifications
Session-scoped approval can span hours of conversation and dozens of unrelated requests. This is too permissive for users who want tight control over what executes automatically.
Proposed Solution
Add a fourth permission scope: "Approve for this task"
Behavior:
- Approves all commands needed for the current multi-step request only
- Expires when the current task/response thread completes
- Does NOT apply to subsequent unrelated requests in the same conversation
UI mockup:
┌─────────────────────────┐
│ Claude needs to run 8 commands to complete this │
│ request. How would you like to proceed? │
│ │
│ [Approve for this task] ← NEW OPTION │
│ [Just this once] │
│ [For this session] │
│ [Permanent] │
│ [Cancel] │
└─────────────────────────┘
Implementation suggestion:
- Scope could be tied to the current "request ID" or "turn"
- When user makes a new request, previous task-scoped approvals expire
- System tracks: "approved for request #47" vs "approved for session"
Alternative Solutions
- Use "for this session" but in separate windows - Loses conversation context, poor UX
- Wrap commands in background scripts - Reduces visibility, harder to debug
- Manual confirmation per step - Same as "just this once", too many clicks
- Very long single commands - Brittle, hard to maintain, opaque to user
None of these alternatives provide the right balance of security + convenience + visibility.
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
Use Case 1: Model Testing (Original Request)
User: "Test Llama 8B Q6, Llama 8B Q5, Qwen 14B Q4, and Qwen 32B Q4
on keyboard and XREAL (teardown) videos. Compare results."
Expected behavior with "Approve for this task":
→ User approves once
→ 8 commands run automatically (4 models × 2 videos)
→ Generates comparison report
→ Task complete, approval expires
Later in same conversation:
User: "Update the documentation with findings"
→ Asks for approval again (new task)
Use Case 2: Data Processing Pipeline
User: "Process all CSV files in /data: validate, clean, transform,
and export to JSON"
Expected behavior:
→ Approve for this task
→ Pipeline runs on 50+ files automatically
→ Task completes, approval expires
Later:
User: "Delete the temporary files"
→ Asks for approval (deletion is different task, requires new consent)
Use Case 3: Codebase Refactoring
User: "Rename function 'getUserData' to 'fetchUserProfile' across
entire codebase and update tests"
Expected behavior:
→ Approve for this task
→ Edits 15 files automatically
→ Task completes, approval expires
Later:
User: "Run the test suite"
→ Asks for approval (different operation)
---
Benefits
- Better security - Approval scope tightly bounded to user's specific request
- Better UX - One approval for multi-step work, no permission fatigue
- Better intent alignment - Permission matches what user actually asked for
- Maintains visibility - User can still see each command as it runs
- Fail-safe - If task takes unexpected turn, approval expires automatically
Additional Context
This complements the existing "for this session" option rather than replacing it. Some users want session-level approval for exploratory work, while others want task-level approval for specific operations.
Related issue: #[number if applicable] (session-based permissions)
Distinction: That issue requests session-scoped approval (which exists). This requests task-scoped approval (finer-grained, doesn't exist yet).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗