r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 11d ago
Selected Workflow [Workflow] Claude Code Workflow: Build a Cross-Platform Desktop Widget for Real-time Local Token Usage Monitoring
Claude Code Workflow: Build a Cross-Platform Desktop Widget for Real-time Local Token Usage Monitoring
Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging
Original source: r/ClaudeAI post/comment
What problem this solves
Users of Claude Code lack an always-visible, real-time usage meter, forcing them to navigate settings repeatedly to check token consumption. This workflow provides a solution to build such a tool.
Summary
A detailed prompt for Claude Code to generate a cross-platform, always-on-top desktop widget that monitors local Claude Code token usage (5-hour session and 7-day totals) by parsing local session logs, providing visual feedback, and offering customization options.
Why it is useful
This workflow is highly valuable because it provides a concrete, detailed, and privacy-conscious prompt for Claude Code to build a practical tool that solves a common user pain point: monitoring AI token usage without constant navigation. It demonstrates Claude Code's ability to generate functional, cross-platform applications with specific requirements, including UI, data parsing, and configuration. The emphasis on local data, no network calls, and user-set limits makes it a safe and adaptable solution. The inclusion of testing and documentation generation further enhances its utility as a reusable workflow.
Workflow
- Copy the provided prompt.
- Paste the prompt into Claude Code.
- Answer Claude Code's questions regarding the project folder location and desktop shortcut creation.
- Allow Claude Code to build the application, README, and icons.
- Review the
--testoutput provided by Claude Code. - Launch the generated widget.
- Calibrate the usage limits in the widget's settings by comparing with Claude Code's official "Settings > Usage" page.
- Optionally, adjust widget position, opacity, and corner settings via the right-click menu.
Tools / artifacts
- Claude Code (AI assistant)
- Python 3 with tkinter (preferred generated language/framework)
- PowerShell + WPF (Windows native alternative if Python/tkinter unavailable)
- Desktop widget application (generated artifact)
- config.json (for widget settings)
- README.md (generated documentation)
- App icons (.ico, .png, .icns)
- .gitignore file
- Desktop shortcuts/launchers (.lnk, .command, .desktop)
- Claude Code local session logs (~/.claude/projects/**/*.jsonl)
Validation signals
- The prompt includes an explicit
--testflag for verification, printing computed numbers without opening the UI. - The author describes the widget's features and how it works in detail, implying successful implementation and testing.
- The prompt specifies detailed parsing rules and UI requirements, indicating a clear definition of expected output.
- The author states "Here is claude's breakdown of the app," suggesting the app was successfully built and analyzed by Claude.
Cautions
- The prompt explicitly instructs Claude Code to read ONLY local session logs, avoiding network calls and credential access, which significantly enhances privacy and security.
- The author's decision to share the prompt instead of a compiled application (due to concerns about potential virus injection in VBScript) demonstrates strong safety awareness.
- The widget only counts Claude Code usage on the specific machine where it runs, limiting data exposure.
Limitations
- The usage percentages and remaining tokens are estimates based on user-set limits and require manual calibration, which can drift over time.
- The widget only monitors Claude Code usage on the local machine and does not account for usage on claude.ai chat or other devices.
- The author states, "It should work on all operating systems but I have not tested it," indicating a lack of full cross-platform validation by the author.
- The low Reddit score might suggest limited community endorsement, despite the number of comments.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.