SwarmForge Supported Agents: Claude, Codex, Copilot, and Grok Explained

SwarmForge supports four LLM agents: Claude, Codex, Copilot, and Grok, validated through an explicit whitelist in the core Babashka script.

SwarmForge, an open-source orchestration tool by Uncle Bob Martin, enables developers to assign specific AI agents to different roles within a software project. Understanding which SwarmForge supported agents are available is essential for configuring your roles.edn files and optimizing your development workflow.

The Four SwarmForge Supported Agents

According to the source code in swarmforge/scripts/swarmforge.bb line 169 and the project README line 62, SwarmForge recognizes exactly four backend agents:

  • Claude – Anthropic's Claude model, invoked with specific permission and system prompt configurations
  • Codex – OpenAI's Codex model for code generation and editing tasks
  • Copilot – GitHub Copilot's AI pair programming capabilities
  • Grok – xAI's Grok model, launched with distinct auto-approval and working directory handling

These agents are interchangeable per role, allowing you to assign different LLM backends to different responsibilities within your swarm.

How Agent Validation Works in SwarmForge

The system validates agent selection through an explicit whitelist defined in the main script. In swarmforge.bb, line 169 contains the validation set that restricts inputs to only the supported backends:

#{"claude" "codex" "copilot" "grok"}

If you attempt to configure an unsupported agent, the script throws an exception before execution:

;; Validate the requested agent
(when-not (#{"claude" "codex" "copilot" "grok"} agent)
  (throw (ex-info "Unsupported agent" {:agent agent})))

This validation ensures that only the four SwarmForge supported agents can be invoked, preventing runtime errors from invalid CLI commands.

Agent-Specific Launch Configurations

Each agent requires distinct command-line flags and environment setup. The launch logic in swarmforge.bb line 339 constructs appropriate shell commands based on the selected backend.

Claude Launch Parameters

When launching Claude, SwarmForge appends system prompt files and sets permission modes for automated editing:

(str "claude --append-system-prompt-file "
     (sq (str prompt-file))
     " --permission-mode acceptEdits -n "
     (sq (str "SwarmForge " display))
     " " (extra-args-prefix row)
     "\"$(cat " (sq (str prompt-file)) ")\"")

Grok Launch Parameters

Grok receives different handling, particularly around auto-approval detection and working directory specification:

(str "grok" (if (grok-wants-auto-approve? row) "" " --cwd ")
     (sq (str role-worktree)) " "
     (grok-permission-prefix row)
     (extra-args-prefix row)
     "--rules \"$(cat " (sq (str prompt-file)) ")\" "
     "--verbatim \"$(cat " (sq (str prompt-file)) ")\"")

Codex and Copilot Handling

Both Codex and Copilot follow similar validation patterns but receive backend-specific flag configurations appropriate to their respective APIs. The test suite in test/swarmforge/script_test.clj (lines 222-247) exercises these launch variations to ensure correct shell command generation across all supported agents.

Configuration and Usage

To specify an agent for a particular role, reference one of the four SwarmForge supported agents in your role configuration. The README documentation at line 62 confirms that valid role configurations may launch claude, codex, copilot, or grok as the backend driver.

When defining roles in your roles.edn file, ensure the :agent key matches exactly one of the whitelisted strings to pass validation and trigger the appropriate launch logic.

Summary

  • SwarmForge explicitly supports four agents: Claude, Codex, Copilot, and Grok
  • Validation occurs in swarmforge/scripts/swarmforge.bb using the whitelist #{"claude" "codex" "copilot" "grok"}
  • Each agent receives customized command-line flags tailored to its specific API requirements
  • The system throws an ex-info error if you attempt to use an unsupported backend
  • Agent-specific logic handles distinct features like Claude's permission modes and Grok's auto-approval detection

Frequently Asked Questions

Which LLM agents does SwarmForge support?

SwarmForge supports Claude (Anthropic), Codex (OpenAI), Copilot (GitHub), and Grok (xAI). These four backends are hardcoded into the validation logic at line 169 of swarmforge.bb and documented in the README at line 62.

How does SwarmForge validate agent selection?

The system uses a Clojure set containing the four valid agent strings to validate inputs. If the requested agent is not found in #{"claude" "codex" "copilot" "grok"}, the script throws an ex-info exception with the message "Unsupported agent" before attempting execution.

Can I use custom agents not in the whitelist?

No. The current implementation in unclebob/swarm-forge does not support custom or third-party agents outside the four officially supported backends. The whitelist validation explicitly rejects any agent name not matching the four predefined options.

Where is the agent configuration documented?

Agent support is documented in two locations: the source code comments in swarmforge/scripts/swarmforge.bb (lines 169 and 339) and the user-facing README.md (line 62). Additionally, the test suite in test/swarmforge/script_test.clj provides executable examples of agent launch configurations.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →