7 of My 8 Claude Code Agents Had Zero Calls in 30 Days: Finding Dead Agents Automatically
The author's expensive AI automation setup relies not on clever prompts but on an environmental system that monitors agent usage. Out of eight custom agents defined in Claude Code, seven had zero calls in the last 30 days, and all eight had zero calls in the last seven days. This indicates that many defined agents are unused and consume tokens in the system prompt, degrading performance. The "defined = working" fallacy occurs because agents require an explicit calling prompt or logic to be activated, not just a descriptive text file. Unused agents incur both token costs and cognitive costs by making the system harder to manage and eroding trust. The solution is to implement an operational cycle that uses logs to automatically identify and prune unused agent definitions. This involves a three-layer system: recording agent invocations in a JSONL file, aggregating usage data over specified periods, and outputting rankings and zero-call lists. The agent-usage-summary.sh script aggregates data, cross-referencing defined agents with actual usage logs. The output helps in making informed decisions about deleting, archiving, or redesigning agents. Investing in monitoring mechanisms, like tracking agent usage, is crucial for maintaining effective AI automation. This proactive approach ensures the system's efficiency and reliability by addressing unused components.
agent-usage-summary.shscript aggregates data, cross-referencing defined agents with actual usage logs. The output helps in making informed decisions about deleting, archiving, or redesigning agents. Investing in monitoring mechanisms, like tracking agent usage, is crucial for maintaining effective AI automation. This proactive approach ensures the system's efficiency and reliability by addressing unused components.