npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-status-ollama

v1.0.1

Published

Claude Code status-line hook for Ollama auto-switcher usage and account state

Readme

claude-status-ollama

A tiny, dependency-light Claude Code status-line hook that shows the current Claude model, your Ollama account email, usage bars, and auto-switch state.

Install

npx claude-status-ollama setup

Or install globally / locally so it is always available:

npm install -g claude-status-ollama
# or
npm install --save-dev claude-status-ollama

You can also run it straight from a local path without publishing:

cd claude-status-ollama
npx . setup

Setup

The setup subcommand writes the Claude Code statusLine hook into the most appropriate settings file:

  • Project settings: .claude/settings.json (used by default if a .claude directory already exists)
  • Global settings: ~/.claude/settings.json
# Project settings
npx claude-status-ollama setup

# Global settings
npx claude-status-ollama setup --global

The generated configuration looks like this:

{
  "statusLine": {
    "type": "command",
    "command": "npx claude-status-ollama --status",
    "refreshInterval": 10,
    "padding": 2
  }
}

Authentication

The token is resolved in this priority order:

  1. --token <token> CLI argument
  2. OLLAMA_TOKEN environment variable
  3. File path from OLLAMA_TOKEN_FILE environment variable
  4. --token-file <path> CLI argument
  5. Default file: ~/.claude/ollama_tok.txt

If no token is found, the status line still renders the current Claude model without making an API call.

Usage

# Print the status line (requires --status)
npx claude-status-ollama --status

# Script-friendly JSON
npx claude-status-ollama --status --json

# Plain, colorless output
npx claude-status-ollama --status --plain

# Refresh every 5 seconds for manual testing
npx claude-status-ollama --status --watch 5

# Override token for one run
npx claude-status-ollama --status --token "ollama_..."

What the status line shows

A typical line looks like:

Sonnet 5 | [email protected] | Sess [██████░░░░] 60% | Week [████████░░] 80% | Auto ON | Resets 2h/3d
  • Model — detected from CLAUDE_MODEL, CLAUDE_CODE_MODEL, or ANTHROPIC_MODEL
  • Email — sanitized and truncated if too long
  • Session usage — colored ASCII progress bar
  • Weekly usage — colored ASCII progress bar
  • Auto-switchON/OFF indicator
  • Reset timers — time until session/weekly reset
  • Switched → — yellow prefix when autoSwitch.triggered is true

Environment variables

| Variable | Purpose | | --- | --- | | OLLAMA_TOKEN | Ollama API token | | OLLAMA_TOKEN_FILE | Path to a file containing the token | | CLAUDE_MODEL / CLAUDE_CODE_MODEL / ANTHROPIC_MODEL | Detect the current Claude model name | | CLAUDE_THINKING / CLAUDE_EFFORT | Optional thinking level / effort indicator | | NO_COLOR | Disables colors (also auto-detected via chalk) |

Flags

| Flag | Description | | --- | --- | | --status | Emit the status line | | --token <token> | Provide the API token inline | | --token-file <path> | Read the API token from a file | | --plain | No colors, no emoji, scripting-friendly | | --json | Output raw JSON instead of the formatted line | | --watch <seconds> | Refresh every N seconds | | --global | With setup, write to global settings | | -h, --help | Show help | | -v, --version | Show version |

Development

cd claude-status-ollama
npm install
node index.js --help
node index.js --status --plain
npm test

License

MIT