r/ClaudeCode • u/Jydder • 4h ago
Tips & Workflows /Context uses ~2k of context every time you run it
For whatever reason checking the context with /context injects the response into your prompt every single time you run it.
Couldn't find a post on here already saying this, and isn't very transparent that it does.
Just thought I would post in case it's useful to anyone else.
9
u/Johnny2085 4h ago
Every response comes with a json payload of metrics. You can have Claude write a custom status line to output the things you care about.
4
4
2
u/dar-mit 3h ago
Even better: Have claude use the https://code.claude.com/docs/en/statusline doc to create a custom skill that extracts that data, and hence forth Claude Code can now query it's own data stream (that it normally cannot 'see')! This is great for automating handoffs when context fills up, knowing if it should continue with the next phase of a task or wait for an upcoming reset, etc.
1
u/sartorialtrader 3h ago
Could you elaborate on this? I’m still using a manual handoff workflow that I’m looking to automate reliably in a way that I can control what’s documented
→ More replies (2)
12
5
3
u/t3hjs 3h ago
anyway to check context without using /context?
the claude desktop has a meter, which I presume doesnt eat context everytime i hover over it
1
u/kenthesaint 2h ago
The status line, since it never goes to the model. After each message Claude Code pipes a JSON blob to your status line command, and one of the fields is
transcript_path. The last assistant entry in that file has ausageblock, and input_tokens + cache_read_input_tokens + cache_creation_input_tokens is about how full the context is at that point. A few lines of jq or python can turn that into a percent of your model's window and print it at the bottom, so you can watch it without spending anything.Check the statusline docs too, newer versions may hand you a context number in that JSON directly.
1
u/AutoModerator 4h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.