Developer Builds Script to Auto-Generate Index of Claude Code Custom Agents
A developer managing 27 custom Claude Code agents created a Bash-and-Python script called agents-index.sh to automatically maintain an up-to-date index of all agents stored in ~/.claude/agents/. The tool parses frontmatter from each agent's Markdown file and generates a formatted INDEX.md table showing each agent's name, model, description, and permitted tools. A manually maintained index proved unsustainable, as agents were frequently added or modified without the index being updated to reflect those changes. The script also supports a --json flag to output a machine-readable .index.json file for use by other tools such as a cost tracker. It runs automatically each Sunday morning via a macOS launchd scheduled job, ensuring a fresh index is ready at the start of every workweek.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in