Question 1 · choose 1
A finance assistant answers aggregate questions (sums, filtered counts, group-bys) over a 2,000-row orders export. Each question is sent like this:{
"model": "claude-opus-5-5",
"max_tokens": 2048,
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "<orders_csv>\norder_id,region,sku,qty,amount,date\n... 2,000 rows ...\n</orders_csv>"},
{"type": "text", "text": "Total amount for region EMEA in Q3?"}
]
}]
}The table is about 90,000 input tokens per question, and many answers are wrong. Which change reduces token consumption without losing the information the questions need?
- AAdd a cache_control breakpoint after the table block so that later questions read the rows from the cache
- BKeep the pasted table and ask Claude to work through each aggregate step by step before giving the total
- CMove the table into the system prompt so that it is sent once per conversation instead of with every question
- DUpload the export once with the Files API and give Claude the code execution tool to compute over the file
Show the answer and why
AAdd a cache_control breakpoint after the table block so that later questions read the rows from the cache
Incorrect
Caching changes what the repeated rows cost; the table is still computed over as pasted text, the approach that answered poorly.
BKeep the pasted table and ask Claude to work through each aggregate step by step before giving the total
Incorrect
The rows still enter every request as about 90,000 input tokens, the cost the guidance says to remove.
CMove the table into the system prompt so that it is sent once per conversation instead of with every question
Incorrect
The Messages API is stateless: every request carries its full input, system prompt included.
DUpload the export once with the Files API and give Claude the code execution tool to compute over the file
Correct
When the model has to compute over a table, the guidance is to upload it and query it with code execution instead of pasting it.
The cost guidance says to keep data files out of the prompt: when Claude has to compute over a table, upload it with the Files API and let it query the file with the code execution tool. In Anthropic's measurement over a 1,862-row CSV, the pasted table cost about 91,000 input tokens per request and got 7 of 25 aggregate questions right; uploaded with code execution, all 25 were right at about a twelfth of the cost.
Anthropic documentation