Measuring Off-Task Token Spend in Claude Code: The 'Undeclared-Intent' Metric

✍️ OpenClawRadar📅 Published: May 11, 2026🔗 Source
Measuring Off-Task Token Spend in Claude Code: The 'Undeclared-Intent' Metric
Ad

A developer building custom hooks for Claude Code created a metric called undeclared-intent spend to measure token usage outside the declared objective.

Key Findings

  • In one session, total compute was 5,137 tokens, with 1,173 (22.8%) classified as undeclared and 3,964 (77.2%) on-declared.
  • Undeclared spend captures cost of retries, loops, reasoning drift, and off-task execution — not just governance violations.
  • The metric treats cost as a behavioral signal, not billing telemetry alone.

Implementation Challenge

The hook surface doesn't always expose enough context to distinguish true drift from indeterminable intent. The author notes two distinct failure modes: genuine drift (wandered into unrelated files/systems) vs. indeterminable from hook data. Different responses needed per mode.

Example output format:

Total compute 5,137 tokens
Undeclared 1,173 tokens (22.8%)
Declared 3,964 tokens (77.2%)

No tool or library is shared in the source; the post is a discussion prompt. The author is interested whether others are measuring off-task compute or still treating token spend purely as billing/optimization.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also