List and Manage Agents
Manage your globally installed agents with listing, updating, and removal commands.
List Global Agents
View All Installed Agents
Display all globally installed agents:
The listing shows:
📋 Installed Global Agents:
✅ Found 3 global agent(s):
✅ customer-support (🌍 system)
Usage: customer-support "your prompt"
Created: 2/28/2026
✅ security-auditor (🌍 system)
Usage: security-auditor "your prompt"
Created: 2/27/2026
✅ frontend-developer (👤 user)
Usage: frontend-developer "your prompt"
Created: 2/26/2026
🌟 Global Usage:
• Run from any directory: <agent-name> "prompt"
• List agents: npx claude-code-templates@latest --list-agents
• Remove agent: npx claude-code-templates@latest --remove-agent <name>
Installation Locations
Agents can be installed in two locations:
System Directory (🌍):
/usr/local/bin/<agent-name>
- Immediately available
- No PATH configuration required
- Requires write permissions
User Directory (👤):
~/.claude-code-templates/bin/<agent-name>
- User-specific installation
- Requires PATH configuration
- Works without sudo/admin rights
For each agent:
Installation directory (system or user)
Whether the agent is executable (✅ or ❌)
Example command to invoke the agent
Update Global Agents
Update an Agent
Update an agent to the latest version from GitHub:
cct --update-agent <agent-name>
Examples
# Update customer support agent
cct --update-agent customer-support
# Update security auditor
cct --update-agent security-auditor
# Update frontend developer
cct --update-agent frontend-developer
What Happens During Update
- Verification: Checks if agent exists
- Download: Fetches latest version from GitHub main branch
- Backup: Preserves existing agent (overwritten on success)
- Installation: Writes new agent file and executable
- Confirmation: Displays success message
Update Output
cct --update-agent customer-support
🔄 Updating global agent: customer-support
🔄 Re-downloading latest version...
🤖 Creating global agent: customer-support
🌍 Installing to system directory (immediately available)
✅ Agent downloaded successfully
✅ Global agent 'customer-support' created successfully!
📦 Usage:
customer-support "your prompt here"
🎉 Ready to use immediately! No setup required.
When to Update
Update agents when:
- New features are added to the agent
- Bug fixes are released
- System prompts are improved
- You want the latest capabilities
Version Tracking
Agents are always updated to the latest version from:
https://github.com/davila7/claude-code-templates/main/cli-tool/components/agents/
No version numbers are tracked; updates always fetch the current main branch version.
Remove Global Agents
Remove an Agent
Delete a globally installed agent:
cct --remove-agent <agent-name>
Examples
# Remove customer support agent
cct --remove-agent customer-support
# Remove security auditor
cct --remove-agent security-auditor
# Remove frontend developer
cct --remove-agent frontend-developer
What Gets Removed
Deletion removes:
- System executable:
/usr/local/bin/<agent-name> (if exists)
- User executable:
~/.claude-code-templates/bin/<agent-name> (if exists)
- Agent file:
~/.claude-code-templates/agents/<agent-name>.md
Removal Output
cct --remove-agent customer-support
🗑️ Removing global agent: customer-support
✅ Removed system executable: customer-support
✅ Removed agent file: customer-support.md
🎉 Global agent 'customer-support' removed successfully!
Agent Not Found
If the agent doesn’t exist:
cct --remove-agent nonexistent
🗑️ Removing global agent: nonexistent
⚠️ Agent 'nonexistent' not found.
💡 List available agents with: --list-agents
Safety
Removal is immediate and cannot be undone. To restore:
cct --create-agent <agent-name>
Managing Multiple Agents
Bulk Updates
Update multiple agents with a script:
#!/bin/bash
# update-all-agents.sh
# List of agents to update
AGENTS=("customer-support" "security-auditor" "frontend-developer")
for agent in "${AGENTS[@]}"; do
echo "Updating $agent..."
cct --update-agent "$agent"
echo ""
done
echo "✅ All agents updated!"
Bulk Removal
Remove multiple agents:
#!/bin/bash
# remove-agents.sh
AGENTS=("old-agent" "deprecated-agent")
for agent in "${AGENTS[@]}"; do
echo "Removing $agent..."
cct --remove-agent "$agent"
echo ""
done
Inventory Management
Export installed agents list:
# List agents to file
cct --list-agents > installed-agents.txt
# Share with team
cat installed-agents.txt
Troubleshooting
Agent Shows as Not Executable (❌)
Fix permissions:
# For user directory
chmod +x ~/.claude-code-templates/bin/<agent-name>
# For system directory (requires sudo)
sudo chmod +x /usr/local/bin/<agent-name>
Agent Not Appearing in List
Verify installation:
# Check user directory
ls -la ~/.claude-code-templates/bin/
# Check system directory
ls -la /usr/local/bin/ | grep claude
Check agent file exists:
ls -la ~/.claude-code-templates/agents/
Update Fails
Check network connectivity:
ping raw.githubusercontent.com
Verify agent exists on GitHub:
Visit: https://aitmpl.com/ and search for the agent.
Try manual update:
# Remove and recreate
cct --remove-agent <agent-name>
cct --create-agent <agent-name>
Cannot Remove Agent
Check permissions:
# For system directory removal
sudo cct --remove-agent <agent-name>
Manual removal:
# Remove executable
rm ~/.claude-code-templates/bin/<agent-name>
sudo rm /usr/local/bin/<agent-name>
# Remove agent file
rm ~/.claude-code-templates/agents/<agent-name>.md
Duplicate Agents
If agent exists in both system and user directories:
# Remove from both locations
sudo rm /usr/local/bin/<agent-name>
rm ~/.claude-code-templates/bin/<agent-name>
# Recreate in preferred location
cct --create-agent <agent-name>
Best Practices
Regular Updates
Update agents monthly or when new features are announced:
# Create update script
echo '#!/bin/bash' > update-agents.sh
echo 'cct --list-agents | grep -oP "(?<=✅ )\w+(?= )" | xargs -I {} cct --update-agent {}' >> update-agents.sh
chmod +x update-agents.sh
# Run updates
./update-agents.sh
Documentation
Document your installed agents:
# Create agents inventory
cat > AGENTS.md << EOF
# Installed Global Agents
## Customer Support
- **Command**: customer-support
- **Purpose**: Handle customer inquiries
- **Usage**: \`customer-support "how to handle refunds?"\`
## Security Auditor
- **Command**: security-auditor
- **Purpose**: Code security reviews
- **Usage**: \`security-auditor --file auth.js "review"\`
EOF
Team Synchronization
Share agent configurations across teams:
# Export agent list
cct --list-agents > team-agents.txt
# Team members install same agents
while read agent; do
cct --create-agent "$agent"
done < team-agents.txt
Cleanup Unused Agents
Regularly review and remove unused agents:
# List agents
cct --list-agents
# Remove unused
cct --remove-agent old-agent
cct --remove-agent deprecated-agent
Backup Agent Files
Backup agent configurations:
# Backup agents directory
tar -czf agents-backup.tar.gz ~/.claude-code-templates/agents/
# Restore if needed
tar -xzf agents-backup.tar.gz -C ~/
Advanced Management
Custom Agent Registry
Maintain a custom registry:
# Create registry file
cat > agent-registry.json << EOF
{
"agents": [
{
"name": "customer-support",
"category": "business",
"version": "latest",
"required": true
},
{
"name": "security-auditor",
"category": "security",
"version": "latest",
"required": true
}
]
}
EOF
Automated Updates
Schedule automatic updates with cron:
# Edit crontab
crontab -e
# Add weekly update (Sundays at 2 AM)
0 2 * * 0 /usr/local/bin/update-agents.sh >> /var/log/agent-updates.log 2>&1
Health Check
Verify all agents are functional:
#!/bin/bash
# check-agents.sh
AGENTS=$(cct --list-agents | grep -oP '(?<=✅ )\w+(?= )')
for agent in $AGENTS; do
echo "Testing $agent..."
$agent --help > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "✅ $agent is working"
else
echo "❌ $agent is broken"
fi
done
Migration
Moving Between Machines
Export agents:
# On source machine
tar -czf agents-export.tar.gz ~/.claude-code-templates/
scp agents-export.tar.gz user@target:/tmp/
Import agents:
# On target machine
tar -xzf /tmp/agents-export.tar.gz -C ~/
# Fix permissions
chmod +x ~/.claude-code-templates/bin/*
# Add to PATH if needed
echo 'export PATH="$HOME/.claude-code-templates/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
System to User Migration
Move from system to user directory:
# List system agents
ls /usr/local/bin/ | grep -v '.'
# Recreate as user agents
for agent in $(ls /usr/local/bin/ | grep -v '.'); do
if [ -f ~/.claude-code-templates/agents/$agent.md ]; then
echo "Migrating $agent to user directory"
cp /usr/local/bin/$agent ~/.claude-code-templates/bin/
sudo rm /usr/local/bin/$agent
fi
done
Next Steps