Skip to content

feat: add keyboard shortcut to toggle dangerous mode for running tasks#144

Merged
bborn merged 1 commit intomainfrom
task/302-is-there-a-way-to-switch-a-running-claud
Jan 13, 2026
Merged

feat: add keyboard shortcut to toggle dangerous mode for running tasks#144
bborn merged 1 commit intomainfrom
task/302-is-there-a-way-to-switch-a-running-claud

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 13, 2026

Summary

Adds a keyboard shortcut (!) in the task detail view to restart a running Claude instance with --dangerously-skip-permissions flag enabled.

This allows users to enable dangerous mode for a specific running task without restarting the daemon or affecting other tasks.

Changes Made

UI Changes

  • Added ToggleDangerous key binding mapped to ! key
  • Added help text showing ! dangerous mode when task is processing or blocked
  • Wire up keyboard handler to call new executor method

Executor Changes

  • Implemented ResumeDangerous() method that:
    • Kills the current Claude tmux window for the task
    • Restarts Claude with --resume <sessionID> --dangerously-skip-permissions
    • Preserves the Claude session state for continuity
    • Only works if task has a Claude session ID

App Model Changes

  • Added toggleDangerousMode() command to handle the keyboard shortcut
  • Added taskDangerousModeToggledMsg message type for UI updates

How It Works

  1. User presses ! while viewing a processing or blocked task
  2. The executor kills the current Claude tmux window
  3. A new Claude process starts with the same session ID but with --dangerously-skip-permissions flag
  4. Claude resumes from where it left off, but now without permission prompts
  5. Task execution log shows "Claude restarted in dangerous mode"

Testing

  • Code compiles without errors
  • Keyboard shortcut only shows for processing/blocked tasks
  • Method preserves Claude session for continuity

Related

Closes #302

Notes

  • This only affects the specific task, not the global daemon mode
  • The dangerous flag is forced regardless of WORKTREE_DANGEROUS_MODE setting
  • The feature requires an active Claude session (task must have been started at least once)

Add "!" keyboard shortcut in task detail view to restart a running Claude
instance with --dangerously-skip-permissions flag enabled.

Changes:
- Add ToggleDangerous key binding mapped to "!" key
- Implement ResumeDangerous() method in executor that kills and restarts
  Claude with --dangerously-skip-permissions flag
- Wire up keyboard handler in detail view to call ResumeDangerous()
- Show "! dangerous mode" help text when task is processing or blocked
- Add taskDangerousModeToggledMsg message type for UI updates

This allows users to enable dangerous mode for a specific running task
without restarting the daemon or affecting other tasks.

Resolves #302

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@bborn bborn merged commit afddf1e into main Jan 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant