Looking for the easiest way to create and manage agents? Cloud Agents in Mission Control are recommended for most teams. This guide covers local agentsβagent files stored in your repositoryβfor open source users or teams needing version-controlled definitions.
What You'll Build
A local agent system that:
- Keeps agent definitions version-controlled alongside your code
- Runs agents with Continue CLI for local development
- Automates agent execution on pull requests via GitHub Actions
- Applies consistent workflows across your team
Prerequisites
Before starting, ensure you have:- Continue CLI installed (
npm i -g @continuedev/cli) ANTHROPIC_API_KEYenvironment variable set- GitHub CLI installed locally if your agents interact with GitHub (pre-installed on GitHub-hosted runners)
Quick Setup
1
Create the agents directory
2
Create your first agent
Create a markdown file with YAML frontmatter defining the agentβs behavior:Add content like:
3
Run the agent
Agent File Format
Agent files are markdown documents with YAML frontmatter. The frontmatter configures the agent, and the markdown body contains the prompt instructions.Frontmatter Options
| Field | Required | Description |
|---|---|---|
name | Yes | Display name for the agent |
description | Yes | Brief description of what the agent does |
The markdown body is the agentβs system prompt. Write clear, specific instructions with examples for best results.
rules, model, and MCP tool configuration, see the Agent Configuration Reference.
Example: Conventional PR Title Agent
This agent updates pull request titles to follow conventional commit format:GitHub Actions Integration
Continue provides a reusable workflow that handles agent discovery, parallel execution, and GitHub Check reporting.Using the Reusable Workflow
Create.github/workflows/run-agents.yml:
- Discovers all
.mdfiles in.continue/agents/ - Runs each agent in parallel
- Creates GitHub Check runs for each agent
- Provides
GH_TOKENfor agents using theghCLI - Writes job summaries with agent output
Configuration Options
Required Secrets
Add this secret to your repository under Settings > Secrets and variables > Actions:| Secret | Description |
|---|---|
ANTHROPIC_API_KEY | Your Anthropic API key for Claude |
The reusable workflow automatically provides
GH_TOKEN via ${{ github.token }}, so agents using the gh CLI work out of the box.Security Considerations
Limit Agent Permissions
When running agents in CI/CD, follow the principle of least privilege:- GitHub Actions Permissions
- CLI Tool Permissions
- Environment Variables
Only grant the permissions your agent needs:
Review Agent Outputs
Before enabling fully automated agents:- Test locally first - Run agents with
cnto verify behavior - Review CI logs - Check what commands agents execute in your workflows
- Start with read-only agents - Begin with agents that analyze rather than modify
Environment Variables
When running agents locally, set these environment variables:Directory Structure
A typical setup looks like:Troubleshooting
Agent not found
Agent not found
Ensure the path is correct and the file exists:The path must be relative to your repository root.
GitHub CLI authentication errors
GitHub CLI authentication errors
If agents using In GitHub Actions, ensure
gh fail, verify authentication:GH_TOKEN: ${{ github.token }} is set in the environment.Agent runs but doesn't complete the task
Agent runs but doesn't complete the task
- Simplify the prompt and add more specific instructions
- Check if the agent has access to required tools
- Enable verbose logging:
cn --verbose --agent .continue/agents/my-agent.md - Review logs with
cn --verboseor check the Continue logs directory
Workflow doesn't discover agents
Workflow doesn't discover agents
Verify your agents are in the correct directory:The workflow looks for
.md files in .continue/agents/.Best Practices
Start Simple
Begin with read-only agents that analyze code before adding agents that make changes.
Test Locally
Always run
cn --agent locally before enabling CI automation.Use Descriptive Names
The
name field in frontmatter is displayed to users. Use descriptive filenames for organization: conventional-title.md, security-scan.md.Keep Agents Focused
Each agent should do one thing well. Combine multiple agents for complex workflows.