This post details a system for tracking the usage of subagents within the Claude Code environment to identify and remove unused "zombie" agents. The solution involves a stop hook script that logs agent invocations to a JSONL file upon session termination. A separate script then processes this log to generate daily reports, highlighting the top-used agents and listing those that have not been invoked in the past 7 or 30 days. This process helps maintain the Claude Code setup by providing data-driven decisions for agent deletion. AI
IMPACT Helps users manage and optimize their AI agent configurations for better efficiency.
RANK_REASON The item describes a custom script and logging system for managing a specific feature of the Claude Code environment, rather than a new product release or core research.
- agent-invocations.jsonl
- agents-index.sh
- agent-usage-latest.md
- agent-usage-summary.sh
- Claude
- Claude Code
- INDEX.md
- stop_agent_tracker.sh
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →