OmniscioGuidesStatus line examplesOne inline command
Claude Code status line as one inline command
This is Anthropic's minimal inline example, and the one to reach for when you want one short row. Under the settings object is what each piece of the command does, why the quoting looks the way it does, and the point where a one-liner stops being the right tool.
Checked on November 26, 2026 against the Claude Code 2.1.332 documentation. By the Omniscio team. Updated .
What it shows
One short row: the model in brackets and the percentage of the context window used.
[Opus] 25% contextEarly in a session, before the first API response, the percentage field can be null. The command's fallback prints zero rather than the word null, so the row still reads as a row.
The whole settings entry
This is the complete object, as the documentation prints it. Add it to ~/.claude/settings.json or to a project's settings file.
{
"statusLine": {
"type": "command",
"command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'"
}
}The command field runs in a shell, which is the whole reason this works without a file. Claude Code hands the command the session JSON on standard input, jq formats one string from it, and whatever prints becomes the row.
Add the object beside whatever else the file holds, inside the same braces; it is not a whole file to paste over. Claude Code reloads settings and runs the command as soon as you save it.
Two optional fields are worth knowing even here. padding adds horizontal spacing in characters. refreshInterval re-runs the command every N seconds (the minimum is one second) on top of the updates Claude Code already triggers.
What each part does
Read the command from the inside out. jq -r parses the JSON on stdin and prints a raw string, without the quotes jq adds by default. The program between the single quotes builds one line from two fields.
| Piece | What it does |
|---|---|
jq -r | Runs the JSON parser and prints its result as raw text, which is what the status line displays |
\" ... \" | A jq string, whose double quotes are escaped because the whole command is itself a JSON string |
\(.model.display_name) | Interpolates the model's display name, the text in brackets |
\(.context_window.used_percentage // 0) | Interpolates the percentage, or zero when the field is null |
| The single quotes | Protect the program from the shell once the JSON layer has been read |
The // 0 is the one piece people remove and then wonder why the row says null. It is jq's fallback operator: a null or missing value on its left becomes the value on its right. Anthropic's jq context and cost examples use the same // 0 fallback; its rate-limit examples use // empty instead.
The quoting is two layers, and that is unavoidable. The outer layer is JSON, which needs \" for a literal double quote. The inner layer is the shell, which needs the single quotes so it does not consume the jq string's double quotes or interpret the parentheses.
How to test it before you trust it
The command is ordinary shell, so you can run it yourself with mock JSON. This is the same program without the JSON escaping:
echo '{"model":{"display_name":"Opus"},"context_window":{"used_percentage":25}}' | jq -r '"[\(.model.display_name)] \(.context_window.used_percentage // 0)% context"'It should print [Opus] 25% context. Run the same line with the percentage set to null and it should print [Opus] 0% context. If both work, the program is right and any remaining problem is in the settings file or the shell Claude Code uses.
If jq --version fails, install it: the documented Bash examples call jq, a command-line JSON parser you may need to install from jqlang.org. The example needs jq installed, so a machine without it produces nothing.
Inside Claude Code, claude --debug logs the command's stderr on every invocation and its exit code on the first invocation in a session. A shell or jq error is written to stderr, so it can show up there.
Where the one-liner stops working
The inline form is the right tool for one field or two. It stops being right as soon as the command needs a branch, a cache, colours or a second row, and the reasons are mechanical rather than stylistic.
| You need | Why the one-liner stops paying |
|---|---|
| Git branch or file counts | The command has to run git and handle the case where there is no repository. That is a branch in the shell, which a settings string cannot hold cleanly |
| Two rows | Each print is a separate row, so it is possible, but the command grows past what anyone can read inside escaped quotes |
| A cache | Caching needs a file name, a staleness test and a write, which is a script by any reasonable measure |
| Windows | The command runs through Git Bash when it is installed and PowerShell when it is not. Backslashes do not survive that trip |
Wherever a command names a path on Windows, write it with forward slashes; Git Bash treats an unquoted backslash as an escape character, so a Windows-style path reaches the script runner with its separators removed and the command fails, with the failure visible only in debug output. The cleanest answer for anything that needs more than a couple of fields is a script file, where the quoting lives in the file rather than in two nested strings.
The examples library has the script versions of every row this one-liner can only approximate.
Why the inline row stays blank
| What you see | Check |
|---|---|
| No row at all | The workspace trust dialog has been accepted for the folder, and claude --debug shows the command's exit code. The output only appears after a zero exit |
| A jq syntax error in debug | The quoting. Compare the settings value byte for byte with the documented object above |
jq: command not found | Install jq and confirm jq --version in the same shell Claude Code uses |
| The percentage prints as a word | The // 0 fallback is missing; without it a null field prints as the word null |
| It works in one terminal and not another | Claude Code and your shell are resolving jq differently, or Windows is routing the command through PowerShell |
More in this set
Each page carries a complete setup, not a fragment.
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.
Its agent sessions run Claude Code in print mode, so they show Omniscio's session list rather than a terminal row. 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 Claude Code fact on this page is checked against Anthropic's own documentation, read in its Markdown form on November 26, 2026: the status line page, 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 advice on when to switch to a script is this page's own.
The settings object and its command are Anthropic's documented inline example, reproduced exactly. The shell test on this page is the same jq program written for an interactive shell, where the JSON escaping is not needed.
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.
Sources
- Customize your status line: the setting and its optional fields, the inline jq example, the full JSON, the Windows notes and the troubleshooting section
- Settings reference: the
statusLineentry and its fields - The changelog: release 2.1.332, the newest listed
- jq: the JSON parser the command calls
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
Can a Claude Code status line run without a script file?
Yes. The command field runs in a shell, so it can hold an inline command instead of a script path. Anthropic's documented example uses jq to print the model name and context percentage from the session JSON on stdin.
Why are there backslashes around the quotes in the settings value?
The jq program is a string inside a JSON file, so its own double quotes have to be escaped as \" for the JSON parser. The single quotes around the program are what protect it from the shell once the JSON is read. Both layers matter, which is why the line looks busier than the command you would type at a prompt.
What does the // 0 do in the inline command?
It is jq's fallback: a null field on its left becomes the value on its right, so the row prints 0 instead of the word null. The rate-limit examples take the other route, // empty, which prints nothing and lets the script skip that segment.
Can an inline status line show more than one row?
It can, because each line the command prints is a separate row, but an inline command becomes hard to read and quote as it grows. Anthropic's multi-line and git examples are written as script files; only the short model and context example is inline.
Run those Claude Code sessions 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.