Expose remaining token count as env var for statusLine
Status Closed — duplicate
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
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 windowCLAUDE_CODE_TOKENS_TOTAL— total context limitCLAUDE_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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗