I see the screenshot, it’s an interesting idea to ask the LLM itself to analyze context usage.
On your specific points:
MCP tool calls with large files: yeah, this is one of the main reasons for overspending. When an agent sends a full SQL file through MCP, all that content goes into the context window. Until we have built-in warnings for large tool calls, the best workaround is to explicitly say in your prompt or Cursor rules that SQL and migrations should be done via the terminal tool instead of MCP. For example: “For executing SQL files, use the terminal to run psql/supabase CLI commands instead of passing file contents through MCP tools.”
Rename and refactor via AST: agreed. Right now the agent mostly uses text search and replace, which is inefficient for large-scale symbol renames. Switching to WebStorm for this kind of work is a reasonable approach. In Cursor, you can use the built-in VS Code refactor F2 to Rename Symbol instead of the agent, it’s instant and free.
I’ll pass both suggestions to the team. They match other requests too: Context Window Inspector & Agent Usage Profiler
Let me know if the Cursor rules workaround helps reduce usage.