kingbootoshi

Agent Janitor — AI skill for Claude Code

AI community

menu bar janitor for AI-agent dev macs: tracks process lineage before launchd reparenting destroys it, flags orphaned dev servers with interaction evidence, reaps only with consent.

How to install Agent Janitor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kingbootoshi/agent-janitor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Agent Janitor does

menu bar janitor for AI-agent dev macs: tracks process lineage before launchd reparenting destroys it, flags orphaned dev servers with interaction evidence, reaps only with consent.

Alternatives in AI

  • Vibeproxy — Native macOS menu bar app to use your Claude Code & ChatGPT subscriptions with AI coding tools - no API keys n 3.3k ★
  • Omnara — by Ishaan Sehgal - A command center for AI agents that syncs Claude Code sessions across terminal, web, and mo 2.6k ★
  • Claude Usage Tracker — Native macOS menu bar app for tracking Claude AI usage limits in real-time 2.2k ★

README

agent-janitor

![agent-janitor](assets/hero.jpeg)

Orphan-process janitor with session attribution for AI-agent dev workstations. Watches every user process, remembers who spawned what before macOS reparents orphans to launchd, flags leftovers with evidence, and reaps only what is provably dead.

Fully local. No network calls, no LLM, no telemetry - nothing leaves your machine. The daemon is a deterministic sensor and actuator; judgment stays with you (or the agent you already talk to, reading `janitor flags`).

The problem: coding agents (Claude Code, Codex, and friends) spawn dev servers, shells, and helpers that outlive their sessions. macOS reparents them to launchd, their history evaporates, and RAM fills with week-old `python -m http.server` processes nobody remembers. Generic RAM cleaners solve the wrong problem - green memory pressure is healthy macOS behavior. The real fix is lineage: know who spawned what, prove nothing interacts with it, then reap with consent.

components

binary role
janitord LaunchAgent daemon. Scans every 5s via proc_pid_rusage/libproc, ranks by phys_footprint, persists lineage + time-series samples to SQLite, evaluates flag rules, listens for memory-pressure transitions, serves a unix socket API. ~13MB footprint.
AgentJanitorMenu Menu bar app (broom icon, dims when clean). Flags grouped by process type + project with bulk actions. Per-flag: Keep (instance / project 30d), Terminate, Force Kill, Dismiss. Memory Breakdown submenu reconciles Activity-Monitor-style totals.
janitor CLI: status, top, flags, keep, kill, dismiss, log, mode.
agent-session Optional exec wrapper: agent-session --kind claude -- claude ... registers the session root with the daemon before execvp'ing the real CLI, improving lineage attribution for that session tree.

flag rules

  • httpServerOrphan - python -m http.server, 4h+, parent dead, no tty
  • devToolStale - vite / bun-watch / bu