H-03Perception & StateEngineeringStrategy

Token Hygiene & High Observation Yield

Maximize useful signal per token: strip boilerplate and replace raw data firehoses with structured summaries plus drill-down pointers.

Human UXAgent AXAesthetic and minimalist design→Observation yield

Suppose an alert reaches an on-call agent at 03:12 on a Thursday. It says checkout-api is failing: 31% of requests return a 500, and customers can't pay. The agent's runbook is sensible. Before paging anyone, read the service's recent logs and find what changed.

It calls get_logs(service="checkout-api", since="15m"). Back comes a wall: 512 log lines of raw JSON, about 46,000 tokens. Every line repeats the pod name, the node, the container image and a trace ID. Three hundred of them are health checks saying 200 OK. Nearly two hundred are the same timeout error, each with a 30-line stack trace: TimeoutError: fraud-svc call exceeded 2000ms.

The agent reads all of it and draws the obvious conclusion. The fraud service is down. It pages the fraud team's on-call engineer and opens an incident against fraud-svc.

The fraud service is fine. Line 173 of 512, one warning among the noise, says db pool max changed 50 -> 5 (config v812). A config push at 03:02 cut the database connection pool to a tenth of its size. Requests wait so long for a connection that the fraud check, the last call in the chain, runs out of time. A tired engineer gets woken for nothing, and checkout stays broken for another 40 minutes while two teams argue over whose service it is.

Nothing in that log response was false. The answer was right there. The tool just buried it under 45,000 tokens of things that didn't matter, and the loudest thing in the pile won.

Why it happens

Give the same 512 lines to a human on-call engineer in a log viewer and they won't read them. Their eyes skip the gray health checks without effort. A histogram at the top shows errors starting at 03:02. They filter to warnings, and the pool change is the second row. Jakob Nielsen's eighth usability heuristic, aesthetic and minimalist design, warns that every extra unit of information competes with the relevant ones and dims them. People survive cluttered screens anyway, because they skim.

The agent can't skim. Everything a tool returns lands in its context window as tokens, and the model processes every one of them, in order, with nothing grayed out. A health check costs as much attention as the line that explains the outage. The Guide calls this literal exhaustive readingLexicon · 10Literal Exhaustive ReadingIngesting every returned token without human visual skimming.: the agent ingests every token you send, with none of the skimming a person does for free. Clutter a human ignores becomes work an agent has to do.

So the useful question about a tool response is how much of it helps the next decision, per token spent. In the hook, the useful part was perhaps 60 tokens: the pool change, its time, and the fact that errors started 30 seconds later. Sixty out of 46,000 is about 0.1%. The Guide's word for that ratio is observation yieldLexicon · 25Observation YieldUseful, decision-relevant signal per token returned by a tool.: useful, decision-relevant signal per token a tool returns. A response with low yield is the context equivalent of a cluttered screen, with no eyes to skip the clutter.

Low yield does worse than waste space. Large, repetitive blocks of text pull the model's next thoughts toward themselves. One hundred ninety-six copies of "fraud-svc timeout" make fraud-svc the most likely subject of the agent's next sentence, whatever the evidence says. This pull has a name: token gravityLexicon · 16Token GravityBulky or salient tokens warping subsequent next-token probabilities toward themselves., the way bulky or salient tokens warp what the model writes next. The single warning has almost no mass. The timeouts are a planet.

The answer was in the response. It just weighed less than the noise.

The figure below takes the hook's log response through four stages of cleanup. Step from the raw firehose to a summary with a pointer, and watch two gauges move in opposite directions: total tokens fall, and yield climbs. Watch, too, what the agent would read first at each stage.

> get_logs(service="checkout-api", since="15m")TokensObservation yieldRead first46,0000.1%10,2000.6%36033%15080%196 fraud-svc timeoutsthe db pool change

512 full JSON lines. Every line repeats pod, node, image and trace ids, and each error carries a stack trace.

Reads first: TimeoutError: fraud-svc call exceeded 2000ms ×196

Stage 1 of 4, Raw firehose: 46,000 tokens, 60 signal tokens, yield 0.1%.

Fig. 3.1The Observation Yield Scrubber. One log response, four stages. Stripping repeated metadata cuts tokens but barely moves yield. Grouping and filtering is where yield jumps, and the summary puts the one line that matters first, with a pointer back to the raw lines. Numbers are illustrative.

Notice that stage 2 helps less than it looks. Dropping the pod names and trace IDs cuts the response by three quarters, but it is still 512 lines, and the timeouts still outweigh the warning 196 to 1. The big win comes from grouping identical lines into one line with a count. A count tells the agent "this happened 196 times" in ten tokens, where the raw lines told it the same thing in 30,000.

What it costs

Wrong actions. The worst cost of a firehose is a confident wrong conclusion. In the hook, it was a page to the wrong team and an incident filed against a healthy service. The same shape shows up everywhere: an agent blames the test that failed loudest instead of the one that failed first, or acts on the first record in a 200-record API dump because it was on top.

Tokens and latency, every call. A 46,000-token response is paid for in money, in seconds of processing, and in window space. If the agent calls get_logs three times during an incident, which is normal, that is close to 140,000 tokens of mostly health checks. At any model price, paying for 46,000 tokens to read 60 is a bad trade.

Lost findings. Context windows fill up. When they do, harnesses compress older turns into a summary to make room. The Guide calls this context compactionLexicon · 45Context CompactionLossy compression of a session ribbon to reclaim window capacity., and it is lossy: the summary keeps what looked important. After a few firehose responses, what looked important was 196 timeouts. The single warning, if the agent ever noticed it, is the first thing to go.

Supervision and trust. The fraud engineer woken at 03:15 will not want the agent paging people again. The likely response is a rule that a human must approve every page, and the agent stops being an on-call helper.

The fix

In plain words: every token a tool returns should earn its place. Return the shape of the data first, then let the agent drill into the parts it needs. In practice that means five moves.

  1. Strip chrome. Drop fields the agent never acts on, and state fields that repeat on every record once, at the top.
  2. Group repeats. Collapse identical or near-identical items into one entry with a count and a first-seen time.
  3. Lead with what changed. Put new, rare or anomalous items before the routine ones.
  4. Say what you left out. Report counts for everything you omitted, so absence is never mistaken for silence.
  5. Leave a pointer. Give the agent a short handle and the exact call to fetch the raw detail.

Here is the get_logs response from the hook, before and after.

Beforeget_logs → 46,000 tok
{"ts":"2026-11-26T03:01:34.207Z","level":"info","msg":"GET /healthz 200","pod":"checkout-api-7d9f-x2k4","node":"ip-10-4-21-7","image":"checkout:3.41.0","trace_id":"4bf92f3577b34da6"} 1
… 171 more lines
{"ts":"2026-11-26T03:02:11.402Z","level":"warn","msg":"db pool max changed 50 -> 5 (config v812)","pod":"checkout-api-7d9f-x2k4","node":"ip-10-4-21-7","image":"checkout:3.41.0","trace_id":null} 2
{"ts":"2026-11-26T03:02:41.118Z","level":"error","msg":"TimeoutError: fraud-svc call exceeded 2000ms","stack":"at FraudClient.check (fraud.ts:88)\n    at … 29 more frames","pod":"checkout-api-7d9f-q8m1",…}  3
… 338 more lines 4
  1. 1Every line repeats the pod, node, image and trace ID. Three quarters of the response is metadata the agent will never use to decide anything.
  2. 2The line that explains the outage looks exactly like a health check. It is line 173 of 512, with no marker that it is new or unusual.
  3. 3This error appears 196 times, each copy with a 30-line stack trace. Together the copies make up most of the response, and their sheer volume pulls the agent toward blaming fraud-svc.
  4. 4The excerpt shows 3 of 512 lines. The full response is about 46,000 tokens, with no counts, no grouping and no way to ask for less.
Tokens46,000
Raw log lines in context512 lines
Afterget_logs → 150 tok
{
  "status": "ok",
  "scope": { "service": "checkout-api", "window": "02:58–03:13Z" },
  "new_since_baseline": [
    { "level": "warn", "at": "03:02:11Z",
      "msg": "db pool max changed 50 -> 5 (config v812)" } 1
  ],
  "lines": 512,
  "by_level": { "info": 301, "warn": 15, "error": 196 }, 2
  "error_groups": [
    { "msg": "TimeoutError: fraud-svc call exceeded 2000ms",
      "count": 196, "first": "03:02:41Z" } 3
  ],
  "omitted": "301 info lines: health checks and request logs", 4
  "log_ref": "lg_7f3",
  "drill": "read_log(ref=\"lg_7f3\", around=\"03:02:11Z\")" 5
}
  1. 1The tool compares this window with a baseline and leads with the one message that didn't appear before. The pool change is the first finding the agent reads.
  2. 2Counts by level give the agent the shape of the window in one line. Errors dominate, and warnings are rare.
  3. 3The 196 timeouts become one group with a count and a first-seen time. The agent still knows they happened, and it can see they started 30 seconds after the pool change.
  4. 4Health checks are dropped and counted. If the agent needs them, it has to ask. That is the right default for an incident, and a choice the tool owner should make on purpose.
  5. 5A short handle and a ready-made call fetch the raw lines around the warning. Nothing is lost. The detail is one turn away instead of in the window.
Tokens150
Raw log lines in context0 lines
Illustrative example

Walk through the pins in order. Pin 1 is the heart of the fix. The tool knows something the agent doesn't: which messages are routine for this service and which are new. Comparing against a baseline costs the tool one cheap query, and it puts the rare line first, where the agent reads it before anything else. Order matters as much as size, because the model reads top to bottom.

Pins 2 and 3 replace volume with numbers. A count is the most compressed form of repetition, and it keeps the one fact the repetition carried: this happened a lot, starting at a known time. With first: "03:02:41Z" next to at: "03:02:11Z", the timeline does the arguing.

Pins 4 and 5 make the summary safe to trust. The agent knows exactly what was left out, so it doesn't mistake a trimmed response for a complete one. And the drill call gives it a precise next move. Peter Pirolli and Stuart Card, studying how people hunt for information, called cues like these information scent: signals that show where an answer lives without reading everything. The Guide calls the agent version token scentLexicon · 26Token ScentNavigational hints showing where answers live without full ingestion.. A handle like lg_7f3, plus a count of what sits behind it, is pure scent: a few tokens that say "the detail is here, if you need it."

The redesigned response is about 150 tokens, against 46,000. More important, the first finding the agent reads is the cause of the outage. The loudest symptom comes second, with a count attached.

The raw logs don't disappear. The human reviewing the incident later still wants to scroll through them, and they should. Send the full lines to the trace viewer or a log link for people, and the summary to the agent. Each reader gets the format that suits how they read.

The same pattern on other tools

Logs are the obvious firehose, but any tool that wraps a big data source has one. Here are the common shapes:

Tool shapeFirehose versionHigh-yield version
Log queryevery raw line, full metadatacounts by level, grouped errors, new lines first, a ref to the raw log
REST API list200 records with 80 fields eachthe fields the caller asked for, a total count, a cursor
Test run2,000 lines of PASS1,998 passed, 2 failed, then only the failures with file and line
Web page fetchthe full HTML, scripts and navthe main text, headings and links, with a byte count of what was dropped
Metrics query900 raw data pointsmin, max, p95, and the timestamps where the series broke its trend
Shell commanda 5,000-line npm install logexit code, warnings, the last 20 lines, and the path to the full log

The API row is the one teams underestimate. A web app picks the three fields it renders from a full object. An agent gets all 80 fields of all 200 records. A fields parameter, with a small default set, can shrink a response to a small fraction of its size with no loss at all.

In MCP terms

Watch what happens when get_logs runs behind an MCP server. The tool result already has room for both halves of the fix: a list of content blocks for the summary and the pointer, and a typed data field beside them.

  • Text content (content) and structured content (structuredContent). Lead the text block with the new warning, and put the grouped counts in structuredContent. The spec's own example pairs structured data with a one-sentence prose summary ("Found 2 users: …"), so the text block doesn't have to be a JSON dump.
  • Resource links (resource_link). Return the raw 512 lines as a link the client can fetch on demand, instead of an embedded resource block that lands in the window. A link can carry size in bytes. The spec says resource size can help hosts "estimate context window usage."
  • Content annotations (annotations.priority, annotations.audience). Every content block can carry them. Mark the summary priority: 1 and the raw-log link lower. Use audience: ["user"] for anything only the human reviewer needs. These are hints to the client about what enters context, not a guarantee.
  • Not in the protocol. There is no truncation marker and no token-budget argument. MCP's pagination cursors cover list methods like tools/list, not tool results. The omitted count and the drill call stay in your payload.

Here is the same get_logs result in MCP's shape, trimmed:

{
  "content": [
    { "type": "text", "annotations": { "priority": 1 },
      "text": "New since baseline: db pool max 50 -> 5 at 03:02:11Z. 196 fraud-svc timeouts from 03:02:41Z. 301 info lines omitted." },
    { "type": "resource_link", "uri": "logs://checkout-api/lg_7f3",
      "name": "lg_7f3", "size": 184000,
      "annotations": { "priority": 0.2 } }
  ],
  "structuredContent": { "by_level": { "info": 301, "warn": 15, "error": 196 } }
}

The summary text is about 30 tokens. The 184,000 bytes of raw log stay behind the link, one fetch away.

Spot it in your traces

Here is the session from the hook as it would appear in a trace log. Watch turn 2: the cause of the outage is inside that response, and the agent's conclusion goes the other way.

TraceAn on-call agent investigating checkout-api errors
  1. T1
    get_alert(id="ALR-5521")→ { "service": "checkout-api", "signal": "5xx rate 31%", "since": "03:03Z" }Errors started around 03:03. Read the logs for the last 15 minutes.A good first move. The alert is compact and gives the agent a time to work from.
  2. T2
    get_logs(service="checkout-api", since="15m")→ 512 lines of raw JSON, about 46,000 tokensAlmost every error is a fraud-svc timeout. The fraud service is down.The pool change is in this response, once, at 03:02:11. The 196 timeouts outweigh it, and the agent's conclusion follows the weight.
  3. T3
    get_logs(service="checkout-api", since="5m")→ about 15,000 tokens, more of the sameStill timing out. Escalate.The agent rereads the firehose to confirm. The window is now past 60,000 tokens, and the next compaction will keep the timeouts and drop the warning.
  4. T4
    page_oncall(team="fraud", severity="high")→ { "paged": "fraud-oncall", "ack": false }A human woken at 03:15, built on the loudest signal in the response instead of the earliest one.
  5. T5
    get_status(service="fraud-svc")→ { "healthy": true, "p99_ms": 41 }The evidence that the theory is wrong arrives one turn after the page. A compact response at turn 2 would have pointed here first.

The trace shows no tool errors. To find the same pattern in your own logs, look for these signals:

  • Oversized responses. Rank tools by the median and the largest size of their responses, in tokens. Any single response over a few thousand tokens deserves a look, and any tool that regularly returns tens of thousands is a firehose.
  • Big read, tiny quote. Compare the size of a response with what the agent quotes or uses from it on the next turn. An agent that reads 40,000 tokens and cites one line is telling you the yield.
  • Repetition inside one response. Count duplicate or near-duplicate lines per response. If the top message accounts for more than half the lines, the tool should be grouping.
  • The agent filtering by hand. Repeated calls with narrower windows, smaller limits or added grep-style arguments mean the agent is trying to shrink the response itself. The tool should offer that filter, or do it by default.
  • Compaction after large reads. Find compaction events and look at the two or three calls before them. If one large response triggered it, check what the summary kept and what it dropped.

Review checklist

Run these against any tool that wraps logs, records, files or pages. Each check takes a call or two, and the list pastes straight into a pull request template.

Review checklist · 7 items
  1. Set a token budget for each tool's response and stay under it by default.How to check Call the tool with its widest reasonable arguments, such as a long time window. Estimate the response at about 4 characters per token. It should fit the budget, with any overflow summarized and counted.
  2. Strip chrome: remove fields the agent never acts on, and state fields that repeat on every record once.How to check Compare two records from one response. Any field with the same value on every record should appear once at the top, or not at all.
  3. Group repeated items into one entry with a count and a first-seen time.How to check In a test environment, trigger the same error 100 times. The response should show one group with count: 100, not 100 lines.
  4. Put new, rare or changed items before routine ones.How to check Insert a single unusual warning among 1,000 routine lines. It should appear in the first few lines of the response.
  5. Report what was omitted, with counts.How to check Call the tool where filtering applies. The response should say how many items it dropped and what kind, for example omitted: 301 info lines.
  6. Return a short handle and the exact call to fetch raw detail.How to check From a summary response, fetch the raw items behind one group in a single call, using only the handle and call the response gave you.
  7. Let callers choose fields and filters, with a small default set.How to check Call the tool with fields=["ts","msg"] or its equivalent. Nothing else should come back. Then call it with no arguments and check the defaults are small.

When laws collide

Token hygiene removes information, so it pulls against the laws that add it and reinforces the ones that defer it.

  • Pulls against · H-02Affirmative Null Observations
    Where they clash
    Affirmative Null Observations asks every response to echo its scope and defaults, even when nothing matched. A hygiene pass that strips "everything the agent didn't ask for" can strip exactly that echo, and an empty result goes back to being an ambiguous [].
    How to have both
    Treat scope as signal, never as chrome. Keep the echo compact, one line with the filters and window, and spend the token savings from grouping and omitting on that line. Scope is short, and it is the part the agent can't reconstruct on its own.
  • Pulls against · H-01Continuous State Anchoring
    Where they clash
    Continuous State Anchoring wants live state, such as the branch, the open incident and the budget, on every response. Repeated on every call, that header is the same kind of chrome this heuristic strips from log lines.
    How to have both
    Keep the anchor small and send it once per response, never once per record. Better still, send only what changed since the last call. A three-line header that is always current is worth its cost. A full state dump on every call is not.
  • How they combine
    A summary is only safe if the detail behind it is easy to reach. Local Handles & Progressive Disclosure supplies the short, copy-safe reference (lg_7f3) and the habit of loading detail on demand.
    What you get
    Together they give the agent a small first look and a cheap second look. The tool can cut hard by default, because nothing it cuts is more than one call away.

Model size shifts the balance but not the rule. A larger model may resist the pull of 196 identical errors and find the warning anyway, at the full token cost. A smaller, faster model is more likely to follow the weight. Bigger context windows don't help either: they let the firehose in, and the clutter is still read, token by token.

Terms from this page

10Literal Exhaustive Reading
Ingesting every returned token without human visual skimming.
25Observation Yield
Useful, decision-relevant signal per token returned by a tool.
16Token Gravity
Bulky or salient tokens warping subsequent next-token probabilities toward themselves.
45Context Compaction
Lossy compression of a session ribbon to reclaim window capacity.
26Token Scent
Navigational hints showing where answers live without full ingestion.
esc

Try “tokens”, “errors”, “stale”, “handoff” or “blast radius”.