Expose remaining token count as env var for statusLine

Status Fixed / completed
Maintainer reply None cached
Activity 1 comment · opened Jul 18, 2026 · closed Aug 17, 2026

Currently /context shows the remaining token count, but this value isn't available as an environment variable for use in the statusLine command.

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 ↗