
If your Claude Code status line is not showing, the cause is almost always the script behind it. Claude Code only draws the row when your statusLine command exits with code 0 and prints something to stdout. A script that isn’t executable, a wrong path, output sent to stderr, a non-zero exit code or broken JSON in settings.json will all leave the row blank, with no error on screen.
The fastest fix is to run the script yourself with a small sample JSON and check its exit code. If that works, accept the folder trust dialog, then start Claude Code with --debug-file and search the log for StatusLine. The log names the exact problem, such as Permission denied or completed with status 127.
We broke a working status line seven different ways in a throwaway project and recorded what each one looked like. Below you’ll find every cause, the real output we saw and the exact fix.
Browse all our Claude Code tutorials for more fixes and how-tos.
Tested with Claude Code v2.1.332 on macOS on December 4, 2026. Every status line in this guide lived in a demo project’s .claude/settings.json, so nothing outside the demo was changed. Items marked as coming from the docs follow Anthropic’s official status line page, and we say so each time.
Quick Summary: Why the Claude Code Status Line Is Blank
Find what you see in the first column. The first seven rows are problems we triggered ourselves on v2.1.332.
| What you see | Cause | Fix | How we checked it |
|---|---|---|---|
Blank row, log says Permission denied, status 126 | Script is not executable | chmod +x the script | Tested in the terminal |
Blank row, log says No such file or directory, status 127 | Wrong path in command | Fix the path, use an absolute one | Tested in the terminal |
Blank row, log shows completed with status 1 | Script exits with an error | Make it exit 0 | Tested in the terminal |
Blank row, your text appears after stderr: in the log | Script prints to stderr | Print to stdout | Tested in the terminal |
| Blank for several seconds, then it appears | Slow script | Cache slow commands | Tested in the terminal |
Settings Error at startup | Broken JSON in settings | Validate with jq . | Tested in the terminal |
| Blank row, nothing in the log | disableAllHooks is true | Remove it or set it to false | Tested in the terminal |
Shows null or -- | Field is empty before the first reply | Add a fallback like // 0 | Tested in the terminal |
| Blank until you accept a dialog | Folder not trusted | Accept the trust dialog | Docs, plus the dialog we saw |
| Disappeared on a work machine | Managed allowManagedHooksOnly policy | Ask your admin | From the official docs |
How the Claude Code Status Line Works
The status line is a row at the bottom of Claude Code that shows whatever a command of yours prints. You set it with a statusLine block in your user settings (~/.claude/settings.json) or in a project’s .claude/settings.json. If you have never set one up, our status line guide covers the basics.
Here is the setup we used for every test. The script reads the session JSON that Claude Code sends on stdin and prints one line.
{
"statusLine": {
"type": "command",
"command": "~/claude-code-demos/status-line-fix/.claude/statusline.sh"
}
}#!/bin/bash
# Read the JSON session data Claude Code sends on stdin
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
echo "[$MODEL] ${DIR##*/} | ${PCT}% context"When everything is right, the output appears in its own row just above the footer, as in the capture below.

According to the official docs, Claude Code shows the output only after the script exits with code 0. Anything else, including empty output, leaves the row blank. That one rule explains most of the problems in this guide.

A blank status line is not a display bug. It is Claude Code telling you the command didn’t finish cleanly.
First Step: Find Out Why the Status Line Is Not Showing
Before you change anything, collect two clues. They point straight at the cause in almost every case.
Run the script yourself with sample input
The docs suggest testing with mock input. Save a tiny JSON file, pipe it into the exact path from your settings and print the exit code:
echo '{"model":{"display_name":"Opus"},"workspace":{"current_dir":"/tmp/demo"},"context_window":{"used_percentage":25}}' > mock.json
cat mock.json | ~/.claude/statusline.sh; echo "exit code: $?"You want a line of text and exit code: 0. In our test the script was not executable, so we got Permission denied and code 126. After chmod +x, the same command printed the status line and exit code 0.

Read the debug log
If the script works by hand but the row is still empty, ask Claude Code itself. The docs say claude --debug logs your script’s stderr on every run and its exit code on the first run in a session. We used --debug-file, which writes the log to a file you choose:
claude --debug-file sl.log
grep StatusLine sl.logHere are the real log lines from four of our broken setups. Each one names its own cause.

Now match what you found to one of the fixes below. The decision ladder also shows the order we recommend.

Fix 1: The Script Is Not Executable
This is the most common cause. You saved a script but never marked it as a program, so the shell refuses to run it. Claude Code shows nothing at all, as in this capture.

The log line reads Permission denied and completed with status 126. The fix is one command:
chmod +x ~/.claude/statusline.shYou don’t need to restart. The docs say your edits show up the next time an update runs the script, such as after the next reply. You can also point the command at an interpreter instead, for example bash ~/.claude/statusline.sh, which works even without the executable bit.
Fix 2: The Path in settings.json Is Wrong
A typo in the file name, or a relative path that only works from one folder, gives a status of 127. Our log said No such file or directory after we pointed the setting at status-line.sh instead of statusline.sh.
- Copy the path from the
commandfield and runls -lon it to confirm the file exists. - Prefer a full path, such as
~/.claude/statusline.sh, over a relative one like./statusline.sh. - Status 127 is the shell’s “command not found” code, so an inline
commandthat calls a missing tool fails the same way. If you usejq, runcommand -v jqto check it is installed, because the docs note you may need to install it.
Windows paths
We tested on macOS; the Windows steps follow Anthropic’s official instructions. On Windows, Claude Code runs the command through Git Bash when it is installed, and Git Bash treats backslashes as escape characters. The docs say to write paths with forward slashes, like C:/Users/you/.claude/statusline.ps1, and to run PowerShell scripts with powershell -NoProfile -File.
Fix 3: The Script Exits With an Error
Your script can print the perfect line and still be hidden. We added exit 1 to the end of a working script, and the row went blank while the log showed completed with status 1.
Look for the last command in your script. If something like grep or git fails at the end, its exit code becomes the script’s exit code. Add exit 0 as the final line, or handle the failing command with || true.
Fix 4: Output Goes to stderr Instead of stdout
Claude Code only reads stdout. When we added >&2 to the echo line, the script still exited 0, but the row stayed blank. The text showed up in the debug log after stderr: instead.
Remove any >&2 from your output lines. In Python use print(), not sys.stderr.write(), and in Node use console.log(), not console.error().
Fix 5: A Slow Script Delays the Status Line
The docs say slow scripts block the status line from updating until they finish. To show it, we put a 10-second sleep at the top of our script, standing in for a slow git status on a large repo.

The docs add that if a new update starts while the old script is still running, Claude Code cancels the old one. A script that is always slower than your updates can look blank for a long time. Keep it fast and cache slow work, as the official docs show in their caching example.
Fix 6: Broken JSON in settings.json
A trailing comma or a missing quote breaks the whole file. Claude Code caught ours at startup with a Settings Error screen and the line and column of the problem.

Note the line that says files with errors are skipped entirely. If you choose to continue without these settings, your statusLine is ignored along with everything else in that file. Exit and fix the file, then check it with jq:

Remove the trailing commas and run jq . .claude/settings.json again until it prints the file cleanly. Our guide on settings.json problems covers other JSON mistakes, and settings file locations shows where each file lives.
Fix 7: The Folder Isn’t Trusted Yet
Because the status line runs a shell command, it follows the same workspace trust rule as hooks. The docs say it stays blank until you accept the trust dialog, and the debug log shows Status line command skipped: workspace trust not accepted.

Restart Claude Code in the folder and choose Yes, I trust this folder. If the dialog keeps coming back, our fix for the recurring trust prompt explains why.
Fix 8: disableAllHooks or a Managed Policy
This one is the hardest to spot because nothing shows in the log. We added this to the demo’s .claude/settings.local.json:
{
"disableAllHooks": true
}The status line vanished, and the debug log had no StatusLine lines at all.
The docs explain that when disableAllHooks is true outside managed settings, only a statusLine from managed settings can run. Remove the setting, or set it to false in the file that sets it. Search all your settings files, since it may sit in a different one than your statusLine.
On a work laptop, check one more thing. The docs say that if your organization sets allowManagedHooksOnly in managed settings, your custom status line disappears without warning. Only your administrator can change that.
Fix 9: The Status Line Shows null or —
Sometimes the row appears but shows empty values. The docs say some fields can be null before the first API response. We removed the // 0 fallback from our script to show what happens.

Add a fallback to every field that can be empty, such as .context_window.used_percentage // 0. The docs suggest restarting Claude Code if values stay empty after several messages.
Let Claude Diagnose It for You
The docs also suggest asking Claude to read your settings and run the command. We made the script non-executable again and sent one prompt:
My status line is blank. Read .claude/settings.json, run its statusLine command once with a tiny sample JSON on stdin, and tell me in 3 short lines why it fails. Don't change any files.Claude asked permission to run one Bash command, then found the cause in about eight seconds.

Try It Yourself
Practice in a throwaway folder so your real setup stays untouched. Create a project with a .claude/statusline.sh and a matching .claude/settings.json, then break it one way at a time.
- Run
chmod -x .claude/statusline.shand startclaude --debug-file sl.log. - Confirm the row is blank, exit, and run
grep StatusLine sl.log. - Fix it, then try a trailing comma in the settings file.
Or paste this prompt into a session in that folder:
Check why my status line is blank. Read the statusLine setting, test the command with sample JSON, show me the exit code and output, and suggest one fix. Don't edit anything yet.Common Mistakes
- Editing the script but not saving it as executable after copying it from another machine.
- Using
echo -ewith escape codes; the docs sayprintf '%b'is more reliable for links. - Putting the
statusLineblock inside another key, such as insidepermissions. - Testing the script from a different folder than the one in the
commandpath. - Forgetting that a crash in one settings file hides every setting in it.
Pro Tips
- Keep output short. The docs say to keep each line at least four columns narrower than the terminal, using the
COLUMNSvariable Claude Code passes in. - If text looks garbled, simplify to plain text first, then add colors back one at a time.
- Set
refreshIntervalonly if you need time-based data such as a clock. - Run
/doctorfor a broader health check; our doctor guide explains its output. - For a richer setup, see how to show context and cost in the same row.
Claude Code Status Line Fix Cheat Sheet

Frequently Asked Questions
Why is my Claude Code status line not showing after I set it up?
Most often the script is not executable, the path is wrong, or it exits with a code other than 0. Run the script by hand with sample JSON and check echo $?. If that works, check the trust dialog and the debug log.
Do I need to restart Claude Code after fixing the script?
Usually not. Claude Code reloads settings when you save them and runs the new script on the next update, such as a new reply. Restart if you changed trust or fixed a settings file that had a JSON error.
Does the status line use tokens?
No. The docs say the status line runs locally and does not consume API tokens. If you suspect it costs tokens, our post on status line tokens explains how to check.
Why does my status line hide sometimes?
The docs say it temporarily hides during certain screens, including the help menu and permission prompts. It returns when the screen closes.
Where can I find other Claude Code errors?
Our list of common Claude Code errors covers many more messages. For background on the assistant itself, see our Claude AI page.
Conclusion
A Claude Code status line that is not showing almost always comes down to one rule: the command must exit with code 0 and print to stdout. Test the script with sample JSON, read the exit code, and use --debug-file with grep StatusLine to see what Claude Code saw. Fix the permission, path, exit code or stderr problem it reveals, validate settings.json with jq, accept the trust dialog, and check for disableAllHooks when the log stays silent. The official troubleshooting section lists a few more edge cases, such as links that are not clickable.


