Claude Code agents are markdown files (.md) that define autonomous AI workflows. They live in your repository and can be deployed to run on schedules or webhooks.There are three types:
Type
Location
Purpose
Agent
.claude/agents/
Autonomous workflows that can use tools, create PRs, send notifications
Skill
.claude/skills/
Reusable capabilities that can be invoked by agents or users
Run /agents in Claude Code to create a new agent, or create the file manually at .claude/agents/{agent-name}.md:
---name: Weekly Report Generatordescription: Generates a weekly summary of GitHub activity and posts to Slacktools: - mcp_GitHub_list_pull_requests - mcp_Slack_chat_postMessage---You are a weekly report generator. Every time you run:1. Fetch all merged PRs from the past 7 days using the GitHub tool2. Summarize the changes by category (features, fixes, docs)3. Post the summary to the #engineering Slack channelFormat the report with clear sections and bullet points.Keep the tone professional but concise.
The frontmatter (between ---) defines metadata. The body is the prompt that tells the agent what to do.
Skills are directories with a SKILL.md file and optional supporting files. Create .claude/skills/enrich-lead/SKILL.md:
---name: Enrich Leaddescription: Enriches a company lead with LinkedIn and web datatools: - mcp_LinkedIn_get_company_profile - mcp_Perplexity_search---Given a company name and domain, enrich the lead with:1. Company size, industry, and funding from LinkedIn2. Recent news and product launches from web search3. Key decision makers and their titlesReturn structured JSON with all findings.
You can add supporting files alongside SKILL.md (scripts, reference data, etc.):
Commands are quick actions. Create .claude/commands/check-pr.md:
---name: Check PRdescription: Reviews the latest open PR and posts feedback---Find the most recent open pull request, review the code changes,and post constructive feedback as a PR comment.