Skip to main content
Home

Built and signed on GitHub Actions

A TypeScript/Deno-based status line for Claude Code that displays project information, git branch, model details, and session time remaining.

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
3 months ago (0.2.0)

Claude Code Status Line

A TypeScript/Deno-based status line for Claude Code that displays project information, git branch, model details, session cost, and context token usage.

Features

  • 🤖 Model Display: Shows the current Claude model being used
  • 📁 Project Info: Displays project name and current directory
  • 🌿 Git Integration: Shows current git branch when in a repository
  • 💰 Session Cost: Displays current session cost in selected currency
  • 📈 Context Usage: Shows context token percentage
  • 🎨 Clean Icons: Uses emojis for visual clarity

Installation

Add this to your .claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "deno run --allow-net --allow-env --allow-read --allow-write --allow-run --allow-sys jsr:@wyattjoh/claude-status-line@0.2.0"
  }
}

Customization

You can customize the currency used for session cost display by adding the --currency flag:

{
  "statusLine": {
    "type": "command",
    "command": "deno run --allow-net --allow-env --allow-read --allow-write --allow-run --allow-sys jsr:@wyattjoh/claude-status-line@0.2.0 --currency USD"
  }
}

Supported currencies include: USD, EUR, GBP, JPY, AUD, and many others. Defaults to CAD.

Development

Prerequisites

  • Deno 1.40+
  • Access to Claude Code configuration files

Available Tasks

deno check  # Type checking
deno fmt    # Format code
deno lint   # Lint code

How It Works

The status line receives Claude Code context as JSON through stdin:

interface ClaudeContext {
  session_id: string;
  transcript_path: string;
  model: {
    id: string;
    display_name: string;
  };
  workspace: {
    current_dir: string;
    project_dir: string;
  };
}

It then builds a status line showing:

  • Project name (if different from current directory)
  • Model name with robot emoji
  • Session cost in desired currency (fetched from ccusage)
  • Context token usage percentage
  • Current directory with folder emoji
  • Git branch with branch emoji

Usage Tracking

The status line tracks your Claude usage by:

  1. Loading session usage data using the ccusage library
  2. Calculating session cost and displaying in configured currency
  3. Computing context token usage percentage from transcript files
  4. Displaying real-time cost and context information

Example Output

📁 my-project | 🤖 Claude 3.5 Sonnet | 💰 $0.45 session | 📈 67% | 📂 src | 🌿 feature-branch

Troubleshooting

Git Branch Not Showing

  • Ensure you're in a git repository
  • Check that git command is available in PATH
  • Verify git repository is properly initialized

Session Cost Not Displaying

  • Ensure the ccusage library can access Claude usage data
  • Check that the session ID is valid and usage data exists
  • Verify network access for currency conversion

Context Percentage Not Showing

  • Ensure the transcript path is accessible
  • Check that the transcript file contains valid data
  • Verify file read permissions for the transcript directory

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run the development tasks to ensure code quality
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";
or

Import directly with a jsr specifier

import * as claude_status_line from "jsr:@wyattjoh/claude-status-line";

Add Package

pnpm i jsr:@wyattjoh/claude-status-line
or (using pnpm 10.8 or older)
pnpm dlx jsr add @wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";

Add Package

yarn add jsr:@wyattjoh/claude-status-line
or (using Yarn 4.8 or older)
yarn dlx jsr add @wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";

Add Package

vlt install jsr:@wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";

Add Package

npx jsr add @wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";

Add Package

bunx jsr add @wyattjoh/claude-status-line

Import symbol

import * as claude_status_line from "@wyattjoh/claude-status-line";