Pull live shell output into slash commands with !
Prefix a shell command with ! inside a `.claude/commands/*.md` file and Claude runs it first, then injects the output as context.
- Type: Prompt
- Tags: Coding Agent Hacks, Intermediate, Claude Code
- Updated: 2026-10-01
Prompt
Prefix a shell command with ! inside a `.claude/commands/*.md` file and Claude runs it first, then injects the output as context. Most people think slash commands are static. They're not — the `!` prefix makes them dynamic. T3 Chat's Theo Browne shared a `pr-summary` command that pulls the live diff, comment thread, and changed files automatically. Works with any shell command: test results, logs, schema dumps. Implementation example: # .claude/commands/pr-summary.md --- name: pr-summary description: Summarize changes in a pull request context: fork agent: Explore allowed-tools: Bash(gh *) --- ## Pull request context - PR diff: !`gh pr diff` - PR comments: !`gh pr view --comments` - Changed files: !`gh pr diff --name-only` ## Your task Summarize this pull request...
More prompts
- Expense Report Automation System — Save More Time
- Meeting Scheduling Link Standardization — Save More Time
- Invoice Generation and Delivery Automation — Save More Time
- Document Template Automation Library — Save More Time
- Calendar Management Automation Rules — Save More Time
- File Organization and Naming System — Save More Time
- Recurring Payment Automation Setup — Save More Time
- Data Entry Elimination Framework — Save More Time