Skip to content

S1M0N38/ccusage.nvim

Repository files navigation

⌖  ccusage.nvim  ⌖

LuaRocks release GitHub release Reddit post

Screenshot: ccusage.nvim example

Track Claude Code usage in Neovim


💡 Motivation

As a Claude Code user with an Anthropic Pro subscription ($20/month), I frequently encounter usage limits during intensive development sessions (particularly when leveraging SuperClaude enhancements). This requires careful management of API requests to maximize productivity within rate limits.

Anthropic currently implements usage limits based on a 5-hour rolling window 1. Once this window expires, usage limits reset automatically. The ccusage CLI tool provides an excellent solution for tracking Claude Code consumption patterns.

This plugin brings ccusage statistics directly into your Neovim workflow. It seamlessly integrates usage data into your statusline via lualine components and provides on-demand notifications through the :CCUsage command.

⚡️ Requirements

📦 Installation

Install ccusage.nvim using your preferred plugin manager. Here's a complete configuration example for lazy.nvim:

-- Install and configure ccusage.nvim
{
  "S1M0N38/ccusage.nvim",
  version = "1.*",
  opts = {},
}
-- Enable ccusage lualine component
{
  "nvim-lualine/lualine.nvim",
  opts = {
    -- Add ccusage to your preferred lualine section
    sections = { lualine_x = { "ccusage" } },
    -- ... rest of your lualine configuration
  },
}

🚀 Usage

Get started by reading the comprehensive documentation with :help ccusage, which covers all plugin features and configuration options.

Note

Mastering Vim/Neovim Documentation: Most Vim/Neovim plugins include built-in :help documentation. Learning to navigate this system effectively is an invaluable skill for any Vim user. If you're new to this, start with :help and explore the first 20 lines to understand the navigation basics.

🙏 Acknowledgments

Footnotes

  1. Anthropic hasn't published exact rate limit details. Based on observation, I estimate approximately 200 requests or 15M tokens per 5-hour session (roughly $8 worth of Sonnet 4 requests). Anthropic has indicated plans to implement weekly usage limits alongside session-based limits, and monthly caps may already be in effect.

About

⌖ Track Claude Code usage in Neovim

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages