Expose remaining token count as env var for statusLine

Status Closed — duplicate
Maintainer reply None cached
Activity 1 comment · opened Jul 18, 2026 · closed Aug 15, 2026

Currently /context shows the remaining token count, but this value isn't available as an environment variable for use in the statusLine command. It would be useful to expose token usage metrics so users can display them in the status bar.

Proposed env vars:

  • CLAUDE_CODE_TOKENS_REMAINING — remaining tokens in the context window
  • CLAUDE_CODE_TOKENS_TOTAL — total context limit
  • CLAUDE_CODE_TOKENS_USED — current token usage

Use case:

"statusLine": {
  "type": "command",
  "command": "echo \"📁 $(basename \"$PWD\") 📊 ${CLAUDE_CODE_TOKENS_REMAINING:-?}/${CLAUDE_CODE_TOKENS_TOTAL:-?}\""
}

Current workaround:
totalTokensReminder and /context work but aren't visible in the persistent status bar.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗