[BUG] Context usage counter resets to 0 upon interaction
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 I first open Cursor and run /context usage, it displays normally showing the context statistics. However, as soon as I start interacting with the AI (sending messages), the context usage immediately drops to 0 and stays there.
Steps to Reproduce:
What Should Happen?
show usage correctly
Error Messages/Logs
❯ /context
⎿ Context Usage
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛀ claude-sonnet-4-5-20250929 · 22k/200k tokens (11%)
⛁ ⛁ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Estimated usage by category
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.4k tokens (1.2%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 12.7k tokens (6.4%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Custom agents: 238 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 1.0k tokens (0.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Skills: 891 tokens (0.4%)
⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛁ Messages: 5.1k tokens (2.5%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛶ Free space: 145k (72.3%)
⛝ Autocompact buffer: 33.0k tokens (16.5%)
MCP tools · /mcp
└ mcp__plugin_claude-mem_mcp-search____IMPORTANT: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__search: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__timeline: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__get_observations: 0 tokens
└ mcp__web-search-prime__webSearchPrime: 0 tokens
└ mcp__ide__getDiagnostics: 0 tokens
└ mcp__ide__executeCode: 0 tokens
└ mcp__plugin_github_github__add_comment_to_pending_review: 0 tokens
└ mcp__plugin_github_github__add_issue_comment: 0 tokens
└ mcp__plugin_github_github__assign_copilot_to_issue: 0 tokens
└ mcp__plugin_github_github__create_branch: 0 tokens
└ mcp__plugin_github_github__create_or_update_file: 0 tokens
└ mcp__plugin_github_github__create_pull_request: 0 tokens
└ mcp__plugin_github_github__create_repository: 0 tokens
└ mcp__plugin_github_github__delete_file: 0 tokens
└ mcp__plugin_github_github__fork_repository: 0 tokens
└ mcp__plugin_github_github__get_commit: 0 tokens
└ mcp__plugin_github_github__get_file_contents: 0 tokens
└ mcp__plugin_github_github__get_label: 0 tokens
└ mcp__plugin_github_github__get_latest_release: 0 tokens
└ mcp__plugin_github_github__get_me: 0 tokens
└ mcp__plugin_github_github__get_release_by_tag: 0 tokens
└ mcp__plugin_github_github__get_tag: 0 tokens
└ mcp__plugin_github_github__get_team_members: 0 tokens
└ mcp__plugin_github_github__get_teams: 0 tokens
└ mcp__plugin_github_github__issue_read: 0 tokens
└ mcp__plugin_github_github__issue_write: 0 tokens
└ mcp__plugin_github_github__list_branches: 0 tokens
└ mcp__plugin_github_github__list_commits: 0 tokens
└ mcp__plugin_github_github__list_issue_types: 0 tokens
└ mcp__plugin_github_github__list_issues: 0 tokens
└ mcp__plugin_github_github__list_pull_requests: 0 tokens
└ mcp__plugin_github_github__list_releases: 0 tokens
└ mcp__plugin_github_github__list_tags: 0 tokens
└ mcp__plugin_github_github__merge_pull_request: 0 tokens
└ mcp__plugin_github_github__pull_request_read: 0 tokens
└ mcp__plugin_github_github__pull_request_review_write: 0 tokens
└ mcp__plugin_github_github__push_files: 0 tokens
└ mcp__plugin_github_github__request_copilot_review: 0 tokens
└ mcp__plugin_github_github__search_code: 0 tokens
└ mcp__plugin_github_github__search_issues: 0 tokens
└ mcp__plugin_github_github__search_pull_requests: 0 tokens
└ mcp__plugin_github_github__search_repositories: 0 tokens
└ mcp__plugin_github_github__search_users: 0 tokens
└ mcp__plugin_github_github__sub_issue_write: 0 tokens
└ mcp__plugin_github_github__update_pull_request: 0 tokens
└ mcp__plugin_github_github__update_pull_request_branch: 0 tokens
Custom agents · /agents
Plugin
└ superpowers:code-reviewer: 238 tokens
Memory files · /memory
└ CLAUDE.md: 1.0k tokens
Skills · /skills
User
└ siyuan-notes: 68 tokens
└ skill-creator: 60 tokens
Plugin
└ agent-browser: 72 tokens
└ receiving-code-review: 67 tokens
└ verification-before-completion: 67 tokens
└ finishing-a-development-branch: 61 tokens
└ using-git-worktrees: 59 tokens
└ brainstorming: 56 tokens
└ using-superpowers: 47 tokens
└ dispatching-parallel-agents: 37 tokens
└ requesting-code-review: 36 tokens
└ executing-plans: 33 tokens
└ systematic-debugging: 31 tokens
└ subagent-driven-development: 31 tokens
└ writing-skills: 31 tokens
└ test-driven-development: 29 tokens
└ writing-plans: 28 tokens
└ claude-mem:make-plan: 20 tokens
└ ralph-loop:help: 16 tokens
└ claude-mem:do: 16 tokens
└ ralph-loop:ralph-loop: 14 tokens
└ ralph-loop:cancel-ralph: 12 tokens
❯ 你好
● 你好!有什么我可以帮助你的吗?
❯ /context
⎿ Context Usage
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛀ claude-sonnet-4-5-20250929 · 0k/200k tokens (0%)
⛁ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Estimated usage by category
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.4k tokens (1.2%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 12.7k tokens (6.4%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Custom agents: 238 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 1.0k tokens (0.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Skills: 891 tokens (0.4%)
⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛁ Messages: 7.8k tokens (3.9%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛶ Free space: 142k (71.0%)
⛝ Autocompact buffer: 33.0k tokens (16.5%)
MCP tools · /mcp
└ mcp__plugin_claude-mem_mcp-search____IMPORTANT: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__search: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__timeline: 0 tokens
└ mcp__plugin_claude-mem_mcp-search__get_observations: 0 tokens
└ mcp__web-search-prime__webSearchPrime: 0 tokens
└ mcp__ide__getDiagnostics: 0 tokens
└ mcp__ide__executeCode: 0 tokens
└ mcp__plugin_github_github__add_comment_to_pending_review: 0 tokens
└ mcp__plugin_github_github__add_issue_comment: 0 tokens
└ mcp__plugin_github_github__assign_copilot_to_issue: 0 tokens
└ mcp__plugin_github_github__create_branch: 0 tokens
└ mcp__plugin_github_github__create_or_update_file: 0 tokens
└ mcp__plugin_github_github__create_pull_request: 0 tokens
└ mcp__plugin_github_github__create_repository: 0 tokens
└ mcp__plugin_github_github__delete_file: 0 tokens
└ mcp__plugin_github_github__fork_repository: 0 tokens
└ mcp__plugin_github_github__get_commit: 0 tokens
└ mcp__plugin_github_github__get_file_contents: 0 tokens
└ mcp__plugin_github_github__get_label: 0 tokens
└ mcp__plugin_github_github__get_latest_release: 0 tokens
└ mcp__plugin_github_github__get_me: 0 tokens
└ mcp__plugin_github_github__get_release_by_tag: 0 tokens
└ mcp__plugin_github_github__get_tag: 0 tokens
└ mcp__plugin_github_github__get_team_members: 0 tokens
└ mcp__plugin_github_github__get_teams: 0 tokens
└ mcp__plugin_github_github__issue_read: 0 tokens
└ mcp__plugin_github_github__issue_write: 0 tokens
└ mcp__plugin_github_github__list_branches: 0 tokens
└ mcp__plugin_github_github__list_commits: 0 tokens
└ mcp__plugin_github_github__list_issue_types: 0 tokens
└ mcp__plugin_github_github__list_issues: 0 tokens
└ mcp__plugin_github_github__list_pull_requests: 0 tokens
└ mcp__plugin_github_github__list_releases: 0 tokens
└ mcp__plugin_github_github__list_tags: 0 tokens
└ mcp__plugin_github_github__merge_pull_request: 0 tokens
└ mcp__plugin_github_github__pull_request_read: 0 tokens
└ mcp__plugin_github_github__pull_request_review_write: 0 tokens
└ mcp__plugin_github_github__push_files: 0 tokens
└ mcp__plugin_github_github__request_copilot_review: 0 tokens
└ mcp__plugin_github_github__search_code: 0 tokens
└ mcp__plugin_github_github__search_issues: 0 tokens
└ mcp__plugin_github_github__search_pull_requests: 0 tokens
└ mcp__plugin_github_github__search_repositories: 0 tokens
└ mcp__plugin_github_github__search_users: 0 tokens
└ mcp__plugin_github_github__sub_issue_write: 0 tokens
└ mcp__plugin_github_github__update_pull_request: 0 tokens
└ mcp__plugin_github_github__update_pull_request_branch: 0 tokens
Custom agents · /agents
Plugin
└ superpowers:code-reviewer: 238 tokens
Memory files · /memory
└ CLAUDE.md: 1.0k tokens
Skills · /skills
User
└ siyuan-notes: 68 tokens
└ skill-creator: 60 tokens
Plugin
└ agent-browser: 72 tokens
└ receiving-code-review: 67 tokens
└ verification-before-completion: 67 tokens
└ finishing-a-development-branch: 61 tokens
└ using-git-worktrees: 59 tokens
└ brainstorming: 56 tokens
└ using-superpowers: 47 tokens
└ dispatching-parallel-agents: 37 tokens
└ requesting-code-review: 36 tokens
└ executing-plans: 33 tokens
└ systematic-debugging: 31 tokens
└ subagent-driven-development: 31 tokens
└ writing-skills: 31 tokens
└ test-driven-development: 29 tokens
└ writing-plans: 28 tokens
└ claude-mem:make-plan: 20 tokens
└ ralph-loop:help: 16 tokens
└ claude-mem:do: 16 tokens
└ ralph-loop:ralph-loop: 14 tokens
└ ralph-loop:cancel-ralph: 12 tokens
Steps to Reproduce
Run /context usage command (after opening a new session) - shows normal context statistics (e.g., 15% used)
Start a chat interaction or send a message to the AI
Run /context usage again - now shows 0% context usage
Expected Behavior: Context usage should reflect actual token consumption and increase as the conversation progresses.
Actual Behavior: Context usage drops to 0 immediately after first interaction and remains stuck at 0.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.22
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗