Skip to content

About

Two-row powerline status line for omp (oh-my-pi): model, thinking level, git and PR chips plus context, usage-limit and prompt-cache gauges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

omp-statusline

A two-row powerline status line for omp (oh-my-pi), with the same colors and layout as claude-code-statusline and codex-statusline. The top row shows the model, thinking level, repository, git and PR state. The bottom row shows color-graded gauges for the context window and your plan's usage limits.

It runs inside omp as an extension and draws below the prompt. There is no wrapper, tmux session, or polling script: the numbers come from the running session itself.

Demo in a dark terminal

한국어

What it shows

Row 1: chips joined by powerline arrows, then session stats.

Chip Content Color
Model Opus 5.5 (the Claude prefix is dropped), GPT-5.5, … purple Opus and GPT, cyan Sonnet, teal Haiku, orange Fable, silver others
Effort the thinking level: max, xhigh, high, medium, low, minimal, plus fast while fast mode applies (a priority service tier that Anthropic has not refused) red, orange, yellow, teal, slate
Directory repository name, the path below the checkout root, and a linked worktree's name when it differs from the branch blue
Git branch, ⇡ ahead, ⇣ behind, ✘ conflicts, + staged, ~ modified, ? untracked green when clean, yellow when dirty, red on conflicts
PR / MR #512 from gh on GitHub, !512 from glab on GitLab; Cmd/Ctrl+click opens it teal approved, red changes requested, cyan pending, slate draft

After the chips come the session cost, the time since the session started, lines added and removed, and the prompt cache:

  • Cost is omp's recorded session cost, including finished subagents. It is hidden at zero.
  • Lines are the repository's staged and unstaged changes against HEAD (git diff HEAD --shortstat; untracked files are not counted).
  • Cache counts down to the prompt cache's expiry when the model has a known cache lifetime (Claude): 1 hour on a Claude subscription login, 5 minutes with an API key, as omp writes it (PI_CACHE_RETENTION overrides both, and the TTL the response reports wins). omp's cache warmer restarts the countdown when it refreshes the cache. For models without a known lifetime it shows the last request's cache hit rate instead (cache hit 87%).

Row 2: gauges.

  • ctx: context window used, with the token count (283k/1M). The count turns yellow past 200k tokens.
  • 5h / 7d: plan usage limits with the time until each resets (↻1h12m). They come from omp's usage reports, the same data /usage shows, so they work for every provider omp reads limits for (Claude and ChatGPT subscriptions among them). With several accounts for one provider, the account this session uses is shown. Windows a provider does not report are left out.
  • Fable: a weekly limit that applies to one model tier, when your plan has one.
  • ⚠~45m: at the window's average pace so far, the limit runs out in about 45 minutes, before it resets.
  • Bars are shaded cell by cell from green to red. Percentages turn yellow at 50%, orange at 65%, and red at 80%.

On narrow terminals the bars shrink first. Then the cache, lines, duration, cost, PR and effort drop out, and finally the directory and branch are shortened.

omp's own status bar

The extension trims omp's built-in status bar to the parts it does not show itself: the vim mode, the plan/goal/loop/vibe mode, collab and stream badges, and the session name. The mode and badges appear only while active. The change lives in omp's in-memory settings layer for the running process; your config.yml is not touched. Set OMP_STATUSLINE_NATIVE=keep to leave the built-in bar as you configured it.

──────────────────────────────────────────────────────────────── session name ─
❯ your prompt
────────────────────────────────────────────────────────────────────────────────
 Opus 5.5  high  my-app   main ?1   $0.06 · 4m · cache 59m          ← row 1
ctx ▆▆▆▆▆▆▆▆▆▆ 2% 22k/1M │ 5h ▆▆▆▆▆▆▆▆ 11% ↻2h9m │ 7d ▆▆▆▆▆▆▆▆ 73% ↻20h  ← row 2
 Plan                                                          ← omp, when active

Subagents

omp lists subagents with their own model, context and progress in the Agent Hub and the pinned agent list above the prompt, so this status line follows the main session only. When you focus a subagent it keeps showing the main session: omp does not tell extensions which session is in view.

Install

Requirements: omp (tested with 18.8.4) and the Bun it runs on, bash, and git (optional). gh or glab adds the PR/MR chip.

git clone https://github.com/m16khb-org/omp-statusline.git
cd omp-statusline
./install.sh           # or ./install.sh --plain when your font has no powerline glyphs

The installer copies index.ts and render.ts to ~/.omp/agent/extensions/omp-statusline/, where omp discovers extensions ($PI_CODING_AGENT_DIR/extensions when that is set; pass --agent-dir DIR for a profile, such as ~/.omp/profiles/work/agent). Nothing else is changed. Restart omp to load it.

To update, run git pull && ./install.sh and restart omp. To remove it, run ./uninstall.sh; omp's default status bar is back on the next start. Neither script touches a directory it did not create.

Preview every state without starting omp:

bun ~/.omp/agent/extensions/omp-statusline/render.ts --demo

Fonts, colors and themes

  • Powerline glyphs (U+E0A0, U+E0B0, U+E0B1) need a Nerd Font or a terminal that draws them itself. If they show up as boxes, reinstall with ./install.sh --plain, which turns the chips into separate badges:

    Plain glyph mode

  • Colors: 24-bit when COLORTERM is truecolor or 24bit, otherwise the nearest 256-color values.

  • Theme: Tokyo Night on dark backgrounds and Tokyo Night Day on light ones. It follows the light or dark appearance of omp's active theme, which omp picks from the terminal's background color, and switches with it.

Demo in a light terminal

Settings

Set these in the environment omp starts in, for example STATUSLINE_THEME=light omp.

Variable Values Default
STATUSLINE_THEME dark, light the appearance of omp's active theme
STATUSLINE_GLYPHS powerline, plain powerline, or plain after ./install.sh --plain
STATUSLINE_COLORS truecolor, 256 from COLORTERM
OMP_STATUSLINE_NATIVE keep trim omp's built-in status bar

Speed

Drawing the rows takes about 0.02 ms and never waits on anything; while nothing changes, omp gets the same rows back and skips the repaint. A one-second tick picks up what omp sends no event for (model, thinking level, service tier, countdowns). Everything else is read when it can have changed:

  • Context usage after each message, request and compaction, not on every tick.
  • git status and git diff, run together in the background, after tool calls, ! shell commands and each run (at most every 2 seconds), and otherwise every 30 seconds for edits made outside omp.
  • gh pr view / glab mr view when the branch changes and after each run (at most every 15 seconds), otherwise every 5 minutes.
  • Usage reports after each run (at most once a minute), otherwise every 5 minutes, through omp's own usage service, which caches them and shares them with /usage.

A slow repository or network never delays the prompt.

Development

bun install          # TypeScript and Bun types, for the type check only
bun test             # rendering, session data, git, install.sh and uninstall.sh
bunx tsc --noEmit    # type check
bun render.ts --demo

render.ts is pure: it turns a StatusData snapshot into rows, so the rendering tests need no omp. The extension tests drive index.ts with a fake omp API, and the git tests use throwaway repositories. The screenshots are rendered from the --demo output with tools/render_png.py, which needs Pillow and a monospace font:

COLORTERM=truecolor COLUMNS=110 bun render.ts --demo | python3 tools/render_png.py docs/demo-dark.png --font D2Coding.ttc --bold-index 1

License

MIT. render.ts and tools/render_png.py are adapted from m16khb-org/claude-code-statusline.

About

Two-row powerline status line for omp (oh-my-pi): model, thinking level, git and PR chips plus context, usage-limit and prompt-cache gauges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages