ccstatusline AGENTS.md

A set of project instructions for ccstatusline, a command-line tool that formats Claude Code status information such as the model, Git branch, and token usage. It also includes an interactive text-based configuration screen.

In plain words
What is it for?
Use it when developing, testing, linting, building, or running ccstatusline interactively or as a processor for Claude Code status data.
Why use it?
It records the correct installation, development, testing, linting, and build commands, while explaining that the project runs with both Bun and Node.js.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/sirmalloc/ccstatusline/agents-md
Clone the repo
git clone --depth 1 https://github.com/sirmalloc/ccstatusline

Made for: Codex, OpenCode.

Per session 1,822 This file is loaded in full into every session.
When invoked 1,822 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01822 $0.01822
Opus 5 $0.00911 $0.00911
Sonnet 5 $0.00364 $0.00364
Haiku 4.5 $0.00182 $0.00182

Measured 2d ago against content hash ca81207df019, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ccstatusline AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Git integration**: Uses child_process.execSync to get current branch and changes
AGENTS.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

ccstatusline is a customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics. It functions as both:

  1. A piped command processor for Claude Code status lines
  2. An interactive TUI configuration tool when run without input

Development Commands

# Install dependencies
bun install

# Run in interactive TUI mode
bun run start

# Test with piped input (use [1m] suffix for 1M context models)
echo '{"model":{"id":"claude-sonnet-4-5-20250929[1m]"},"transcript_path":"test.jsonl"}' | bun run src/ccstatusline.ts

# Or use example payload
bun run example

# Build for npm distribution
bun run build   # Creates dist/ccstatusline.js with Node.js 14+ compatibility

# Run tests
bun test

# Run tests in watch mode
bun test --watch

# Lint and type check
bun run lint      # Runs TypeScript type checking and ESLint without modifying files

# Apply ESLint auto-fixes intentionally
bun run lint:fix

Architecture

The project has dual runtime compatibility - works with both Bun and Node.js:

Core Structure

  • src/ccstatusline.ts: Main entry point that detects piped vs interactive mode
    • Piped mode: Parses JSON from stdin and renders formatted status line
    • Interactive mode: Launches React/Ink TUI for configuration

TUI Components (src/tui/)

  • index.tsx: Main TUI entry point that handles React/Ink initialization
  • App.tsx: Root component managing navigation and state
  • components/: Modular UI components for different configuration screens
    • MainMenu, LineSelector, ItemsEditor, ColorMenu, GlobalOverridesMenu
    • PowerlineSetup, TerminalOptionsMenu, StatusLinePreview

Utilities (src/utils/)

  • config.ts: Settings management
    • Loads from ~/.config/ccstatusline/settings.json
    • Handles migration from old settings format
    • Default configuration if no settings exist
  • renderer.ts: Core rendering logic for status lines
    • Handles terminal width detection and truncation
    • Applies colors, padding, and separators
    • Manages flex separator expansion
  • powerline.ts: Powerline font detection and installation
  • claude-settings.ts: Integration with Claude Code settings.json
    • Respects CLAUDE_CONFIG_DIR environment variable with fallback to ~/.claude
    • Provides installation command constants (NPM, BUNX, self-managed)
    • Detects installation status and manages settings.json updates
    • Validates config directory paths with proper error handling
  • colors.ts: Color definitions and ANSI code mapping
  • model-context.ts: Model-to-context-window mapping
    • Maps model IDs to their context window sizes based on [1m] suffix
    • Sonnet 4.5 WITH [1m] suffix: 1M tokens (800k usable at 80%) - requires long context beta access
    • Sonnet 4.5 WITHOUT [1m] suffix: 200k tokens (160k usable at 80%)
    • Legacy models: 200k tokens (160k usable at 80%)

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 152 lines · 1,822 tokens per session scan A ca81207df019

Subscribe to this mod's changes

ccstatusline AGENTS.md is an instructions file published in the GitHub repository sirmalloc/ccstatusline (12,669 stars, last pushed 6d ago), licensed MIT. It adds 1,822 tokens to every session, about $0.0091 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.