[FEATURE] Add 'Run in Terminal' button for code blocks in VSCode chat panel
Problem
When Claude Code outputs a command in a code block (e.g. a shell command for the user to run manually), there is no way to execute it directly from the chat panel. The user must manually copy the command and paste it into a terminal.
This is especially relevant when certain commands are intentionally excluded from auto-execution (e.g. via hooks or permission settings) but the user still wants a quick way to run them after reviewing.
Proposed solution
Add a "Run in Terminal" button (or icon) next to code blocks that contain shell commands in the chat output. Clicking it would either:
- Paste and execute the command in the integrated VSCode terminal, or
- Paste without executing (let the user press Enter to confirm)
Option 2 is safer and more practical — the user sees the command in the terminal and confirms with Enter.
Mockup
┌─────────────────────────────────────────────┐
│ ```bash [▶ Run] │
│ cd c:/project && npm test │
│ ``` │
└─────────────────────────────────────────────┘
Context
When using Bash(*) permissions with PreToolUse hooks that block certain commands (like destructive git operations), blocked commands are shown as text. Currently the only option is to copy-paste them into a terminal. A "Run" button would streamline this workflow significantly.
Environment
- Claude Code VSCode extension
- Windows 11 + bash
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗