Token Reduction Benchmarks
June 22, 2026 ยท View on GitHub
This directory tracks token-cost measurements for the v0.0.43 low-token discovery changes across Unity Editor versions.
Each Unity version gets its own benchmark file because the connector behavior, package resolution, loaded assemblies, scene state, and Unity API surface can differ by version. Do not merge different Unity versions into one result table unless the table is explicitly a cross-version summary.
Scope
The benchmark focuses on CLI output payload size for commands that frequently come back into an AI agent context:
list --nameslist --compact- default
list find_gameobjectsdefault projectionfind_gameobjects --idsfind_gameobjects --namesfind_gameobjects --fields ...
The current v0.0.43 changes being measured:
list --compactnow aliaseslist --names.find_gameobjectsdefaults to{instance_id, name}.find_gameobjectssupports explicit projections:--ids,--names,--fields.
Measurement Method
For each Unity version:
- Open that exact Unity Editor version.
- Resolve
com.notnull92.hera-agent-unityto the localAgentConnectorunder test. - Run
editor refresh --compile --wait. - Confirm
console --type error --lines 50returns no connector compile errors. - Build or reuse the same realistic smoke scene shape for that Unity version.
- Measure combined stdout/stderr UTF-8 bytes for each CLI command.
- Estimate tokens as
ceil(bytes / 4).
PowerShell measurement sketch:
$out = & hera-agent-unity find_gameobjects --name Pickup --limit 20 --ids --compact-json 2>&1
$text = ($out | Out-String).TrimEnd("`r", "`n")
$bytes = [Text.Encoding]::UTF8.GetByteCount($text)
$tokens = [Math]::Ceiling($bytes / 4)
The estimate intentionally measures CLI payload bytes only. It does not include AI-client-specific tool-call wrapper overhead.
Version Results
| Unity version | File | CLI | Connector | Status | Key result |
|---|---|---|---|---|---|
2022.3.62f2 | 2022.3.62f2.md | v0.0.29 | 0.0.43 local | measured | list --compact ~1844T -> 93T; find_gameobjects --ids 54T |
2023.2.22f1 | 2023.2.22f1.md | v0.0.29 | 0.0.43 local | measured | list --compact 93T; find_gameobjects --ids 54T |
6000.0.x | pending | pending | pending | not measured | pending |
6000.3.5f2 | 6000.3.5f2.md | v0.0.29 | 0.0.43 local | measured | list --compact 93T; find_gameobjects --ids 49T |
6000.5.0f1 | 6000.5.0f1.md | v0.0.29 | 0.0.43 local | measured | list --compact 93T; find_gameobjects --ids 55T |
Recommended Agent Policy
Until a version-specific benchmark proves otherwise, use this low-token order:
hera-agent-unity list --nameshera-agent-unity list --compacthera-agent-unity list --tool <name>only for the specific tool about to be called- plain
hera-agent-unity listonly when descriptions are needed
For GameObject search:
find_gameobjects --idswhen feeding a follow-up command- default
find_gameobjectswhen the agent needs IDs and names find_gameobjects --fields instance_id,name,pathwhen duplicate names require hierarchy contextfind_gameobjects --fields allonly for diagnostics
Avoid expensive broad reads unless the extra data is needed for the current decision:
hera-agent-unity list
hera-agent-unity find_gameobjects --fields all
hera-agent-unity console --stacktrace full --lines 0