/tokens
Shows a report on how many tokens the current chat context is using.
/tokens lists how many tokens each part of the current context takes up (e.g. system prompt, repository map, added files, chat history), including a total. This helps estimate how close you are to a context limit.
โ WHEN TO USE IT?
Check what's filling up the context the most right now
/tokens to see whether a large read-only file is taking up a disproportionate amount of space
Check headroom in the context window before an especially long request
/tokens before a big multi-file change, to see whether files should be dropped first with /drop
โ WHEN NOT TO?
You want to actively change the repository map size, not just see usage
/tokens only shows the current state, it doesn't change any settings.
Better: Set --map-tokens to actually change the map size
The context is already noticeably too full and responses are breaking
Just looking at the report doesn't fix the problem yet.
Better: Directly remove no-longer-needed files with /drop, or use /clear for the history
SOURCES
- Aider Docs โ In-chat Commands โ aider.chat