DEV Community

S1M0N38
S1M0N38

Posted on

ccusage.nvim

Screenshot Example of ccusage.nvim

I've created a small plugin for Neovim that some of you might find useful if you're using Claude Code.

The motivation

As someone with an Anthropic Pro subscription, I often hit usage limits during intensive coding
sessions (especially when using Claude Code extensively). Anthropic uses a 5-hour rolling window for rate limits,
so knowing where you stand helps manage your workflow better.

What it does

  • Integrates the https://github.com/ryoppippi/ccusage into your Neovim statusline via lualine
  • Shows real-time token usage and costs with color-coded indicators
  • Provides a :CCUsage command for detailed usage stats
  • Minimal overhead with smart caching

Features

  • Token count tracking with readable K/M suffixes
  • Cost monitoring in USD
  • Session time vs usage percentage display
  • Customizable formatting
  • Health check system for troubleshooting

The default statusline display shows something like time 75% | tok 45% with color coding (red when over limits,
yellow when approaching).

Installation (lazy.nvim)

{
  "S1M0N38/ccusage.nvim",
  version = "1.*",
  opts = {},
}

-- Add to lualine
{
  "nvim-lualine/lualine.nvim",
  opts = {
    sections = { lualine_x = { "ccusage" } },
  },
}
Enter fullscreen mode Exit fullscreen mode

Requirements

  • Neovim ≥ 0.11
  • npm install -g ccusage

It's a pretty niche use case, but if you're managing Claude Code usage limits like I am, it might save you some
headaches. The plugin is minimal and tries to stay out of your way.

Thanks for checking it out! Happy to answer any questions.

Top comments (0)