Chimera can run 2.0–3.3× leaner: ten changes cut weighted token spend 50–70% without slowing shipping

Asked (summary):Solo game-dev project (Chimera, a large Unity 6 URP tactical RPG) runs a multi-agent AI setup and wants to cut token/quota spend by several times without slowing development: analyze the setup and propose concrete improvements — ranked waste, repo-side context engineering, role design, model routing, workflow, compact communication, a Battle Brothers-inspired visual pipeline, metrics, templates, expected savings/effort/risks, a role diagram, and sources.

Ten ranked changes, each with a stage-level saving range (overlapping percentages of different bases — never add them), adoption effort and a named risk, backed by seven primary evidence rows from five independent hosts (no URL backs more than one row). The attainable target is a 50–70% reduction in weighted spend at equal or faster throughput; 3–4× is possible in visually heavy months. All estimates are hypotheses to validate with two weeks of telemetry, not vendor benchmarks.

Impact versus effort: where the spend goes away

Bubble size = top of the stage-level saving range; vertical line = the low–high range. Percentages apply to different, overlapping bases (total spend, coding spend, model cost…) — they must not be added. Colour marks the base each saving applies to.

What the bubbles cannot say

Visual work dominates current waste: the top-ranked change alone is worth 25–40% of total spend in the visual-heavy phase, built on Unity's known-good image comparison.

docs.unity3d.com

Three of the ten changes need only low adoption effort — model cascade, artifact handoffs, budgets+telemetry — yet together address 30–65% of weighted model cost and handoff spend (overlapping, not additive).

anthropic.com

Context discipline is sourced practice, not hypothesis: SWE-agent caps search output at 50 results and asks for a narrower query; the repo context plane applies the same rule to Chimera.

arxiv.org

Prompt caching pays only with an identical stable prefix; the saving on opaque CLI or subscription products may be negligible, so measure cache-read tokens first.

platform.claude.com

New role diagram: one owner per concern, no standing critics

Human ownerTaste/product decisions, scope changes, merge approval, phone playtests
Thin coordinator — ChimeraState machine, priority queue, routing, budget enforcement, decision inbox; memory is a compact project ledger, not transcript history
Design/architecture pass (optional)Strong model, only for cross-module contracts, save/schema, novel systems, shader/pipeline design; writes an approved plan/ADR and exits
Coding workerExactly one implementation owner per task, picked by routing policy (Codex low/medium, Sonnet-class, or other); cannot merge main
Trusted verifier — no LLMPreflight, Unity compile, targeted/impacted/full tests, screenshots, image diff, cache, artifact manifest
Visual gateDeterministic comparison first; small stateless vision rubric second; independent human checkpoint only at style lock/milestones; critic returns at most three ranked defects
Art director / generatorReference-pack and style-lock work plus large candidate batches only; not a standing participant in every loop
ResearchKeenable/cheap page reader only when a named uncertainty survives local docs

Removed: the background executor as a reasoning/code-fixing role (kept only as a shell job runner). “Chimera Unity” folds into versioned repo docs plus the verifier. 3D Gen Lab stays dormant. Art direction and final critique stay independent but shrink to milestone gates, with the deterministic visual layer between them.

Model routing matrix

No model
Branch/worktree checks, index generation, symbol/asmdef graph, compilation, tests, log filtering, screenshot capture/diff, cache lookup, JSON validation
Local small / Flash–Haiku class
Classify known errors, compress logs to a fixed schema, pick a test filter from tests.json, format briefs, docs-only changes, mechanical renames after compiler guidance. Never approves architecture, visual quality, or a merge
Codex low / cheap coder
Localized fix: known files, known pattern, no save/public-API/serialization change, ≤~3 files, existing targeted test, low rollback cost
Codex medium / Sonnet-class
Multiple modules, state-mutation paths, ActionExecutor/BattleContract, save v12 migration, Unity serialization, URP/shaders, procedural generation, hard debugging, or any task already failed once
Strongest design model
One short spec/ADR for novel architecture, ambiguous visual pipeline, high-cost nondeterminism, or decisions whose wrong implementation causes several long Unity/vision loops; then hand the plan to a cheaper executor

Route by expected cost, not price per call: go strong first when a cheap failure costs two or more long verification cycles, or when historical first-pass yield for the task class is below 60–70%. Escalate after the first substantive failed attempt, not the third.

Workflow: nine steps from intake to merge

1

Intake writes a one-paragraph acceptance contract; classifies risk, module, visual impact.

2

Router reads AGENTS.md plus exactly one module map and queries the generated index; no chat transcript is inherited.

3

High-risk only: a strong planner writes one ADR/plan; the human approves only true product/taste decisions.

4

Break work into 3–5 coherent slices; separate behavior from visual tuning; test-first for Core rules and regressions, deterministic capture for exploratory art.

5

One coder executes the batch: edit, compile or targeted test, update status.json per slice. No full suite, no semantic image review here.

6

Host verifier runs impacted tests and fixed-seed captures; failures return compact signatures; small vision only on changed regions with the fixed rubric.

7

Batch green: full EditMode suite once on the exact candidate SHA, one contact sheet, result cached under the full verification identity.

8

Reviewer sees only diff, contract/serialized changes, test summaries, risks. Human gets a decision card and playtest link; merge only with human OK.

9

Close by updating module docs/indexes in the same change when boundaries, commands, tests or invariants changed.

Copyable templates

AGENTS.md — root router (100–200 lines; routes, never duplicates architecture docs)
# Chimera agent entrypoint Updated-for: <git SHA> Owner: human ## Non-negotiable invariants - Work only in the assigned worktree/feature branch; never merge or push main. - All campaign state mutations enter through `Core/ActionExecutor`. - Battle changes respect `Core/BattleContract`. - Save format is v12; serialized/schema changes require an explicit migration decision. - Desktop is primary; WebGL is playtest-only. ## Cold-start read order 1. This file. 2. The one `MODULE.md` named by task.yml. 3. `tools/agent/find <symbol|feature>`; open source only after that. 4. Read an ADR only if the task references it. ## Module router | Area | Module map | Assembly | Test key | | Core | `Assets/.../Core/MODULE.md` | `Chimera.Core` | `core` | | Battle | `Assets/.../Battle/MODULE.md` | `Chimera.Battle` | `battle` | | Campaign | ... | ... | ... | | Terrain | ... | ... | ... | | UI | ... | ... | ... | ## Standard commands - Preflight: `./tools/agent/preflight --task <id>` - Context: `./tools/agent/find --task <id> --budget 2000` - Verify targeted: `./tools/verify --task <id> --level targeted` - Verify impacted: `./tools/verify --task <id> --level impacted` - Candidate: `./tools/verify --task <id> --level candidate` ## Editing policy - Edit only `allowed_paths` in task.yml; request expansion instead of wandering. - Do not emit broad grep, full logs or full repo trees. A query over the output cap must be narrowed. - Reuse existing patterns. New public abstractions require an approved plan/ADR. - Update the module map when entry points, invariants, commands or tests change. ## Stop/escalate Stop and report BLOCKED on an invariant conflict, unexpected serialized change, write/Unity/license failure, required edit outside scope, second failure with the same signature, or budget exhaustion. ## Completion contract Write `status.json` and `run-report.json`; include commit/base SHA, changed paths, verification IDs, risks and artifact paths. Do not paste full logs/images into chat.
MODULE.md — per-module map (80–150 lines, near its asmdef)
# Battle module map Freshness: <source SHA> Assembly: Chimera.Battle Owner/gate: <role> ## Purpose / non-goals <2-4 lines; say what belongs here and what does not> ## Entry points - `BattleController.Start...` — orchestration - `BattleContract...` — public boundary ## Public contracts and data flow Input -> validation -> ActionExecutor/BattleContract -> events/view refresh. List public interfaces, events and serialized assets; link source paths, do not paste code. ## Invariants - <testable rule> - <mutation/turn-order/ZoC rule> ## Dependency boundary May depend on: ... Must not depend on: ... Reverse dependents: query `tools/agent/find --reverse Chimera.Battle`. ## Change recipes | Intent | Start symbols/files | Required tests | Visual capture | ## Tests - Fast filter: `<exact assembly/category/name command>` (~N sec) - Impacted filter: ... (~N sec) - Fixtures/scenes/seeds: ... ## Assets and visuals Scenes, prefabs, shaders, reference-image IDs, supported resolutions. ## Known traps / escalation Unity serialization, Editor-only APIs, nondeterministic seeds, platform differences. ## Freshness rule Update this file when a public contract, invariant, entry point, test key or asset owner changes.
task.yml — immutable task brief with budgets and stop rules
id: CHI-#### title: <one outcome> base_sha: <sha> branch: playtest-batch module: battle risk: low|medium|high model_hint: cheap|medium|strong-plan goal: <one sentence> non_goals: [<explicit exclusions>] acceptance: - id: A1 observable: <behavior or image condition> - id: A2 test: <exact expected test> invariants: [ActionExecutor-only mutation, BattleContract preserved, save-v12 unchanged] allowed_paths: [<3-8 paths/globs>] entry_symbols: [<symbols from index>] references: [<ADR/reference-pack IDs; no pasted images>] verification: targeted: [<test key>] impacted: [<test key>] captures: [{scene: ..., seed: ..., resolution: ..., baseline: ...}] budget: tool_calls: 30 input_tokens: 50000 retries_same_signature: 1 stop_when: [scope expansion, invariant conflict, environment failure, budget reached] report_to: .agent/runs/CHI-####/run-report.json
run-report.json — compact run report (plus an overwriteable status.json during execution)
{ "schema": 1, "task": "CHI-####", "status": "PASS|FAIL|BLOCKED|NEEDS_DECISION", "base_sha": "...", "result_sha": "...", "model": {"name": "...", "effort": "low|medium|high"}, "usage": {"input_tokens": 0, "cached_input_tokens": 0, "output_tokens": 0, "tool_calls": 0, "wall_seconds": 0}, "changed_paths": ["..."], "public_or_serialized_changes": [], "verification": [ {"id": "targeted:...", "status": "PASS", "passed": 0, "failed": 0, "seconds": 0, "cache": "hit|miss", "artifact": "..."} ], "visual": {"captures": 0, "deterministic_diff": "PASS|FAIL|NA", "vision_calls": 0, "contact_sheet": "path-or-null"}, "errors": [{"signature": "...", "exit_code": 1, "excerpt": "<=40 lines", "artifact": "..."}], "risks": ["..."], "decision": {"needed": false, "question": null, "options": []}, "next": "merge-candidate|rework|human-decision" }

Metrics and budgets

Per run, record identity (task, slice, module, SHAs, model, effort, schema version), cost (input / cached-input / output tokens, quota units, vision calls, images), work (wall/queue/model/tool time, tool calls by type, files read, time-to-first-useful-edit), verification (compile and test durations, reruns, cache hit/miss, diff status, flaky failures), outcome (first-pass accepted, rework, rollback, human intervention) and a failure taxonomy. The primary denominator is accepted slices without human code repair, not lines of code. Initial budgets: small task ≤15K input / 15 tool calls; medium ≤40K / 30; large = a separate ≤20K strong design pass plus ≤60K execution. Alerts fire on >20K input before first edit, a second identical error signature, >30 calls without a tested diff, any executor code edit, more than two visual-model cycles, or a repeated full suite on the same SHA. Validate with a two-week A/B on matched task classes: baseline one week, then adopt changes 2, 4, 7 and telemetry, then add context maps and visual gates.

First 7 days

  1. Stand up the preflighted host verifier (branch/worktree, Unity lock, license, disk, writable paths, package lock, tool versions; print the environment).
  2. Adopt task.yml, status.json and run-report.json schemas; move handoffs out of chat.
  3. Enforce the role boundary rule: executor is a shell job runner only; one coding owner per task; no executor code edits.
  4. Turn on per-run telemetry and budgets (small ≤15K input/15 calls, medium ≤40K/30, large = ≤20K strong plan + ≤60K execution) with the alert list.
  5. Pilot one visual baseline: versioned reference pack, fixed seeds/cameras/resolutions, one Graphics Test Framework comparison, one contact sheet of 8–16 candidates.

Linked evidence: sourced mechanisms behind the hypotheses

These sources establish the mechanisms (focused subagents with condensed summaries, stable cache prefixes, short instruction files, bounded search output, known-good image comparison). The saving percentages are project-specific hypotheses to measure, not claims from these pages.

About the Graphics Test Framework | Graphics Tests Framework | 8.5.1-exp.1

Use the Graphics Test Framework package to create automated tests for rendering outputs - tests that render an image and compare it to a 'known good' reference image.

The framework provides an ImageAssert.AreEqual() assertion method that checks two images for equality (with an overload that automatically captures camera output), and it can automatically generate test cases based on the scenes in the project and manage reference images for them.

Caveat Actual/Diff images cannot be retrieved from test results when running in-player tests from the Unity Test Runner interactively; the commandline must be used instead. Additionally, on Android and WebGL platforms a different test setup pattern using asynchronous reference image loading is required.

docs.unity3d.com

Agent-Computer InterfacesEnable Automated Software Engineering

Cap search tool output: have search commands return at most 50 results per query, and when a search produces more than 50 results, withhold the results and instead prompt the agent to write a more specific query.

Language models are sensitive to long or unexpected tool outputs, which are distracting and consume a large share of the model's limited context window; suppressing verbose search results keeps the agent's context concise and encourages efficient searches.

arxiv.org

Building effective agents

Start by using LLM APIs directly instead of frameworks, and only increase complexity when needed — many agentic patterns can be implemented in a few lines of code.

Frameworks create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug, and can make it tempting to add complexity when a simpler setup would suffice.

Caveat If you do use a framework, ensure you understand the underlying code, because incorrect assumptions about what's under the hood are a common source of customer error.

www.anthropic.com

Effective context engineering for AI agents

Use sub-agent architectures for long-horizon tasks: specialized sub-agents handle focused tasks with clean context windows and explore extensively, but return only a condensed, distilled summary of their work (often 1,000-2,000 tokens) to the coordinating lead agent.

It achieves a clear separation of concerns: the detailed search context remains isolated within sub-agents, while the lead agent focuses on synthesizing and analyzing the results, and this pattern showed a substantial improvement over single-agent systems on complex research tasks.

Caveat The choice between compaction, note-taking, and multi-agent architectures depends on task characteristics; multi-agent architectures are suited to complex research and analysis where parallel exploration pays dividends, while compaction maintains conversational flow and note-taking excels for iterative development with clear milestones.

www.anthropic.com

Unity - Manual: Creating assembly assets

Put your tests in test assemblies (Assembly Definitions that Unity expects to contain tests) to modularize test code separately from application code.

They keep your test code separate from the application code you’ll ship to users, so the test code can be compiled only when needed.

Caveat Test assemblies are not compiled as part of the regular build pipeline, so any code placed in a test assembly is excluded from a standard project build; if production code unexpectedly doesn’t compile into the project build, double-check that it’s not in a test assembly.

docs.unity3d.com

Using custom instructions to unlock the power of Copilot code review - GitHub Docs

Keep custom instruction files for Copilot code review short and focused, limiting any single instruction file to a maximum of about 1,000 lines.

Shorter instruction files are more likely to be fully processed by Copilot, since very long instruction files may result in some instructions being overlooked due to context limits.

Caveat Beyond about 1,000 lines, the quality of responses may deteriorate, and Copilot may not follow every instruction perfectly every time due to non-deterministic behavior.

docs.github.com

Prompt caching (Claude platform docs)

Place `cache_control` on the last block whose prefix is identical across the requests you want to share a cache; for a prompt with a static prefix and a varying suffix (timestamps, per-request context, the incoming message), put the breakpoint at the end of the static prefix, not on the varying block.

Cache writes occur only at the marked breakpoint, as a cumulative hash of the prefix ending there; if the breakpoint sits on content that changes every request, the prefix hash never matches and you pay for a fresh cache write on every request with no reads, whereas moving the breakpoint to the last stable block lets every subsequent request read the cached prefix, reducing processing time and costs.

Caveat The lookback can only find entries that earlier requests already wrote, and the lookback window is 20 blocks: if a growing conversation pushes your breakpoint 20 or more blocks past the last cache write, the lookback window misses it, so you must add a second breakpoint closer to that position from the start.

platform.claude.com

All ten changes

#ChangeExpected savingOf what (base)AdoptionMain riskSource
1Style contract + deterministic visual regression25–40%total spend in visual-heavy phase (50–75% of visual-review spend)mediumPixel diffs miss style issues, noisy across GPU/driver; keep per-platform baselines and human style gatesdocs.unity3d.com
2Remove duplicate cognition (one coding owner)20–35%orchestration/coding overheadmediumFewer redundant checks; compensate with machine-enforced invariants, not another generalistwww.anthropic.com
3Repo context plane (maps + generated indexes + bounded query)15–30%coding-agent input tokensmediumStale maps are worse than none; generate from current commit, fail preflight on stale hashesarxiv.org
4Trusted preflighted Unity verifier service5–15%overall + nearly all permission/cache/lock rerunslow–mediumWrapper maintenance, hidden env differences; version and print the verifier environmentdocs.unity3d.com
5Plan once, coherent batch, risk-based test matrix10–25%coding-session spendmediumBatches get too broad; cap touched modules, each slice leaves a tested checkpointdocs.unity3d.com
6Explicit model cascade with early escalation15–35%dollar/quota-weighted model costlowUnder-routing creates rework; track first-pass yield by task class, update monthlywww.anthropic.com
7Artifact-based handoffs (task.yml / status.json / run report)10–20%orchestrator context and handoff spendlowOvercompression hides evidence; every summary keeps pointers to exact artifactswww.anthropic.com
8Diff-scoped review + exact verification-identity caching5–15%review and verification spendmediumWrong impact mapping; default to wider verification on uncertain dependenciesdocs.github.com
9Stable prefixes + provider prompt caching5–15%eligible API orchestration/research trafficlow–mediumProvider minima, TTLs, pricing; measure cache-read tokens, do not assumeplatform.claude.com
10Run budgets + telemetry with stop rules5–10%direct, plus indirect: exposes the other ninelowOptimizing tokens over accepted progress; primary metric is accepted slice without human repairwww.anthropic.com

Method: advisory analysis of one multi-agent Unity 6 URP project (Chimera). 10 proposed changes with stage-level saving ranges (percent of differing, overlapping bases — not additive), adoption effort and risks, plus 7 primary evidence rows across 5 independent hosts (max one row per URL), compiled for this report. Savings are hypotheses to validate with two weeks of run telemetry; raw per-run telemetry and full source pages are cut for space.

This report was generated automatically by Keenable SELECT at a user's request, from publicly available web sources linked herein. Keenable does not review, verify, or endorse its contents and makes no representation as to accuracy, completeness, or timeliness; AI-based extraction may contain errors. Nothing in this report is investment, legal, financial, or other professional advice. All trademarks and referenced content remain the property of their respective owners; no affiliation or endorsement is implied. To report an error, rights concern, or request removal: legal@keenable.ai.

Keenable SELECTAsk your own question
Made with Keenable SELECT