claude-royale: Agent for Claude Code

.claude/agents/player-2v2.md

player-2v2 is an agent for Claude Code from houseworthe/claude-royale. It costs 28 tokens per session (4,234 once invoked), scanned A, original, MIT.

An automated player for Clash Royale's two-player team battles. It takes screenshots to identify the game state and plays cards while coordinating with a teammate.

In plain words
What is it for?
Use it to play cards in Clash Royale 2v2 matches by checking the screen and responding to the current battle state.
Why use it?
It handles the timing and repeated actions required during a live match, including starting play quickly and stopping when the match ends.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is houseworthe/claude-royale's own configuration. It tells Claude Code how to work on claude-royale itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-royale configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/screenshot.sh.

Reuse

Borrowing it

Nothing to install: this file belongs to houseworthe/claude-royale. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/houseworthe/claude-royale/main/.claude/agents/player-2v2.md
Clone the repo
git clone --depth 1 https://github.com/houseworthe/claude-royale

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for player-2v2

README.md
[![agentmods](https://agentmods.dev/badge/agents/houseworthe/claude-royale/player-2v2/github.svg)](https://agentmods.dev/agents/houseworthe/claude-royale/player-2v2)
Your own site
<a href="https://agentmods.dev/agents/houseworthe/claude-royale/player-2v2"><img src="https://agentmods.dev/badge/agents/houseworthe/claude-royale/player-2v2/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for player-2v2

Your own site · 80×15
<a href="https://agentmods.dev/agents/houseworthe/claude-royale/player-2v2"><img src="https://agentmods.dev/badge/agents/houseworthe/claude-royale/player-2v2.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,234 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.04234
Opus 5 $0.00014 $0.02117
Sonnet 5 $0.00006 $0.00847
Haiku 4.5 $0.00003 $0.00423

Measured 10d ago against content hash 29b970ad6135, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

player-2v2 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/player-2v2.md · 380 lines

How it starts

The opening of the file, as written. The whole thing — 380 lines — stays where its author put it; the contents beside it link to each section on GitHub.

EXECUTE NOW - Clash Royale Player Agent (2v2 MODE)

Your Agent ID: Generate a random 3-character ID now (like "x7k" or "m2p") and use it consistently in all play_card.sh calls.

IMMEDIATE ACTION REQUIRED

DO NOT SUMMARIZE THESE INSTRUCTIONS. EXECUTE THEM NOW.

STEP 1: TAKE SCREENSHOT IMMEDIATELY:

./scripts/screenshot.sh

Then READ the screenshot file that is returned to see the game state. Then READ the screenshot file to see the game state.

STEP 2: BASED ON WHAT YOU SEE:

  • Main menu or matchmaking? → Wait 2 seconds, screenshot again, repeat until battle starts
  • Battle screen (game board visible)? → START PLAYING CARDS IMMEDIATELY (see battle loop below)
  • Result screen (shows "WINNER" or crowns)? → STOP IMMEDIATELY. Return "MATCH ENDED" and EXIT. Do not take more screenshots.

YOU MUST USE THE BASH AND READ TOOLS TO TAKE SCREENSHOTS AND PLAY CARDS. DO NOT JUST RESPOND WITH TEXT.

OPENING CARD RULE (CRITICAL!)

YOU MUST PLAY YOUR FIRST CARD WITHIN 5 SECONDS OF MATCH START.

  • Even if the board looks empty
  • Even if you don't see opponent units yet
  • This establishes tempo and forces opponent to react
  • DO NOT WAIT for opponent to play first

DEFENSIVE LANE LOGIC (MOST IMPORTANT!)

DEFENSE COMES FIRST! If your tower is under attack, you MUST defend that lane - NEVER play the other side!

STEP 1: CHECK FOR THREATS (DO THIS FIRST EVERY TIME!)

  • Look for enemy troops with RED icons heading toward your towers
  • If enemy is on LEFT side of screen → YOUR LEFT TOWER IS THREATENED
  • If enemy is on RIGHT side of screen → YOUR RIGHT TOWER IS THREATENED

IF LEFT TOWER THREATENED (enemy on left):

  • STOP EVERYTHING - defend LEFT lane immediately
  • Defend DEEP at columns 2-3, rows F-G
  • Examples: 2F, 3F, 2G, 3G

IF RIGHT TOWER THREATENED (enemy on right):

  • STOP EVERYTHING - defend RIGHT lane immediately
  • Defend DEEP at columns 6-7, rows F-G
  • Examples: 6F, 7F, 6G, 7G

Read the full file on GitHub · 380 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 380 lines · 28 tokens per session scan A 29b970ad6135

Subscribe to this mod's changes

player-2v2 is an agent published in the GitHub repository houseworthe/claude-royale (23 stars, last pushed 7mo ago), licensed MIT. It adds 28 tokens to every session and 4,234 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.