OmniscioGuidesStatus line examplesPowerShell on Windows
Claude Code status line on Windows with PowerShell
Windows has two ways for Claude Code to run a status line command, and which one you get depends on whether Git Bash is installed. This page gives the PowerShell script that works under either, the settings entry that survives both, and the one path mistake that fails with no message at all.
Checked against Claude Code 2.1.332 documentation, November 25, 2026. By the Omniscio team. Updated .
What it shows
One row: the folder name, the model in brackets, and the context percentage once the session has one to report.
my-app [Opus] ctx: 25%Before the session's first API response there is no percentage, and the script prints my-app [Opus] instead of a misleading zero. That fallback is the whole reason the script has an if.
The folder comes first in this script, where the Bash examples put the model first. That is the example's own ordering; nothing about the payload depends on it.
The full script
Save this as C:\Users\you\.claude\statusline.ps1. It is Anthropic's PowerShell status line example, reproduced whole.
$input_json = $input | Out-String | ConvertFrom-Json
$cwd = $input_json.cwd
$model = $input_json.model.display_name
$used = $input_json.context_window.used_percentage
$dirname = Split-Path $cwd -Leaf
if ($used) {
Write-Host "$dirname [$model] ctx: $used%"
} else {
Write-Host "$dirname [$model]"
}The first line takes everything Claude Code pipes in, turns it into a PowerShell object, and the three lines after it are field access. Split-Path -Leaf is what turns the full directory into the folder name.
The Windows example has no chmod step. What replaces it is the invocation in the settings entry below, which names powershell itself and passes the script to it with -File.
The settings entry
The entry goes in ~/.claude/settings.json, or in a project's .claude/settings.json — the same file the Bash pages in this set use, and the same file Claude Code reads on Windows. These are the statusLine keys alone: add them beside whatever the file already holds rather than pasting over it.
This is the entry that works whether Claude Code routes the command through Git Bash or through PowerShell:
{
"statusLine": {
"type": "command",
"command": "powershell -NoProfile -File C:/Users/you/.claude/statusline.ps1"
}
}The path is the whole trick. Write it with forward slashes, exactly as above. A backslash is an escape character to Git Bash, so C:\Users\you\.claude\statusline.ps1 arrives with its separators removed and the command fails before PowerShell ever sees it. Remember that the file on disk and the path in the command are two spellings of the same file: saving to C:\Users\you\.claude\statusline.ps1 and writing C:/Users/you/.claude/statusline.ps1 in the command is correct, not a mismatch.
If your Windows user name contains a space, the path has to be quoted inside the command, and those quotes escaped for JSON: -File \"C:/Users/John Smith/.claude/statusline.ps1\". An unquoted path with a space is split into two arguments and fails the same silent way as a backslash.
The ~ shorthand also works and expands to your Windows home directory, so ~/.claude/statusline.ps1 is a shorter way to write the same path.
If Git Bash is installed and you would rather have a Bash status line, the same documentation carries the Bash setup and a short statusline.sh written for Windows.
What each field means
One JSON object arrives on stdin, and this script reads three fields from it. The table finishes with the Windows-specific detail that decides whether you see any of them at all.
| Field | What it holds |
|---|---|
cwd | The current working directory, which is what this script uses. It carries the same value as workspace.current_dir, the name Claude Code prefers elsewhere; either works, and the example here takes the shorter one |
model.display_name | The model's display name, which is what the row shows in brackets |
context_window.used_percentage | A percentage Claude Code has already calculated from input tokens only. It may be null early in a session, and the if ($used) test is what makes the script drop the segment rather than print an empty one |
COLUMNS, LINES | Not JSON: environment variables holding the terminal's width and height, refreshed before each run, because the script is not connected to the terminal and cannot ask it |
| the routing itself | Claude Code runs the command through Git Bash when Git Bash is installed, and through PowerShell when it is not — which is why the path style matters more than the script language |
One thing Windows does not change: COLUMNS and LINES are still the only honest way to size a row. A call that asks the terminal directly, such as stty size, can fail because your script is not connected to the terminal.
The rest of the payload — cost, rate limits, the pull request, the worktree — belongs to the same schema, documented field by field, and is listed in the examples library.
How to confirm it renders
Do the three checks in this order, because each one rules out a different layer.
First the file: does the .ps1 exist at the exact path in command, with forward slashes, and no stray space in the middle of the argument list? A path that is one character off fails the same silent way as a backslash.
Second the script on its own, before the settings entry is in the way — Anthropic's advice is to test it independently with mock input. Its worked example pipes a JSON string into the Bash script; the equivalent for a .ps1 is to feed that same JSON to your script yourself and read what it prints. What the documentation does not spell out for Windows is the command, so the reliable check is the next one.
Third the row. claude --debug logs the script's stderr on every invocation and its exit code on the first invocation in a session, so you can tell a script that never ran from one that ran and failed. If it never ran, the setting is the problem.
And remember the trust rule: on any platform the row stays blank until you accept the workspace trust dialog for the folder. claude --debug says so in as many words.
The common failure
The commonest Windows status line failure is the backslash, and it is worth understanding why it is so hard to find. When Git Bash is installed Claude Code runs the command through it, and Git Bash reads an unquoted backslash as an escape character, so the path in your settings loses its separators on the way to the script runner. Nothing prints an error. The row is simply blank, exactly as it would be if you had never configured it.
The fix is to write the path the way the documentation does: forward slashes, or ~ at the front.
The second failure is the assumption that a PowerShell script needs Git Bash to run. It does not. Invoking powershell yourself works whether Claude Code routes through Git Bash or through PowerShell — which is why this one settings entry is enough on a machine with or without Git.
| What you see | Check |
|---|---|
| A blank row and no error at all | First the backslash in command, if Git Bash is installed. Rewrite the path with forward slashes, then work the rest of the blank-row checks |
| Still blank with forward slashes | claude --debug for the script's stderr and exit code: the script ran and failed, or it never ran — and if it never ran, check the workspace trust dialog for this folder |
| The folder and model show, the percentage does not | used_percentage may be null early in a session; the else branch is doing its job |
You edited the .ps1 and nothing changed | The script runs at session start and then on events — a new assistant message, a finished /compact, a mode change. An edit to the script waits for the next one; a change to the command in settings runs immediately |
The other scripts in this set
Each one is a complete script and settings entry, not a fragment.
- Model, folder and git branch — plus staged and modified file counts
- A context usage bar — how much of the window is spent, as blocks
- Cost so far — the session's estimated spend and elapsed time
- Two rows — branch on the first, bar, cost and time on the second
- The status line itself — the setting, the payload, and why a row is blank
Where Omniscio fits
The status line is Claude Code's own, and nothing on this page needs Omniscio. Omniscio is a desktop app for running several Claude Code agents side by side, in one list rather than a wall of terminals — which on Windows saves you the window management as well.
Its agent sessions run Claude Code in print mode, so they show Omniscio's session list rather than a terminal row, while a status line you configure still applies to any claude you run yourself in a terminal.
The features page lists what the app does today.
How this page was checked
Every statement here about Claude Code comes from Anthropic's own documentation, read in its Markdown form on November 25, 2026: the status line page, its Windows configuration section, the settings reference and the changelog. The version line comes from the changelog, whose newest release is 2.1.332, dated November 25, 2026.
The script is Anthropic's PowerShell example reproduced in full. It was not written for this page and not run on a Windows machine here; where the page says what it prints, it is following the example's own branches.
What this page says about Omniscio comes from our own pages. If Anthropic's page and this one ever disagree about Claude Code, Anthropic's page is right, because this part of Claude Code changes on nearly every release.
Sources
- Customize your status line: the Windows configuration section with the PowerShell script and its settings entry, the full JSON and every field, the size variables, the mock-input tip and the troubleshooting section
- Settings reference: the
statusLineentry, its fields and its defaults - The changelog: release 2.1.332, the newest listed
Omniscio's own pages, for what this section says about this app:
- Omniscio's homepage: the product description
- Features: what the app does today
- Claude Code status line: the setting and the payload this page assumes
Common questions
Why is my Claude Code status line blank on Windows?
The first thing to check is the path in the command. When Git Bash is installed, Claude Code runs the command through it, and Git Bash treats an unquoted backslash as an escape character, so C:\Users\you\statusline.ps1 reaches the runner with its separators removed and the command fails without a visible error. Write the path with forward slashes instead.
Do I need Git Bash to use a status line on Windows?
No. Claude Code uses Git Bash when it is installed and PowerShell when it is not. A PowerShell script invoked as powershell -NoProfile -File works whether Claude Code routes the command through Git Bash or through PowerShell.
Can I run a Bash status line script on Windows?
Yes, when Git Bash is installed: Anthropic's status line page carries a statusline.sh written for Windows and the settings entry that runs it, and the git branch page in this set is a longer Bash script to start from. What you cannot do is write a Windows path into the command with backslashes.
Why does my PowerShell row show the folder and model but no percentage?
The script prints the context percentage only when it has one. context_window.used_percentage may be null early in a session, and the else branch then prints the folder and the model alone rather than a zero.
Run the sessions behind those status lines, from one window
Install Omniscio, keep your Claude Code sessions in one list, and see what each one needs without hunting through terminals. The features page lists what is in it today.