Claude Code: Output Styles

Last updated: 2026-08-31

Output styles control how Claude Code "speaks" — from concise to verbose, plain text to JSON, choosing the right style makes information more digestible.

💡 Tip: Output styles don't affect Claude Code's capabilities, only how it presents results. Use default for daily dev, JSON for automation scripts.

📋 Prerequisites: Chapter 16 - Agent Skills and skill-creator

1. What You'll Learn


2. Built-in Output Styles

(1) Style List

Style Description Use Case
default Balanced information Daily development
concise Most compact output Quick queries
verbose Detailed explanations Learning/debugging
code Code-centric Pure code generation
plan Plan before execute Complex tasks

(2) Style Switching

BASH
# Command line
claude --style concise
claude --style verbose

# In-session
> /style concise
> /style verbose

# In CLAUDE.md
## Output Preferences
- Use concise style
- Show diff for code modifications

▶ Example 1: Style Output Comparison

TEXT 📖 Display only
# Default: balanced information about changes and results
# Concise: just ✅ Added resetPassword() to user.service.ts, 4 tests, 2 files changed
# Verbose: full step-by-step analysis, implementation details, test descriptions

3. Custom Output Formats

(1) Define in CLAUDE.md

MARKDOWN
## Output Preferences
- Only show diff for code changes, not full file
- Use English for code, native language for descriptions
- Auto-run tests after file modification
- Show failure reason and fix plan when tests fail
- No need to explain each step (unless asked)

(2) Task-Level Format Control

TEXT 📖 Display only
> List all TODO comments, output in JSON format
> Compare Express vs Fastify performance, show as table
> Generate API documentation, Markdown format
> Refactor this function, only output modified code

▶ Example 2: Formatted Output

TEXT 📖 Display only
> List test coverage for all services under src/services/, show as table

Claude Code:
  | Service | Coverage | Missing |
  |:--------|:---------|:--------|
  | user.service.ts | 92% | delete method |
  | auth.service.ts | 85% | refresh token |
  | payment.service.ts | 0% | **no tests** |

  Average: 64% | Below 80%: 3 services

4. JSON Output for Scripts

(1) Command Line JSON Output

BASH
claude -p "List all TypeScript errors" --output json

# Output structure
{
  "task": "list TypeScript errors",
  "result": { "errors": [...], "total": 1 },
  "usage": { "tokens": 15420, "cost_usd": 0.31 }
}

▶ Example 3: Automated Code Review Script

BASH
#!/bin/bash
# auto-review.sh - Auto-review git changes

CHANGED_FILES=$(git diff --name-only HEAD~1)

for file in $CHANGED_FILES; do
  RESULT=$(claude -p "Review $file code quality, focus on security" --output json)
  ISSUES=$(echo "$RESULT" | jq '.result.issues | length')
  if [ "$ISSUES" -gt 0 ]; then
    echo "⚠️ Found $ISSUES issues in $file"
  else
    echo "✅ $file looks good"
  fi
done

5. Output Style Configuration

(1) Global Default Style

JSON
// ~/.claude/settings.json
{
  "output": {
    "defaultStyle": "concise",
    "showDiff": true,
    "language": "en",
    "autoTest": true
  }
}

(2) Dynamic Switching

TEXT 📖 Display only
> From now on use verbose style
> /style concise  # Switch back
> This task use JSON output  # Single-task specification

6. Comprehensive Example: Multi-Scenario Style Strategy

TEXT 📖 Display only
# Daily development (default)
claude
> Refactor UserService

# Quick fix (concise)
claude --style concise
> Fix this typo

# Learning new project (verbose)
claude --style verbose
> Explain this project's architecture

# Automation scripts (JSON)
claude -p "Code review" --output json | jq '.result'

❓ FAQ

Q Do different styles consume different Tokens?
A Yes. verbose consumes most, concise least. Difference can be 2-3x. Daily use: default or concise.
Q Is JSON output format stable?
A Mostly stable but may change with versions. Add error handling in scripts.
Q Can I customize Markdown templates?
A You can describe output format requirements in CLAUDE.md; Claude Code will try to follow. No strict template system.
Q How to make output more concise?
A Use concise style + precise instructions + CLAUDE.md saying "no need to explain steps".

📖 Summary


📝 Exercises

  1. Basic (⭐): Complete the same task in three different styles, compare output differences.
  2. Intermediate (⭐⭐): Write a simple code review script using JSON output format.
  3. Advanced (⭐⭐⭐): Design team output style standards in CLAUDE.md for consistent experience.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏