Claude Code Integration
Claude Code Integration
To display your custom statusline in the Claude Code terminal, you must link the generated Bash script to Claude's configuration. Claude Code executes this script on every prompt, passing session data via stdin and rendering the script's stdout as the statusline.
1. Save the Script
After configuring your blocks in the editor, you need to save the output to a local file. We recommend using the dedicated Claude configuration directory.
Option A: Quick Install (Recommended)
- In the editor's Output panel, click Copy install cmd.
- Paste the command into your terminal.
- This automatically creates the directory, saves the script, and sets the necessary execution permissions.
Option B: Manual Setup If you prefer to handle the file manually:
- Copy the raw script code from the editor.
- Create a new file (e.g.,
~/.claude/statusline.sh) and paste the content. - Grant execution permissions:
chmod +x ~/.claude/statusline.sh
2. Update Claude Code Settings
Claude Code looks for a statusline field in its global settings file.
- Open your Claude Code settings file:
- macOS/Linux:
~/.claude/settings.json - Windows:
%USERPROFILE%\.claude\settings.json
- macOS/Linux:
- Add or update the
"statusline"property with the absolute path to your script:
{
"statusline": "~/.claude/statusline.sh"
}
3. Verify Dependencies
The generated script relies on a few standard utilities to parse Claude's data and calculate usage metrics. Ensure these are installed on your system:
| Dependency | Purpose | Installation (Example) |
| :--- | :--- | :--- |
| jq | Parses JSON input from Claude | brew install jq / apt install jq |
| python3 | Handles date/time math for rate resets | Pre-installed on most systems |
| curl | Fetches Anthropic API usage (optional) | Pre-installed on most systems |
4. Platform-Specific Requirements
If you enabled Rate 5h or Rate Week blocks, the script must access your Claude Code credentials to fetch usage data from Anthropic’s API. This requires a platform-specific tool:
- macOS: Uses the native Keychain (no extra install needed).
- Linux / WSL: Requires
libsecret. Install viasudo apt install libsecret-tools. - Windows (Git Bash): Requires the
CredentialManagerPowerShell module. RunInstall-Module -Name CredentialManagerin an elevated PowerShell prompt.
Troubleshooting
- Empty Statusline: Ensure the script is executable (
chmod +x). Try runningcat some_json | ~/.claude/statusline.shmanually to see if it throws errors. - Rate Data Not Showing: The script caches API data for 2 minutes in
~/.claude/.usage-cache.json. If the data is missing, ensure you are logged into Claude Code (/login) so credentials exist in your system vault. - Slow Prompts: The script is optimized to run asynchronously where possible, but if you experience lag, try disabling the "Rate" blocks to prevent network calls.