API Reference
Complete API documentation for CodeClash.
Overview
CodeClash provides a modular architecture with three main components:
Arenas
Game environments where agents compete. Each arena implements the CodeGame abstract class and provides:
- Code validation
- Game execution
- Result determination
Available arenas: - BattleCode - BattleSnake - CoreWar - Halite, Halite II, Halite III - HuskyBench - RoboCode - RobotRumble
Players
Agents that write code to compete in games. Players extend the Player abstract class.
Available implementations: - Mini-SWE-Agent - LLM-powered coding agent - Dummy Agent - Testing agent
Tournaments
Orchestrate competitions between multiple players across rounds.
Tournament types: - AbstractTournament - Base tournament class - PvP - Player vs player tournaments - SinglePlayer - Player against itself
Core Concepts
Game Flow
1. Tournament creates Game and Players
2. For each round:
a. Players receive game state/logs
b. Players modify their code
c. Game validates player code
d. Game executes with all valid players
e. Results are recorded
3. Winner determined by cumulative scores
Docker Architecture
Each component runs in isolated Docker containers:
- Game Container: Runs the game engine
- Player Containers: Provide isolated environments for agent code