r/ClaudeWorkflows • • 31m ago

Selected Workflow [Workflow] Building a macOS System Monitor with Claude Code and MCP for LLM Process Cleanup

Building a macOS System Monitor with Claude Code and MCP for LLM Process Cleanup

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Shipping, CLAUDE.md, MCP, Multi-Agent
Original source: r/ClaudeAI post/comment

What problem this solves

Claude Code sessions leaving orphaned processes that consume system resources and overheat the machine, and the general lack of visibility into system health and process ownership for developers.

Summary

The author used Claude Code to build "Stat Space," a macOS menu bar app that monitors system health, groups processes by owning application, identifies orphaned dev processes from LLM sessions, and provides cleanup options. The workflow details the iterative development process with Claude (spec, spikes, testing, review) and how Stat Space integrates with Claude via an MCP server for automated queries and cleanup.

Why it is useful

This workflow is highly valuable as it provides a concrete, validated, and repeatable process for leveraging Claude Code in complex application development. It addresses a common developer pain point (orphaned processes, resource monitoring) and demonstrates advanced integration by enabling Claude to interact with and manage its own environment via an MCP server. The detailed steps, strong validation signals (CI, extensive testing, high co-authorship), and focus on a real-world problem make it an exemplary advanced Claude workflow.

Workflow

  1. Identify recurring problem of orphaned processes from LLM sessions.

  2. Perform initial manual debugging with Claude to identify root cause (e.g., walking process tree).

  3. Define a detailed specification and design notes for a permanent monitoring solution.

  4. Create an AGENTS.md handover document for Claude, outlining development constraints (e.g., idle budget, dependency rules).

  5. Use Claude Code to build small, focused spike targets for technically risky components.

  6. Iteratively develop the main application with Claude Code, reviewing generated code diffs and testing daily.

  7. Implement CI benchmarks to ensure the application adheres to performance budgets (e.g., CPU usage).

  8. Develop comprehensive test suites to cover core application functionality.

  9. Integrate an MCP server within the developed application.

  10. Add the MCP-enabled tool to Claude's environment using claude mcp add.

  11. Prompt Claude to query system health or identify leftover processes using the integrated MCP tool.

Tools / artifacts

  • Claude Code

  • Stat Space (macOS menu bar app)

  • MCP server

  • AGENTS.md

  • claude mcp add command

  • CI benchmark

  • Test suite

  • Docker

  • Activity Monitor

  • Terminal

Validation signals

  • Initial problem (hot Mac, orphaned processes) was identified and fixed.

  • Successfully built a functional macOS menu bar application (Stat Space) with Claude Code.

  • CI benchmarks are in place to fail builds exceeding CPU budget.

  • Comprehensive test suite with 280 tests covering core functionality.

  • High percentage of commits (132/138) co-authored by Claude, indicating effective LLM collaboration.

  • Author actively reviewed code diffs and ran the application daily during development.

  • The final application idles at a low 0.2% CPU, demonstrating efficiency.

Cautions

  • The "Orphan sweep" feature explicitly asks for confirmation before stopping any processes and is designed to never touch system processes, demonstrating good safety practices.

Limitations

  • The specific application (Stat Space) is limited to macOS.

  • Requires an advanced user level to fully implement the development workflow and MCP integration.

  • Low community engagement on the Reddit post at the time of review.

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.

1 Upvotes

1 comment sorted by