[BUG] Token usage missing from Models stats when Claude Code is launched via shell alias

Resolved 💬 4 comments Opened Jan 25, 2026 by ibarapascal Closed Feb 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When Claude Code is launched via a zsh shell alias that wraps the claude command with additional flags (for example, --dangerously-skip-permissions), token usage is tracked inconsistently:

  • Token usage does appear in /statsOverview
  • Token usage does NOT appear (or is incomplete) in /statsModels (per-model statistics)

This causes the per-model usage view to underreport or miss usage entirely for sessions started via an alias.

What Should Happen?

Token usage should be tracked and attributed consistently across all statistics views, including Models, regardless of how Claude Code is launched:

  • Directly via the claude command
  • Indirectly via a shell alias that wraps claude with additional flags

Alias-based launches should not affect accounting or attribution logic.

Error Messages/Logs

Steps to Reproduce

  1. In zsh, define an alias:

``bash
alias cc='claude --dangerously-skip-permissions'
``

  1. Launch Claude Code using the alias:

``bash
cc
``

  1. Use Claude Code normally and consume tokens.
  2. Run /stats inside Claude Code.
  3. Observe:
  • Overview shows correct token usage.
  • Models does not include the usage from this session.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗