Token Saving
PreviewToken X-Ray
Section titled “Token X-Ray”Token X-Ray records tool inputs and outputs for a runtime and flags common sources of context growth. Capture is off by default.
Enable capture
Section titled “Enable capture”Enable Token X-Ray when creating or editing a runtime in the dashboard. For
the CLI, add --llm-tool-io-capture:
runta run \ --name xray-demo \ --cpus 2 \ --memory 2048 \ --llm-tool-io-captureFinding examples
Section titled “Finding examples”- Large output
- A command returns a 10 MB build log.
- Repeated content
- The same warning appears 500 times.
- Repeated keys
- A large JSON array repeats the same object fields.
- Repeated paths
- Every result starts with
/workspace/project/src/. - Repeated calls
- The same search runs twice with identical output.
The dashboard shows captured calls, estimated tokens, detected findings, and potential savings.
Limits
Section titled “Limits”Token estimates use ceil(characters / 4) and are not billing data. Truncated
or unparseable captures are marked as issues. Captured payloads may contain
application data and should be treated as untrusted input.
Token Compression
Section titled “Token Compression”Token Compression intelligently shortens agent tool output before sending them to the AI model, saving tokens. It’s off by default.
Enable compression
Section titled “Enable compression”Enable Token Compression when creating or editing a runtime, then select the methods to apply.
Methods
Section titled “Methods”- JSON arrays
- A repetitive array keeps representative records.
- Logs
- A build log keeps errors, warnings, and nearby lines.
- Search results
- A large result set keeps the highest-ranked matches.
- Git diffs
- A large diff keeps changed lines with limited context.
Compression does not modify runtime files or command results. Unsupported outputs pass through unchanged.
