RimantasZ Contextspy Brings Hidden AI Prompt Costs Into Clear View

Contextspy is a new profiling tool that helps developers understand and optimize how artificial intelligence coding agents use context windows. It intercepts requests sent to language model APIs to analyze and visualize prompt composition. The software also tracks how context changes between multiple requests in a single session.
Developer RimantasZ created this project to make invisible token costs visible. As AI agents take on complex workflows, input token consumption causes cloud API bills to grow quickly. This tool solves the problem of unclear session slowdowns by showing a live breakdown of every token category.
Visualize your token usage
- Intercepts local and cloud API requests.
- Breaks down input into eight categories.
- Provides a live interactive dashboard view.
- Tracks requests grouped by session tasks.
- Stores all data in local SQLite.
- Detects common AI agent client software.
This software is built for people running AI coding agents who need to understand their API expenses. Users can review the exact breakdown of system prompts, tool definitions, and file contents sent to the model. By viewing this data, they can reduce unnecessary tokens that cause high costs and slower processing times.
Local data and future updates
The developer notes that all captured traffic stays on the local machine and nothing is sent to the cloud. Request contents are purged from the database after seven days while only statistics are retained. Users are advised to manually clear the database before upgrading because the schema is still subject to change.
"ContextSpy makes the invisible visible - you see a live breakdown of every token category for every request, across sessions, over time."
Source: GitHub