Skip to main content
Glama

spawn_agent

Deploy an autonomous AI agent to clone a GitHub repo, implement changes, run tests, create a pull request, and merge it, handling the full development workflow from start to finish.

Instructions

Spawn a Claude Code agent on a GitHub repository.

WORKFLOW: agent clones repo → creates its own branch → implements → tests → commits → pushes → opens PR → merges PR → publishes.

IMPORTANT: Always set create_branch: false. The agent creates its own branch internally with git checkout -b. Setting create_branch: true will cause a clone failure because the branch doesn't exist on remote yet.

BRANCH PARAM WARNING: Only pass branch for already-existing remote branches (e.g. to resume work on a branch that was previously pushed). For new branches, omit branch entirely — include git checkout -b <name> in the task steps instead. Passing a branch that does not exist on the remote will cause an immediate clone failure ('fatal: Remote branch not found').

Parameters:

  • repo_url: GitHub repo URL (https://github.com/owner/repo)

  • task: Full task description. A workflow preamble is auto-injected before your task.

  • create_branch: ALWAYS false. The agent manages its own branch.

  • branch: Existing remote branch to checkout (see BRANCH PARAM WARNING above)

  • claude_token: Optional Claude API token override

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalNoLoopJob: verifiable intent — what 'done' looks like. Required when completion_criteria is set. Injected into the quality eval agent prompt.
taskYesTask description to pass to Claude Code. A workflow preamble is auto-injected before this task.
modelNoModel override for this job (e.g. 'claude-sonnet-4-5'). Defaults to CC_AGENT_DEFAULT_MODEL env var or 'claude-sonnet-4-5'.
branchNoExisting remote branch to checkout after cloning. Only pass this for branches that already exist on the remote. DO NOT pass a new branch name here — it will cause clone failure ('fatal: Remote branch not found'). New branches must be created by the agent via git checkout -b inside the task.
chat_idNoDiscord/Telegram chat ID to include in the completion notification payload. When set, cc-discord routes the notification back to the originating channel.
repo_urlYesGit repository URL to clone (https or ssh)
fast_modeNoIf true, inject /fast at session start to enable fast mode (faster output, same model). Default: false.
depends_onNoJob IDs that must be done before this job starts. Job will be queued as pending until all dependencies complete.
session_idNoSession ID to resume from a previous job (use sessionIdAfter from a prior job). Passes --continue to Claude CLI.
smoke_testNoShell command to run as a cheap pre-check before the full task. If it exits non-zero or times out, the job fails immediately. Example: 'npm test -- --testPathPattern=smoke 2>&1 | tail -5'
agent_modelNoModel override for the selected driver (e.g. 'qwen2.5-72b-instruct', 'kimi-k2', 'gpt-4o'). Optional.
no_preambleNoIf true, no preamble is injected — the raw task is passed directly to the agent. Overrides custom_preamble.
ollama_hostNoOllama host URL (default: 'http://localhost:11434'). Only used when ollama_model is set.
agent_driverNoWhich agent driver to use. One of: claude (default), aider, openai, qwen, kimi, deepseek, pi, gemini, amp, codex. Defaults to 'claude' (Claude Code). gemini requires GEMINI_API_KEY, amp requires AMP_API_KEY, codex requires OPENAI_API_KEY.
claude_tokenNoClaude OAuth token or Anthropic API key to use for this job (optional — falls back to server env)
effort_levelNoToken spend strategy. Maps to Claude Code's /effort command injected at session start. 'low' = minimal tokens, fast and cheap. 'high'/'xhigh'/'max' = more thorough, higher cost. 'auto' = let the model decide. Default: unset (Claude Code default).
ollama_modelNoIf set, route Claude Code through Ollama using this model name (e.g. 'nemotron-3-nano', 'deepseek-r1:7b'). Sets ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY=ollama, and CLAUDE_MODEL env vars.
create_branchNoALWAYS false. The agent creates its own branch with git checkout -b. Setting this to a branch name will cause a clone failure because the branch does not exist on remote yet.
max_budget_usdNoMaximum USD budget for this Claude Code session (optional, default 20)
max_iterationsNoLoopJob: maximum number of worker iterations before declaring loop_exhausted. Default 3. Hard cap 3.
openai_api_keyNoAPI key override for OpenAI-compatible drivers. Falls back to OPENAI_API_KEY / driver-specific env var.
quality_rubricNoLoopJob: rubric injected into the quality eval agent. Describes what good output looks like. If omitted, quality gate is skipped.
custom_preambleNoCustom workflow preamble to inject before the task. If set, replaces the default cc-agent workflow preamble entirely. Use no_preamble to remove the preamble completely.
openai_base_urlNoBase URL for OpenAI-compatible API endpoint. Only used when agent_driver is openai/qwen/kimi/deepseek/pi.
timeout_minutesNoWall-clock timeout in minutes per active run. Job is terminated (SIGTERM then SIGKILL) if it exceeds this limit. Set to 0 to disable. Default: 120 (2 hours).
continue_sessionNoPass --continue to Claude Code to resume the most recent session in the repo directory (optional, default false)
docker_isolationNoRun agent in Docker container for isolation. Default: false. Requires Docker to be running. On macOS, Docker runs in a VM — use only when isolation is specifically needed.
smoke_test_timeoutNoTimeout for the smoke test in seconds (default 60). Only used when smoke_test is set.
spawning_namespaceNoNamespace of the caller (e.g. 'simorgh-mobile-app'). When set, job completion notifications are routed to cca:notify:{spawning_namespace} instead of the server's default namespace. Use this when spawning from a meta-agent so the completion signal returns to your namespace.
completion_criteriaNoLoopJob: list of shell commands run after the worker finishes. Each command runs in the cloned repo directory. All must exit 0 for the completion gate to pass. Presence of this field opts the job into the loop engine.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the full agent workflow (clone, branch, implement, test, commit, push, PR, merge, publish) and warns about clone failure scenarios for incorrect parameter usage. It explains auto-injected preamble and behavior of various parameters like fast_mode and effort_level.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with a clear workflow overview, bolded warnings, and a parameter list. Every section adds value, though the parameter list largely duplicates the schema. Given the tool's complexity, the length is justified, and the structure aids readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 30 parameters and no output schema or annotations, the description covers the core workflow, critical parameter pitfalls, and session management. It explains the auto-injected preamble and loop job basics (completion_criteria, goal) adequately. Missing details about return values are compensated by sibling tools (get_job_status).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, providing baseline 3. The description adds meaningful context beyond the schema, especially the BRANCH PARAM WARNING and important notes on create_branch and branch parameters, which are critical for correct usage. Without these additions, agents could easily cause failures.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description starts with a specific verb ('Spawn') and resource ('Claude Code agent on a GitHub repository'). It clearly distinguishes from all sibling tools, which deal with jobs, costs, profiles, etc. No sibling performs agent spawning.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit warnings are provided for critical parameters (create_branch, branch) with clear instructions on when to set false or omit. The workflow is outlined. However, it does not explicitly state when NOT to use this tool or list alternatives, though no direct alternative exists among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gonzih/cc-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server