làm tíai?GitHub ↗
CHƯƠNG 12 / 16

Output styles và statusline

Tùy biến cách Claude trả lời, statusline, voice input và trải nghiệm terminal.

18 phút đọc

Claude Code chạy tốt ngay khi cài đặt, nhưng bạn có thể tùy biến gần như mọi lớp của trải nghiệm: cách Claude trả lời (output style), thanh trạng thái dưới đáy màn hình (statusline), nhập liệu bằng giọng nói (voice dictation), và hành vi terminal (terminal config). Chương này là tham chiếu nhanh cho cả bốn.


12.1. Output styles

Output style thay đổi cách Claude trả lời, không phải những gì Claude biết. Nó chỉnh sửa trực tiếp system prompt để đặt vai trò (role), giọng điệu (tone) và định dạng output. Dùng khi bạn liên tục phải re-prompt cùng một kiểu giọng/định dạng mỗi lượt, hoặc muốn Claude đóng vai gì đó khác software engineer.

Cho hướng dẫn về project, convention, codebase của bạn, dùng CLAUDE.md thay vì output style.

Built-in output styles

StyleHành vi
DefaultSystem prompt gốc, tối ưu cho software engineering.
ProactiveClaude thực thi ngay, tự đưa giả định hợp lý thay vì dừng hỏi các quyết định thường lệ, ưu tiên hành động hơn lập kế hoạch. Mạnh hơn auto mode nhưng vẫn hiện permission prompt trước khi chạy tool.
ExplanatoryChèn "Insights" mang tính giáo dục giữa lúc làm task, giúp hiểu lựa chọn implementation và pattern của codebase.
LearningLearn-by-doing: chia sẻ "Insights" và yêu cầu bạn tự viết vài đoạn code chiến lược. Claude chèn marker TODO(human) vào code để bạn tự implement.

Đổi output style

Chạy /config và chọn Output style từ menu. Lựa chọn lưu vào .claude/settings.local.json ở cấp local project.

Bạn cũng có thể dùng /output-style [style] để chọn trực tiếp, hoặc chạy /output-style không có argument để mở picker.

Để đặt không qua menu, sửa trực tiếp field outputStyle trong settings file:

{
  "outputStyle": "Explanatory"
}

Output style là một phần của system prompt, mà Claude Code chỉ đọc một lần lúc bắt đầu session. Thay đổi có hiệu lực sau /clear hoặc session mới.

Tạo custom output style

Custom output style là một file Markdown: frontmatter cho metadata, rồi đến phần instructions thêm vào system prompt.

Lưu ở một trong ba cấp (tên file trở thành tên style trừ khi đặt name trong frontmatter):

CấpĐường dẫn
User~/.claude/output-styles
Project.claude/output-styles
Managed policy.claude/output-styles bên trong managed settings directory

Project output style load từ mọi .claude/output-styles/ giữa working directory và repository root. Từ v2.1.178, khi nhiều thư mục lồng nhau định nghĩa style trùng tên, Claude Code dùng cái gần working directory nhất.

Ví dụ style luôn mở đầu mọi giải thích bằng một diagram, đồng thời giữ hành vi coding:

---
name: Diagrams first
description: Lead every explanation with a diagram
keep-coding-instructions: true
---

When explaining code, architecture, or data flow, start with a Mermaid diagram
showing the structure, then explain in prose.

## Diagram conventions

Use `flowchart TD` for control flow and `sequenceDiagram` for request paths.
Keep diagrams under 15 nodes.

Sau đó /config → chọn style dưới Output style. Có hiệu lực sau /clear hoặc session kế tiếp. Plugin cũng có thể ship output style trong thư mục output-styles/.

Frontmatter

FrontmatterMục đíchDefault
nameTên style nếu không dùng tên fileKế thừa tên file
descriptionMô tả hiện trong picker /configNone
keep-coding-instructionsGiữ instructions software engineering built-infalse
force-for-pluginChỉ cho plugin: tự áp dụng style khi plugin bật, không cần user chọn. Ghi đè setting outputStyle của user. Nhiều plugin cùng đặt thì dùng cái load đầu tiên.false

Quyết định keep-coding-instructions: đặt true khi bạn chỉ đổi cách Claude giao tiếp nhưng vẫn muốn nó code như cũ (ví dụ luôn trả lời kèm diagram). Bỏ đi khi Claude không làm software engineering (writing assistant, data analyst...).

Cách output styles hoạt động

  • Instructions của mọi style được thêm vào cuối system prompt.
  • Mọi style kích hoạt reminder để Claude bám sát instructions trong hội thoại.
  • Custom style bỏ instructions software engineering built-in (cách scope thay đổi, viết comment, verify) trừ khi keep-coding-instructions: true.
  • Chỉ áp dụng cho main conversation: subagent chạy system prompt riêng nên không bị ảnh hưởng. Ngoại lệ là fork — nó kế thừa toàn bộ system prompt của parent.

Token: thêm instructions vào system prompt làm tăng input token, nhưng prompt caching giảm chi phí này sau request đầu tiên. Explanatory và Learning sinh response dài hơn Default nên tăng output token.

So sánh với các feature liên quan

FeatureCách hoạt độngDùng khi
Output stylesSửa system promptMuốn role/tone/định dạng khác mọi lượt
CLAUDE.mdThêm user message sau system promptClaude luôn cần biết convention & codebase context
--append-system-promptNối vào system prompt, không xóa gìThêm một lần cho một lần invoke
AgentsChạy subagent với system prompt/model/tool riêngCần helper scope riêng cho task tập trung
SkillsLoad instructions theo task khi được gọiCó workflow tái sử dụng

12.2. Statusline

Statusline là thanh tùy biến ở đáy Claude Code, chạy bất kỳ shell script nào bạn cấu hình. Nó nhận JSON session data qua stdin và hiển thị bất cứ gì script in ra stdout — góc nhìn liên tục về context usage, cost, git status, hay bất cứ gì bạn muốn theo dõi.

Statusline render ở dòng riêng phía trên footer badge built-in, không thay thế chúng. Nó chạy local và không tốn API token.

Set up nhanh

Hai cách: nhờ Claude Code tự generate, hoặc tự viết script.

Cách 1 — lệnh /statusline (nhận ngôn ngữ tự nhiên, tạo script trong ~/.claude/ và tự cập nhật settings):

/statusline show model name and context percentage with a progress bar

Cách 2 — cấu hình thủ công. Thêm field statusLine vào user settings (~/.claude/settings.json) hoặc project settings. Đặt type: "command", trỏ command tới script path hoặc inline command:

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 2
  }
}

command chạy trong shell nên có thể dùng inline command. Ví dụ dùng jq in tên model và phần trăm context:

{
  "statusLine": {
    "type": "command",
    "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'"
  }
}

Field tùy chọn:

FieldTác dụng
paddingThêm khoảng cách ngang (số ký tự). Default 0.
refreshIntervalChạy lại command mỗi N giây, ngoài update theo event. Tối thiểu 1. Đặt khi statusline hiển thị dữ liệu theo thời gian (đồng hồ) hoặc subagent nền đổi git state khi session idle.
hideVimModeIndicatorẨn text built-in -- INSERT --. Đặt true khi script tự render vim.mode.

Gỡ statusline: chạy /statusline và yêu cầu xóa (/statusline delete, /statusline clear...), hoặc xóa field statusLine khỏi settings.

Script statusline mẫu

Đọc JSON từ stdin, trích model + directory + context %, in ra một dòng. Lưu vào ~/.claude/statusline.sh:

#!/bin/bash
# Đọc JSON mà Claude Code gửi vào stdin
input=$(cat)

# Trích field bằng jq
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
# "// 0" là fallback nếu field null
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

# ${DIR##*/} lấy tên folder cuối
echo "[$MODEL] 📁 ${DIR##*/} | ${PCT}% context"

Rồi làm executable và trỏ settings tới nó:

chmod +x ~/.claude/statusline.sh

Cách statusline hoạt động

Claude Code chạy script và pipe JSON session data vào qua stdin. Script đọc JSON, trích thứ cần, in ra stdout — Claude Code hiển thị đúng những gì được in.

Khi nào update: sau mỗi assistant message mới, sau khi /compact xong, khi đổi permission mode, hoặc khi toggle vim mode. Update debounce ở 300ms. Nếu update mới kích hoạt khi script đang chạy, lần chạy dở bị hủy. Sửa script thì thay đổi chỉ hiện ở lần tương tác kế tiếp.

Script có thể output:

  • Nhiều dòng: mỗi echo/print là một row riêng.
  • Màu: ANSI escape code như \033[32m (xanh lá); terminal phải hỗ trợ.
  • Link: OSC 8 escape sequence làm text clickable (cần terminal như iTerm2, Kitty, WezTerm).

Đo kích thước terminal: tput cols không đọc được từ trong script (output bị capture). Đọc biến môi trường COLUMNSLINES thay thế (cần v2.1.153+).

JSON input — các field hay dùng

Toàn bộ dữ liệu đến qua một JSON object trên stdin. Các field phổ biến:

FieldMô tả
model.id, model.display_nameĐịnh danh và tên hiển thị của model hiện tại
workspace.current_dir (cwd)Working directory hiện tại
workspace.project_dirThư mục nơi Claude Code khởi động
workspace.repo.host/owner/nameDanh tính repo parse từ remote origin
cost.total_cost_usdCost ước tính session (USD), tính client-side. Reset về $0 khi /clear (v2.1.211+)
cost.total_duration_ms, cost.total_api_duration_msThời gian wall-clock / chờ API (ms)
cost.total_lines_added/removedSố dòng code thay đổi
context_window.used_percentage% context đã dùng (đã tính sẵn)
context_window.remaining_percentage% context còn lại
context_window.context_window_sizeKích thước tối đa (200000 mặc định, 1000000 cho model extended)
context_window.current_usageToken của lần API gần nhất (input/output/cache_creation/cache_read). null trước API call đầu và ngay sau /compact
effort.levelReasoning effort hiện tại (low/medium/high/xhigh/max)
rate_limits.five_hour.used_percentage, rate_limits.seven_day.used_percentage% rate limit đã dùng (chỉ có với subscriber Pro/Max sau API response đầu)
session_id, session_nameĐịnh danh & tên session
output_style.nameTên output style hiện tại
vim.modeMode vim hiện tại khi bật vim mode
pr.number, pr.url, pr.review_statePR đang mở cho branch hiện tại
versionVersion Claude Code

Xử lý field vắng/null: nhiều field chỉ xuất hiện trong điều kiện nhất định (rate_limits, pr, vim, effort...). Dùng // empty hoặc // 0 trong jq, optional chaining (?.) trong JS, or 0 trong Python. used_percentage được tính từ input token (input + cache_creation + cache_read), không gồm output token.

Ví dụ: context bar nhiều màu, nhiều dòng

Kết hợp threshold màu (xanh <70%, vàng 70-89%, đỏ 90%+), progress bar và git branch. Mỗi echo là một row:

#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')

CYAN='\033[36m'; GREEN='\033[32m'; YELLOW='\033[33m'; RED='\033[31m'; RESET='\033[0m'

# Chọn màu bar theo context usage
if [ "$PCT" -ge 90 ]; then BAR_COLOR="$RED"
elif [ "$PCT" -ge 70 ]; then BAR_COLOR="$YELLOW"
else BAR_COLOR="$GREEN"; fi

FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
printf -v FILL "%${FILLED}s"; printf -v PAD "%${EMPTY}s"
BAR="${FILL// /█}${PAD// /░}"

MINS=$((DURATION_MS / 60000)); SECS=$(((DURATION_MS % 60000) / 1000))

BRANCH=""
git rev-parse --git-dir > /dev/null 2>&1 && BRANCH=" | 🌿 $(git branch --show-current 2>/dev/null)"

echo -e "${CYAN}[$MODEL]${RESET} 📁 ${DIR##*/}$BRANCH"
COST_FMT=$(printf '$%.2f' "$COST")
echo -e "${BAR_COLOR}${BAR}${RESET} ${PCT}% | ${YELLOW}${COST_FMT}${RESET} | ⏱️ ${MINS}m ${SECS}s"

Cache thao tác chậm

Script chạy rất thường xuyên. Lệnh như git status/git diff có thể chậm trong repo lớn. Cache git info vào temp file và chỉ refresh mỗi 5 giây. Quan trọng: tên cache file phải ổn định trong session nhưng unique giữa các session — dùng session_id từ JSON, không dùng $$/os.getpid() (đổi mỗi lần chạy, phá cache).

CACHE_FILE="/tmp/statusline-git-cache-$SESSION_ID"
CACHE_MAX_AGE=5  # giây

Subagent statusline

Setting subagentStatusLine render row body tùy biến cho từng subagent trong agent panel dưới prompt:

{
  "subagentStatusLine": {
    "type": "command",
    "command": "~/.claude/subagent-statusline.sh"
  }
}

Command chạy một lần mỗi refresh tick, nhận toàn bộ subagent row đang hiển thị dưới dạng một JSON object trên stdin (gồm base hook fields, columns, và mảng tasks với id/name/status/tokenCount/model...). In một dòng JSON {"id": "<task id>", "content": "<row body>"} cho mỗi row muốn ghi đè.

Windows

Trên Windows, Claude Code chạy statusline qua Git Bash (nếu có) hoặc PowerShell. Git Bash coi backslash chưa quote là escape, nên viết path bằng forward slash trong command. Chạy PowerShell script:

{
  "statusLine": {
    "type": "command",
    "command": "powershell -NoProfile -File C:/Users/username/.claude/statusline.ps1"
  }
}

Troubleshooting statusline (nhanh)

  • Không hiện: kiểm tra script executable (chmod +x), output ra stdout (không phải stderr), chạy thử thủ công. disableAllHooks: true cũng tắt statusline.
  • Cần workspace trust: statusline chạy shell command nên yêu cầu chấp nhận workspace trust dialog như hooks. Nếu chưa chấp nhận, statusline trống; claude --debug log Status line command skipped: workspace trust not accepted.
  • Hiện -- / giá trị rỗng: field có thể null trước API response đầu — dùng fallback // 0.
  • OSC 8 link không click được: xác nhận terminal hỗ trợ hyperlink; đặt FORCE_HYPERLINK=1 để ép detection. Terminal.app không hỗ trợ.
  • Test bằng mock input:
    echo '{"model":{"display_name":"Opus"},"workspace":{"current_dir":"/home/user/project"},"context_window":{"used_percentage":25},"session_id":"test-session-abc"}' | ./statusline.sh
    

12.3. Voice dictation

Nói prompt thay vì gõ. Giọng nói được transcribe live vào ô prompt, nên bạn có thể trộn voice và typing trong cùng message. Bật bằng /voice.

Requirements

Voice dictation stream audio đã ghi lên server Anthropic để transcribe (không xử lý local). Cần đủ:

  • Claude.ai account: dịch vụ speech-to-text chỉ có khi authenticate bằng Claude.ai account. Không dùng được với API key trực tiếp, Amazon Bedrock, Google Cloud, hay Microsoft Foundry.
  • Organization không bật HIPAA: nếu bật, /voice báo Voice mode is disabled by your organization's policy.
  • Microphone local: không hoạt động trong môi trường remote (Claude Code on the web, SSH session).
  • WSLg nếu chạy trong WSL (kèm WSL2 từ Microsoft Store).

Transcription không tốn Claude message/token và không tính vào /usage. Audio dùng native module trên macOS/Linux/Windows; trên Linux nếu native module không load được thì fallback sang arecord (ALSA) hoặc rec (SoX).

Bật & chọn mode

/voice
Voice mode enabled (hold). Hold space to record. Dictation language: en (/config to change).
CommandTác dụng
/voiceToggle on/off, giữ mode hiện tại
/voice holdBật hold mode
/voice tapBật tap mode
/voice offTắt

Voice persist qua các session. Đặt trực tiếp trong user settings:

{
  "voice": {
    "enabled": true,
    "mode": "tap"
  }
}

Transcription được tune cho vocabulary lập trình: regex, OAuth, JSON, localhost được nhận đúng, và tên project + git branch hiện tại được thêm làm recognition hint tự động.

Hold mode (mặc định) vs Tap mode

Hold (push-to-talk)Tap
Cách dùngGiữ Space để ghi, thả để dừng & finalizeTap Space bắt đầu, tap lần nữa để gửi
WarmupCó (phát hiện qua key-repeat)Không
Auto-submitĐặt "autoSubmit": true để gửi khi thả (transcript ≥ 3 từ)Tự gửi khi transcript ≥ 3 từ (ngắn hơn thì chèn nhưng không gửi)
VersionCó sẵnCần v2.1.116+

Transcript được chèn tại vị trí con trỏ, con trỏ ở lại cuối đoạn vừa chèn, nên trộn typing và dictation theo thứ tự bất kỳ. Trong tap mode, tap đầu chỉ bắt đầu ghi khi ô prompt trống (để vẫn gõ space bình thường); recording tự dừng sau 15 giây im lặng hoặc 2 phút tổng.

Ngưỡng 3 từ đếm cả ngôn ngữ viết không khoảng trắng: từ v2.1.195, tiếng Nhật/Trung/Thái đếm từng từ nên vẫn auto-submit.

Đổi ngôn ngữ dictation

Dùng chung setting language với ngôn ngữ trả lời của Claude. Rỗng thì mặc định English. Đặt bằng BCP 47 code hoặc tên ngôn ngữ:

{
  "language": "japanese"
}

Hỗ trợ 20 ngôn ngữ (cs, da, nl, en, fr, de, el, hi, id, it, ja, ko, no, pl, pt, ru, es, sv, tr, uk). Nếu language không trong danh sách, /voice cảnh báo và fallback English cho dictation (không ảnh hưởng text response).

Rebind phím dictation

Phím bound tới voice:pushToTalk trong context Chat, mặc định Space. Cùng binding cho cả hai mode. Rebind trong ~/.claude/keybindings.json:

{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "meta+k": "voice:pushToTalk",
        "space": null
      }
    }
  ]
}

Trong hold mode, tránh bind phím chữ trơn (như v) vì hold detection dựa vào key-repeat và chữ sẽ gõ vào prompt lúc warmup. Dùng Space, hoặc modifier combo như meta+k để ghi ngay từ lần nhấn đầu (không warmup).

Troubleshooting voice (nhanh)

  • Voice mode requires a Claude.ai account: đang dùng API key/provider bên thứ ba. Chạy /login.
  • Microphone access is denied: cấp quyền mic cho terminal trong system settings. macOS: System Settings → Privacy & Security → Microphone.
  • Terminal không có trong danh sách mic (macOS): reset quyền bằng tccutil reset Microphone <bundle-id> (com.apple.Terminal, com.googlecode.iterm2...), Cmd+Q terminal rồi mở lại, chạy /voice.
  • No audio recording tool found (Linux): cài SoX theo lệnh trong thông báo (sudo apt-get install sox).
  • WSL không tìm được recorder: sudo apt install sox libsox-fmt-pulse (WSLg route audio qua PulseAudio).
  • Giữ Space không có gì (hold mode): nếu space dồn thì voice đang tắt (/voice hold); nếu chỉ 1-2 space rồi dừng thì hold detection không kích hoạt (key-repeat tắt ở OS) — chuyển /voice tap.

Voice dictation cũng chạy trong agent view và VS Code extension (cùng yêu cầu Claude.ai account; không dùng trong VS Code Remote).


12.4. Terminal config

Claude Code chạy trong mọi terminal không cần cấu hình. Phần này chỉ dành cho khi có gì đó không đúng ý. Đây là về việc terminal gửi đúng tín hiệu cho Claude Code — để đổi phím Claude Code phản hồi, xem keybindings.

Multiline prompt (Shift+Enter)

Enter gửi message. Xuống dòng không gửi: Ctrl+J, hoặc gõ \ rồi Enter — cả hai chạy ở mọi terminal không setup. Với Shift+Enter, hỗ trợ tùy terminal:

TerminalShift+Enter
Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal, Windows TerminalChạy sẵn
VS Code, Cursor, Devin Desktop, Alacritty, ZedChạy /terminal-setup một lần
gnome-terminal, JetBrains IDE (PyCharm, Android Studio)Không có; dùng Ctrl+J hoặc \ + Enter

/terminal-setup ghi binding vào config của terminal. Ở VS Code/Cursor/Devin nó còn đặt terminal.integrated.gpuAcceleration: "off" (chống garbled text) và chỉnh mouseWheelScrollSensitivity. Chạy /terminal-setup trực tiếp trong host terminal, không trong tmux/screen. Trong tmux, Shift+Enter cần thêm cấu hình tmux bên dưới.

Option key trên macOS (Meta)

Nhiều shortcut dùng Option (Option+Enter xuống dòng, Option+P đổi model). macOS mặc định không gửi Option như modifier:

TerminalCách bật
Apple TerminalSettings → Profiles → Keyboard → check "Use Option as Meta Key"
iTerm2Settings → Profiles → Keys → General → Left/Right Option = "Esc+"
VS CodeThêm "terminal.integrated.macOptionIsMeta": true

Terminal bell / notification

Khi Claude xong task hoặc dừng chờ permission, nó fire notification event. Mặc định Claude Code gửi desktop notification chỉ ở Ghostty, Kitty, iTerm2. Terminal khác: đặt preferredNotifChannel thành "terminal_bell" để rung bell:

{
  "preferredNotifChannel": "terminal_bell"
}

Hoặc dùng Notification hook cho âm thanh/lệnh tùy biến (chạy song song với notification built-in, không thay thế):

{
  "hooks": {
    "Notification": [
      {
        "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" }]
      }
    ]
  }
}

Desktop notification tới máy local qua SSH nên remote session vẫn báo được. iTerm2 cần bật forwarding: Settings → Profiles → Terminal → "Notification Center Alerts" + "Send escape sequence-generated alerts".

tmux

Trong tmux, hai thứ hỏng mặc định: Shift+Enter gửi thay vì xuống dòng, và notification/progress bar không tới outer terminal. Thêm vào ~/.tmux.conf rồi tmux source-file ~/.tmux.conf:

set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'

allow-passthrough cho notification & progress tới outer terminal; hai dòng extended-keys giúp tmux phân biệt Shift+Enter với Enter thường.

Color theme & custom theme

Dùng /theme hoặc theme picker trong /config. Tùy chọn auto phát hiện nền sáng/tối của terminal. Claude Code không điều khiển color scheme của terminal (do terminal app đặt).

Custom theme (cần v2.1.118+): mỗi theme là một file JSON trong ~/.claude/themes/, filename (bỏ .json) là slug. Ba field tùy chọn:

FieldMô tả
nameNhãn hiển thị trong /theme
basePreset khởi đầu: dark, light, dark-daltonized, light-daltonized, dark-ansi, light-ansi (default dark)
overridesMap tên color token → giá trị màu

Giá trị màu nhận #rrggbb, #rgb, rgb(r,g,b), ansi256(n), hoặc ansi:<name>. Token/giá trị không hợp lệ bị bỏ qua (typo không phá render).

{
  "name": "Dracula",
  "base": "dark",
  "overrides": {
    "claude": "#bd93f9",
    "error": "#ff5555",
    "success": "#50fa7b"
  }
}

Claude Code watch ~/.claude/themes/ và reload khi file thay đổi (nếu folder chưa tồn tại lúc khởi động thì restart một lần sau khi tạo file đầu). Một số token thường dùng: claude (brand accent/spinner), text, error, success, warning, promptBorder, planMode, diffAdded/diffRemoved.

Fullscreen rendering

Nếu display nhấp nháy hoặc scroll nhảy khi Claude làm việc, chuyển sang fullscreen rendering mode — vẽ vào màn hình riêng thay vì nối vào scrollback, giữ memory phẳng và thêm mouse support. Chạy /tui fullscreen (lưu preference), hoặc đặt biến môi trường:

CLAUDE_CODE_NO_FLICKER=1 claude

Nếu chỉ flicker và terminal hỗ trợ synchronized output nhưng không auto-detect (như Emacs eat), đặt CLAUDE_CODE_FORCE_SYNC_OUTPUT=1 để hết flicker mà không đổi renderer.

Vim keybindings trong prompt

Bật qua /config → Editor mode, hoặc đặt editorMode: "vim" trong ~/.claude/settings.json (đặt lại normal để tắt). Hỗ trợ subset motion/operator NORMAL & VISUAL (hjkl, v/V, d/c/y với text object). Vim motion không remap qua keybindings file; để map chuỗi INSERT-mode như jj → Escape, dùng vimInsertModeRemaps. Enter vẫn submit trong INSERT mode — dùng o/O (NORMAL) hoặc Ctrl+J để xuống dòng.

Paste nội dung lớn

Paste hơn 800 ký tự hoặc hơn 2 dòng thì Claude Code thu gọn input thành placeholder như [Pasted text #1 +120 lines]; nội dung đầy đủ vẫn được gửi khi submit. VS Code integrated terminal có thể rớt ký tự với paste rất lớn — ưu tiên workflow file-based: ghi nội dung ra file và bảo Claude đọc.


Xem thêm

  • content/en/docs/claude-code/output-styles.md — Output styles đầy đủ
  • content/en/docs/claude-code/statusline.md — Statusline: toàn bộ field JSON, ví dụ, subagent statusline
  • content/en/docs/claude-code/voice-dictation.md — Voice dictation & troubleshooting đầy đủ
  • content/en/docs/claude-code/terminal-config.md — Terminal config, custom theme token reference đầy đủ
  • content/en/docs/claude-code/settings.md — Reference cho outputStyle, statusLine, voice, language, preferredNotifChannel, editorMode
  • content/en/docs/claude-code/keybindings.md — Rebind voice:pushToTalk, chat:newline, chat:submit
  • content/en/docs/claude-code/interactive-mode.md — Vim editor mode & keyboard shortcut reference
Nguồn của chương

Tài liệu chính thức duy nhất từ Anthropic.

Claude Code docs
Trở về mục lục