Claude Code Statusline, Output Styles and Checkpoints: Three Features That Make Daily Work Faster
Three small Claude Code features save a surprising amount of time: a custom statusline that shows model, context, cost and endpoint at a glance; output styles that change how Claude answers for a whole session; and checkpoints with /rewind, which undo Claude's file edits and conversation in two keystrokes. As of 2026-11-25, all three are current, documented features: the statusline is the statusLine settings key, output styles are switched with /output-style (Default plus four built-ins: Proactive, Concise, Explanatory, Learning), and /rewind (aliases /checkpoint, /undo) or double Esc opens the rewind menu. QCode is an independent third-party API service and is not affiliated with Anthropic.
Updated 2026-11-26
Key facts
- Statusline: set
statusLinewith"type": "command"in~/.claude/settings.json. Claude Code pipes session JSON to your script on stdin and shows whatever it prints. It runs locally and uses no API tokens. - Useful input fields:
model.display_name,context_window.used_percentage,cost.total_cost_usd,prompt_cache.hit_ratio,output_style.name. The documented JSON input has no endpoint field, so readANTHROPIC_BASE_URLfrom the environment and check it on your installed version. - Output styles are not deprecated. They were extended in 2026: a Concise style and the
/output-stylecommand are recent additions, per Anthropic's docs. - Checkpoints are created before each prompt you send, kept for the 100 most recent prompts, and saved with the session so
/rewindstill works after--resume. - Limits of rewind: changes made by Bash commands (
rm,mv,cp), most subagent edits and edits outside Claude Code are not tracked. Keep using Git.
A custom statusline
The quickest way
Type /statusline followed by what you want:
/statusline show model, context % as a bar, session cost and git branch
Claude Code writes a script into ~/.claude/ and updates your settings. Run /statusline with no arguments to have it build one from your shell prompt, or /statusline delete to remove it.
The manual way
Add this to ~/.claude/settings.json (or to a project's settings):
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 0,
"refreshInterval": 30
}
}
commandruns in a shell, so it can be a script path or an inlinejqcommand.paddingadds extra horizontal spacing (default0).refreshIntervalre-runs the command every N seconds (minimum1) on top of event-driven updates. Leave it out if you only show session data.hideVimModeIndicatorhides the built-in-- INSERT --text if your script printsvim.modeitself.
When it updates
Your script runs when a session starts or resumes, then after each new assistant message, after /compact, when the permission mode or vim mode changes, and on the refreshInterval timer. Updates are debounced at 300 ms, and a new update cancels a script that is still running, so keep scripts fast. Output appears only if the script exits with code 0.
What the script receives
The JSON on stdin has many fields. The ones most people use:
| Field | What it holds |
|---|---|
model.id, model.display_name |
Current model, e.g. claude-opus-5-5 / Opus |
context_window.used_percentage |
Pre-calculated share of the context window in use |
context_window.context_window_size |
200000 by default, 1000000 for extended-context models |
context_window.total_input_tokens, total_output_tokens |
Tokens currently in context, from the last API response (input includes cache reads and writes) |
cost.total_cost_usd |
Estimated session cost, computed locally at list price; resets on /clear |
cost.total_duration_ms, cost.total_api_duration_ms |
Wall-clock and API time |
cost.total_lines_added, cost.total_lines_removed |
Lines changed this session |
prompt_cache.hit_ratio, prompt_cache.warm |
Prompt cache statistics for the main conversation |
effort.level |
Current reasoning effort, when the model supports it |
output_style.name |
Active output style |
session_id, session_name, version |
Session identity and Claude Code version |
rate_limits.five_hour, rate_limits.seven_day |
Plan usage windows; only for claude.ai Pro/Max subscribers or behind a Claude apps gateway |
Several fields can be absent (effort, prompt_cache before the first response, rate_limits on API-key sessions), so always use fallbacks such as // 0 or // empty in jq.
Example: model, context, tokens, cost and endpoint
This script answers the questions people on a custom endpoint ask most: which model am I on, how full is the context, how much has this session cost, and which endpoint am I using?
#!/bin/bash
# ~/.claude/statusline.sh (needs jq; chmod +x)
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name // .model.id // "?"')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
IN=$(echo "$input" | jq -r '.context_window.total_input_tokens // 0')
OUT=$(echo "$input" | jq -r '.context_window.total_output_tokens // 0')
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
HIT=$(echo "$input" | jq -r '.prompt_cache.hit_ratio // empty')
STYLE=$(echo "$input" | jq -r '.output_style.name // "default"')
# The endpoint is not in the JSON: read it from the environment
HOST=$(echo "${ANTHROPIC_BASE_URL:-https://api.anthropic.com}" | sed -E 's#^https?://([^/]+).*#\1#')
CACHE=""
[ -n "$HIT" ] && CACHE=" | cache $(awk "BEGIN{printf \"%d\", $HIT*100}")%"
printf '[%s] ctx %s%% (%dk in / %dk out)%s | $%.2f | %s | %s\n' \
"$MODEL" "$PCT" $((IN/1000)) $((OUT/1000)) "$CACHE" "$COST" "$STYLE" "$HOST"
A typical line looks like [Opus] ctx 34% (68k in / 3k out) | cache 91% | $1.87 | default | api.qcode.cc.
Test it with mock input before you rely on it:
echo '{"model":{"display_name":"Sonnet"},"context_window":{"used_percentage":25,"total_input_tokens":50000,"total_output_tokens":2000},"cost":{"total_cost_usd":0.42}}' | ~/.claude/statusline.sh
A few notes on accuracy:
cost.total_cost_usdis an estimate at list price. On QCode, Anthropic models are billed at official price × 1.0, so for Claude models the estimate and the actual charge are calculated from the same list rates. For model IDs Claude Code doesn't recognise, the estimate may be missing or off.context_window.used_percentagecomes from the last API response./contextadds an estimate for messages since then, so it can read slightly higher.- On Windows, Claude Code runs statusline commands through Git Bash if installed, otherwise PowerShell. Write paths with forward slashes, or call a PowerShell script with
powershell -NoProfile -File C:/Users/you/.claude/statusline.ps1.
Community projects such as ccstatusline and starship-claude (both mentioned in Anthropic's docs) offer ready-made themes if you prefer not to script.
If the statusline is blank
Check that the script is executable and prints to stdout, that you accepted the workspace trust dialog (until then, claude --debug logs Status line command skipped: workspace trust not accepted), and that disableAllHooks or a managed allowManagedHooksOnly policy isn't turning it off.
Output styles
An output style is a set of instructions that changes Claude's tone, length and format for every response in a session. They are not deprecated: as of 2026-11-25 Anthropic documents Default plus four built-ins.
| Style | What changes | Token effect |
|---|---|---|
| Default | Standard software-engineering prompt, no style added | Baseline |
| Proactive | Starts work immediately, makes reasonable assumptions; doesn't change permission mode | Similar |
| Concise | Leads with the result, drops preamble and recaps | Fewer output tokens |
| Explanatory | Adds short Insight blocks explaining choices |
More output tokens |
| Learning | Adds Insights and leaves TODO(human) pieces for you to write |
More output tokens |
Switch styles:
/output-style concise
With no argument, /output-style lists styles and marks the current one. You can also use /config → Output style, or set it in a settings file. The command and menu save your choice to .claude/settings.local.json; to make it your default everywhere, put it in ~/.claude/settings.json. The value is case-sensitive: "outputStyle": "Concise" works, "concise" silently gives you Default.
A custom style
Save a Markdown file in ~/.claude/output-styles/ (user) or .claude/output-styles/ (project):
---
name: Review notes
description: Short bullet answers with file:line references
keep-coding-instructions: true
---
Answer in at most five bullets. Cite every claim as path:line.
End with one line: "Risk: low | medium | high".
keep-coding-instructions: true keeps Claude Code's built-in engineering instructions; leave it out only if Claude won't be coding. Restart Claude Code after creating or editing a style file. A new style applies from your next message; Anthropic notes that changing style mid-session has a prompt-caching cost on that first message.
When not to use a style: project facts belong in CLAUDE.md, guaranteed behaviour (formatting after every edit) belongs in a hook, and one-off procedures belong in a skill.
Checkpoints and /rewind
Claude Code snapshots your files before each prompt that starts a turn. To go back, press Esc twice with an empty input, or run /rewind. Pick a prompt, then choose:
- Restore code and conversation — revert both to that point
- Restore conversation — rewind the chat, keep current code
- Restore code — revert files, keep the conversation
- Summarize from here — compress everything after this point into a summary
- Summarize up to here — compress everything before this point
- Never mind — back out
The two code options appear only when that checkpoint has tracked file changes. The summarize options work like a targeted /compact and free context space; you can type guidance next to add context (optional) before pressing Enter.
What rewind can't undo:
| Not tracked | What to do instead |
|---|---|
Files changed by Bash (rm, mv, cp, codegen) |
Commit before risky steps; use git restore |
Edits by most subagents (background forks, /code-review --fix) |
Revert with Git |
| Your own edits outside Claude Code, other sessions | Git |
| Symlinked or hard-linked files | Restore skips them and warns Restored the code, but skipped N files |
Retention: snapshots are kept for the 100 most recent checkpoints in a session and are deleted in the cleanup sweep about 30 days after the session last saved one (raise cleanupPeriodDays to keep them longer). To turn checkpointing off, set CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING=1 or fileCheckpointingEnabled: false. To try a different approach while keeping the original intact, /branch forks the session instead.
Putting the three together
A practical daily setup:
- Statusline shows model, context %, cache hit ratio, cost and endpoint, so you notice when context passes ~60% or a cache goes cold.
- Concise style for routine tasks keeps answers short; switch to Explanatory when you're learning an unfamiliar codebase.
- When Claude heads the wrong way, press
Escto stop, thenEsc Esc→ Restore code and conversation, and re-prompt more precisely instead of arguing with a polluted context. - Before a long debugging thread eats your context, Summarize from here keeps your early instructions and compresses the noise.
Combine this with plan mode for larger changes, and with the permission rules from our settings.json guide.
FAQ
Why is my Claude Code statusline blank?
Usually the script isn't executable, prints to stderr, exits non-zero, or the folder isn't trusted yet. Run claude --debug to see the script's stderr and any workspace trust not accepted message, and test the script with mock JSON.
Does the statusline use tokens?
No. Anthropic's docs say the statusline runs locally and doesn't consume API tokens. A slow script only delays the bar, so cache expensive commands like git status.
Is cost.total_cost_usd my real bill?
It's a client-side estimate at list price. On QCode, Claude models are billed at official price × 1.0, so the numbers come from the same rates; treat the figure as an estimate, not an authoritative charge.
Are output styles deprecated in Claude Code?
No. As of 2026-11-25 they are documented and were expanded with the Concise style and the /output-style command. Built-ins are Default, Proactive, Concise, Explanatory and Learning.
Do output styles increase token usage?
A style adds instructions to each request, which prompt caching mostly absorbs after the first request. Explanatory and Learning produce longer answers, while Concise produces shorter ones.
Can /rewind undo a file deleted with rm?
No. Checkpoints only track edits made by Claude's file-editing tools, not Bash commands. Commit before risky operations and restore with Git.
How long are Claude Code checkpoints kept?
For the 100 most recent prompts in a session, and on disk until the cleanup sweep, by default about 30 days after the last snapshot. Change it with cleanupPeriodDays.
What's the difference between /rewind and /compact?
/compact summarises the whole conversation. Summarize from here or Summarize up to here in /rewind compresses only part of it, so you keep the messages that matter.
Sources: Anthropic's Claude Code docs (Customize your status line, Output styles, Checkpointing, Commands, Environment variables), read 2026-11-25.
Using Claude Code every day?
QCode's Daily 35 plan gives you $35 of usage per day (reset daily at 00:00 Beijing time) for $53.57 per 30 days; Anthropic and OpenAI models are billed at the official API price ×1.0, and one key works for both protocols. Put the cost and endpoint in your statusline and you'll always know where the day's budget stands. Personal plans start from $9 per month; see /pricing.