Expose remaining token count as env var for statusLine
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
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 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 ↗