Terminal Mastery
You have Claude Code running in one terminal tab, your dev server in another, test output in a third, and git log in a fourth. You are constantly switching tabs, losing track of which one has the output you need. Then Claude finishes a task and you miss the notification because you were reading logs in a different tab.
Power users solve this with terminal multiplexers. One screen, multiple panes, Claude Code always visible.
What You Will Walk Away With
Section titled “What You Will Walk Away With”- A tmux configuration optimized for Claude Code workflows
- Multi-pane layouts for development, debugging, and review
- Shell integration patterns that pipe data into Claude Code
- Notification strategies so you never miss when Claude finishes
The Power User Terminal Layout
Section titled “The Power User Terminal Layout”tmux for Claude Code
Section titled “tmux for Claude Code”The ideal layout has three or four panes:
+----------------------------+------------------+| | || Claude Code | Dev Server || (main pane) | (top-right) || | |+----------------------------+------------------+| | || Editor / Files | Test Output || (bottom-left) | (bottom-right) || | |+----------------------------+------------------+Pane Navigation Shortcuts
Section titled “Pane Navigation Shortcuts”Add to ~/.tmux.conf for fast pane switching:
# Use Alt+arrow to switch panes without prefixbind -n M-Left select-pane -Lbind -n M-Right select-pane -Rbind -n M-Up select-pane -Ubind -n M-Down select-pane -D
# Increase history for scrollbackset -g history-limit 50000Shell Integration Patterns
Section titled “Shell Integration Patterns”Piping Output to Claude Code
Section titled “Piping Output to Claude Code”The real power of CLI-first development is piping. Every shell command’s output can become Claude Code input:
# Analyze test failuresnpm run test 2>&1 | claude -p "What are the root causes of these test failures? Group by category."
# Explain complex git historygit log --oneline --graph --since="1 week ago" | claude -p "Summarize the development activity this week."
# Debug build errorsnpm run build 2>&1 | claude -p "Fix these TypeScript build errors. Show me the exact changes needed."
# Analyze dependency vulnerabilitiesnpm audit --json | claude -p "Which of these vulnerabilities are critical and what are the upgrade paths?"Chaining Commands
Section titled “Chaining Commands”Build multi-step pipelines that use Claude Code as a processing step:
# Generate a changelog from commitsgit log --oneline v1.2.0..HEAD | \ claude -p "Generate a user-facing changelog from these commits. Group by: Features, Bug Fixes, Performance." \ --output-format text > CHANGELOG-draft.md
# Create a PR description from the diffgit diff main...HEAD | \ claude -p "Write a PR description for these changes. Include: Summary, Changes Made, Testing Notes." \ --output-format textMulti-Session Workflows
Section titled “Multi-Session Workflows”Parallel Claude Code Instances
Section titled “Parallel Claude Code Instances”Run multiple Claude Code instances for different concerns:
# Terminal 1: Main developmentclaude -r "feature-work"
# Terminal 2: Background code review (separate tmux pane)claude -r "review-session" --model sonnet
# Terminal 3: Test debugging (another pane)claude -r "test-fixes"Each session maintains its own context. The feature work session knows about your architecture decisions. The review session focuses on code quality. The test session tracks test patterns and failures.
The Watch-and-Feed Pattern
Section titled “The Watch-and-Feed Pattern”Monitor a process and feed its output to Claude Code when something goes wrong:
# Watch test output and analyze failures automaticallynpm run test:watch 2>&1 | while IFS= read -r line; do echo "$line" if echo "$line" | grep -q "FAIL"; then echo "$line" | claude -p "This test just failed. What is the likely cause based on the error message?" fidoneNotification Strategies
Section titled “Notification Strategies”Sound Notifications via Hooks
Section titled “Sound Notifications via Hooks”Configure Claude Code to play a sound when it finishes:
{ "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" } ] } ] }}Terminal Bell Integration
Section titled “Terminal Bell Integration”Most terminal emulators can flash or bounce in the dock when a bell character is received:
{ "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "printf '\\a'" } ] } ] }}When This Breaks
Section titled “When This Breaks”tmux scrollback does not capture Claude Code output: Increase your history limit with set -g history-limit 50000 in ~/.tmux.conf. Claude Code sessions can produce thousands of lines.
Piped output is too large for Claude Code: When piping large outputs, use head or tail to limit the input. Claude Code works best with focused context, not 10,000 lines of logs.
Multiple Claude Code instances hit rate limits: Each instance consumes tokens independently. If you are running three parallel sessions, your token usage triples. Watch your /cost across all sessions.
Notification sounds play during meetings: Add a conditional check to your hook: [[ "$(osascript -e 'output muted of (get volume settings)')" != "true" ]] && afplay /System/Library/Sounds/Glass.aiff.
What is Next
Section titled “What is Next”- Prompt Engineering — Write prompts that maximize the output from your terminal workflow
- Script Automation — Turn your best terminal patterns into reusable scripts
- IDE + CLI Coordination — Combine terminal workflows with your editor