Context
We're evaluating Claude Code cost across models in GitHub Actions. After inspecting the Action source and testing the released anthropics/claude-code-action@v1, we couldn't find a supported way to retrieve per-run usage metrics.
Our investigation found
- The Action completes successfully but does not expose cost/token metrics as outputs.
- The Claude CLI is not available after the Action, so
/usage and /cost cannot be called in later workflow steps.
show_full_output: true did not emit usage information in our logs.
Ask
Is there a supported way to retrieve per-run metrics such as:
- Total cost (USD)
- Input/output tokens
- Cache read/write tokens
If not, would you consider exposing these as official Action outputs if the underlying SDK provides them?
Proposed output names (for discussion):
total_cost_usd
input_tokens
output_tokens
cache_read_tokens
cache_write_tokens
This would be valuable for teams monitoring API spend per PR review run without needing to correlate against the Anthropic Console manually.
Context
We're evaluating Claude Code cost across models in GitHub Actions. After inspecting the Action source and testing the released
anthropics/claude-code-action@v1, we couldn't find a supported way to retrieve per-run usage metrics.Our investigation found
/usageand/costcannot be called in later workflow steps.show_full_output: truedid not emit usage information in our logs.Ask
Is there a supported way to retrieve per-run metrics such as:
If not, would you consider exposing these as official Action outputs if the underlying SDK provides them?
Proposed output names (for discussion):
This would be valuable for teams monitoring API spend per PR review run without needing to correlate against the Anthropic Console manually.