Code mode
Without code mode, every tool definition is sent up front, on every turn. That preamble is most of the context window.
Model context window
system prompt
tool preamble
100 definitions,
resent every turn
search, execute
user ask
two function signatures
result
free
tool definitions in context
what comes back to the model
payloads that stay in the sandbox
the preamble without code mode
Sandbox
empty until code mode packs the catalog here
no functions yet
get_transcript()
attach_to_lead()
search_email()
create_task()
… 96 more
the transcript stays here; only the return value leaves
Tool catalog
100 tools on MCP servers, each schema repeated in the preamble
get_transcript
attach_to_lead
search_email
create_task
update_lead
get_calendar
read_doc
send_message
+ 92 more