Unlike Codex, executing the /statusline command in Claude Code does not provide direct, quick adjustment options for what to display. Executing /statusline actually invokes the model to analyze and modify the ~/.claude/settings.json file.
Implementing via Claude Code
If you want Claude Code to display the 5-hour / 7-day quota and context window usage, you only need to run the following command:
1 | /statusline show 5h quota, 7d quota, context usage |
Claude Code will then automatically generate the corresponding script and update ~/.claude/settings.json.
Manual Implementation for macOS
Claude Code calls the model to analyze the requirements and automatically generate scripts, which consumes a standard model request quota.
Below is the code I have already created, which also includes the git branch display. You can directly copy and use it.
The script depends on jq. If it is not installed on your system, you can install it via Homebrew:
1 | brew install jq |
Creating statusline-command.sh
First, create the file ~/.claude/statusline-command.sh and populate it with the following content:
1 |
|
Editing ~/.claude/settings.json
Then edit ~/.claude/settings.json and insert the following content before the final closing brace }.
macOS:
1 | "statusLine": { |
Make sure to replace <User> with your actual username/path.
Manual Implementation: Windows + PowerShell 7
Creating statusline-command.ps1
First, create the file ~/.claude/statusline-command.ps1 and populate it with the following content:
1 | # statusline-command.ps1 |
Editing ~/.claude/settings.json
Then edit ~/.claude/settings.json and insert the following content before the final closing brace }.
Windows :
1 | "statusLine": { |
Make sure to replace <User> with your actual username/path.
Preview Results
macOS:

Windows:

Not Taking Effect in Newly Opened Windows
When opening a new window, you may notice that the quota usage information is missing; this is because a conversation interaction is required to trigger a refresh.
Adjusting Displayed Information
Simply open Claude Code and type /statusline <adjustments> to let Claude Code handle the adjustments automatically.
Implementing directly using Third-Party Packages
If you prefer not to configure it manually, there are several third-party packages that can achieve this effect. For example, ccusage, a popular package for tracking model usage, provides this feature.
https://ccusage.com/guide/statusline
In addition to displaying info on the status line, ccusage can also track historical token consumption, model usage, and quota expenditure.
Comments