Does MCP code mode trade token efficiency for lost context and fragile error recovery?
Longjumping_Bad_879 · reddit · 2026-12-03
A developer lays out three under-discussed problems with MCP code mode, where intermediate tool calls run inside an execution environment and only final results return to the LLM:
- Lost intermediate context across turns: metadata discovered in query 1 (accounts, resources, field schemas) lives in context with traditional tool calling, enabling reuse in follow-ups; with code mode it may vanish, forcing redundant discovery sequences.
- No good way to retain it: returning all intermediates defeats code mode's token savings; selectively returning them fails because the next query is unpredictable.
- Error recovery: if call 4 of 4 fails, retries may re-execute calls 1-3 unless the generated code implements checkpointing and proper error propagation.
His conclusion: code mode optimizes tokens and orchestration but introduces real trade-offs in multi-turn context retention and failure recovery.
More from coding & agent
- Dev feedback: decoupling rex sessions from native windows is harder to adapt to than expected — alexisgallagher · 2026-12-05
- Salesforce research: buyer agents concede too easily, images boost persuasion ~17% — msrivastav13 · 2026-12-05
- Grok Build launches agent-driven post-quantum cryptography migration after NSA advisory, with $1,000 credits — ns123abc · 2026-12-05
- Seroter's reading list: post-quantum prep, agent harnesses, and life after 99% AI code — rseroter · 2026-12-05
- WSDM Cup 2027 Offers $10k to Build Autonomous Community Notes Agents — sanmikoyejo · 2026-12-05
- Trying Copilot Studio MCP for agent cloning and Power Automate sync: janky but workable — koltregaskes · 2026-12-05