Skip to main content

agent-statusline

CI PyPI Python 3.11+ License: MIT No dependencies

A dense, local-first status line for Claude Code. See the project, model, context, usage, cost, tools, cache, tokens, timing, and machine pressure of the session you are in—without telemetry, runtime network calls, or third-party packages.

PROJECT acme-web/services │ feature/ingest* ↑2 stash1 │ "Rewrite the importer"
MODEL   Opus 5:high │ think │ fast off │ auto │ v2.1.246
CONTEXT ctx[██░░░░░░░░]  19% 189k/1M │ session 25.7M in · 311k out · 107k thinking · 189 api turns · avg 136k/1.65k per turn
USAGE   5h [███░░░░░░░] 26% @19.7%/h ▸ 98% (reset Wed 19:30 | 3h40m) │ 7d [█████░░░░░] 50% @0.3%/h ▸ 50% (reset Wed 17:00 | 1h10m)
COST    ~$2.10 session │ 24h ~$9.40 · 7d ~$31.20 · 30d ~$88.60 │ last5 ~$27.50 · all ~$142.30 (5 convos · 6 sess · 1 fork) │ +174/-12 lines │ credits on
SYSTEM  this session 540M · 5 proc · pid 4821 │ all claude 512M · 1 proc · 1.6% of ram │ ram[█████░░░] 62% of 32.0G · 4.2G compressed │ disk[████░░░░] 48% · 210G free
TOOLS   101 calls │ Bash81 Edit12 Read8 │ 2 tool errors │ 6 files edited · 14 read │ 0 subagents │ 0 compactions
CACHE   97.9% hit │ 1h ttl ▸ expires 16:49 │ 0.12x vs all-uncached │ writes 504k 1h · 0 5m
TOKENS  total 23.8M reused · 504k written · 366 uncached │ turn 184k reused · 5.2k written · 2 uncached
TIMING  turn 12m last · 4m median · 12m max (3 timed) │ wall 1h11m · api 19m (27% busy) │ hooks 3 runs · 133ms median · 0 errors

Rows reflow deterministically as the terminal changes width. Each may wrap once; only then are lower-priority details removed with an … marker. No physical output line exceeds the detected terminal width.

Install

The recommended installation keeps this frequently invoked command isolated:

uv tool install agent-statusline
agent-statusline install

Restart Claude Code after installation. To preview the configuration changes first, run agent-statusline install --dry-run.

The package is a standard Python distribution. These install the same command with other package managers:

pipx install agent-statusline
python -m pip install agent-statusline

pipx isolates the command like uv tool; pip installs it into the active Python environment.

Requirements: Python 3.11 or newer, Claude Code, and macOS or Linux. Git is optional and enriches the PROJECT row. The SYSTEM row reads native memory pressure from macOS or Linux; under WSL it reports the memory available to the Linux environment rather than the Windows host's full physical capacity.

What it tracks

  • PROJECT and MODEL: location, Git state, task, model, effort, mode, and host version.
  • CONTEXT and USAGE: context consumption, session tokens, API turns, and rate-limit windows.
  • COST: current, rolling, recent, and lifetime spend plus session counts and line changes.
  • SYSTEM and TOOLS: process, memory, disk, tool, file, subagent, and compaction activity.
  • CACHE, TOKENS, and TIMING: cache efficiency, token flow, turn time, wall time, and hooks.

v0.5.8 uses Claude Code's native cache lifetime state when available (Claude Code v2.1.251+). Older clients retain a clearly labelled estimate. Five-minute TTL is supported normally; expiry does not guarantee a full miss. The existing CACHE field selectors apply to both sources. See the cache field reference.

The field reference documents every value and its source.

Local and private by design

  • Rendering uses local Claude Code payloads, transcripts, and machine state. It sends no telemetry and has no cloud fallback.
  • Runtime state stays under ~/.claude/, outside the repository. Package-owned state is privately permissioned and locked, using atomic replacement or durable append as appropriate.
  • Cost amounts prefixed with ~$ come from Claude Code’s cost estimates. A rolling amount prefixed with ≥~$ includes only the estimates attributable to that window.
  • Installation backs up settings.json, preserves unrelated settings and hooks, and refuses to replace configuration it cannot prove it owns.
  • agent-statusline selftest uses isolated synthetic state and never touches the live cost ledger.

The last-payload and per-session metrics files can contain sensitive paths, titles, costs, identifiers, and commands. Do not publish or attach files from the status-line state directory.

Commands

Command Purpose
agent-statusline install Wire the command and managed hooks into Claude Code
agent-statusline install --dry-run Preview installation without writing anything
agent-statusline selftest Render all ten rows from isolated synthetic data
agent-statusline metrics <session-id> Print the documented local snapshot for one session
agent-statusline config check Validate the optional TOML file without rendering or changing state
agent-statusline config fields [ROW] List field IDs and descriptions for all rows or one row
agent-statusline config show Show effective settings and the source of each value
agent-statusline config example Print a commented starter config that preserves defaults as written
agent-statusline config preview [--width CELLS] Preview a synthetic session with effective display settings
agent-statusline ledger show Inspect the local cost ledger
agent-statusline uninstall Remove only configuration owned by this installation
agent-statusline --version Print the installed version

The managed context guard warns after a turn when context reaches 80% by default. Configure it in the environment that launches Claude Code:

Variable Values
AGENT_STATUSLINE_CONTEXT_WARN_PCT warning threshold from 1 through 100
AGENT_STATUSLINE_CONTEXT_WARN_EVENT stop (default), submit, or both
AGENT_STATUSLINE_CONTEXT_WARN_MESSAGE custom non-empty message containing {pct}

Run agent-statusline selftest after changing these values. Stop warnings are user-visible only; submit and both allow the configured advice to enter the next model turn.

Configure the view

Check agent-statusline --version before using the examples below. This guide covers the latest GitHub release. An install from PyPI follows the versions published on that index.

Since Configuration support
0.5.0 Optional TOML, row visibility, plain output, and config check
0.5.1 Field group selection
0.5.3 config fields [ROW]
0.5.4 config show
0.5.5 config example
0.5.6 config preview [--width CELLS]

Create ~/.config/agent-statusline/config.toml (or use the same relative path under an absolute XDG_CONFIG_HOME). The file is optional. Use agent-statusline config example to print a starter file. Save it and uncomment the settings you want to change. A configured view can look like this.

schema_version = 1

[display]
color = "plain"

[display.rows]
CACHE = "hide"

[display.fields]
PROJECT = ["directory", "branch", "session_name"]

Rows accept "show" or "hide". Omitted rows keep their default visibility and visible rows keep their original order. Hiding a row does not stop data collection or cost accounting. Omit color or use "default" for styled output. Field lists select existing groups within a visible row. Omitted lists keep all fields, and a list never changes their priority. Run agent-statusline config fields PROJECT to list IDs for one row, or see the field IDs. The file also accepts [context_guard] with warn_pct, warn_event, and warn_message, and [session_metrics] with enabled = false to stop new snapshots. Existing environment overrides take precedence over file values. Run agent-statusline config check to validate the file. An invalid file is ignored as a whole during normal operation. Run agent-statusline config show to see the effective settings, environment overrides, and whether fallback occurred. Custom warning text is redacted. See the configuration decisions.

Run agent-statusline config preview --width 80 to try the configured view at 80 columns. Omit --width to use the detected terminal width. The sample includes every selectable field group and uses synthetic figures and session details throughout.

Finer per-value controls, an interactive editor, optional layouts and managed timed refresh are planned; they are not commands or settings in this release. The roadmap and design keep one config location and collection independent of visibility. Current group selection cannot individually hide 24h within the COST.rolling group.

If the status line does not appear, run agent-statusline selftest first, then restart Claude Code. Unexpected renderer failures leave only their time and exception type in ~/.claude/statusline-last-error.json.

Update or remove

uv tool upgrade agent-statusline
agent-statusline install

Re-running install refreshes the managed Claude Code wiring while preserving unrelated configuration.

If your 0.4.x tool uses Python 3.9 or 3.10, install 0.5.x using Python 3.11 or later (for example, uv tool install --python 3.11 --force agent-statusline) before refreshing the managed hooks. Stay on 0.4.x if you need the older Python versions.

For a checkout-managed install, uninstall with the original checkout and Python executable before switching interpreters. Then reinstall from the updated checkout with Python 3.11+. This keeps the installer able to identify the settings it owns.

agent-statusline uninstall
uv tool uninstall agent-statusline

Uninstalling leaves the local ledger and history in ~/.claude/ intact.

Develop from a checkout

git clone https://github.com/nachiketbhujbal/agent-statusline.git
cd agent-statusline
uv sync --locked --all-groups
uv run --locked python scripts/verify_docs.py
uv run --locked pre-commit run --all-files
uv run --locked pytest --cov=agent_statusline --cov-report=term-missing
uv build

Run python3 install.py to wire a development checkout into Claude Code through a symlink; working-tree edits then become live without reinstalling. Tests use synthetic inputs and must never read the real ~/.claude state.

Contributor-facing details live in the implementation guide and host-porting boundary.

License

MIT. This independent project is not affiliated with or endorsed by Anthropic.

Metadata

Release files for agent-statusline 0.5.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-statusline 0.5.10
File Size Uploaded Provenance Actions
agent_statusline-0.5.10.tar.gz 296.4 kB With provenance Details for agent_statusline-0.5.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-statusline 0.5.10
File Interpreter ABI Platform Actions
agent_statusline-0.5.10-py3-none-any.whl Python 3 none any Details for agent_statusline-0.5.10-py3-none-any.whl

Total release size: 368.2 kB

Release files / agent_statusline-0.5.10.tar.gz

Download URL agent_statusline-0.5.10.tar.gz
Size 296.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2da392af1da3eccac4793f2b07b864d5b84adf05f07055e566907584b0fc7229
BLAKE2b-256 checksum
How to use checksums
63c7ec79a18a98bdbcdc37392860622302c3681623dc6600f2f9825d6de1e7c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / agent_statusline-0.5.10-py3-none-any.whl

Download URL agent_statusline-0.5.10-py3-none-any.whl
Size 71.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39182de85bbfd2dd0243364c2c777f0ed72288fa8afb18308fbd347088afc715
BLAKE2b-256 checksum
How to use checksums
fe742e18a2e618b963a8482f93c773a7353aae14f05e23015a672beaf31810aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for agent-statusline 0.5.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_statusline-0.5.10.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page