How I Cut 80%+ of Context Overhead in My Coding Agent | Mohammed Reschreiter
Pangram verdict · v3.3
We believe that this text is a mix of AI and human-written content.
AI likelihood · overall
AIArticle text · 447 words · 2 segments analyzed
When you start a session in a modern AI coding agent, a huge chunk of your context window is consumed before you type your first message. Between system instructions, formatting rules, MCP server integrations, and dozens of registered tool schemas, most agent harnesses dump 10,000 to 25,000+ tokens of static overhead into the context window on every turn. On 90% of turns, an agent only needs basic file and shell tools (read, bash, edit, write). Specialized tools like browser automation, image generation, web search, or background task runners are needed occasionally, sometimes only once a week. Leaving 25 to 80+ tool definitions active in the LLM function schema 100% of the time wastes tokens, increases latency, and degrades model reasoning by polluting the attention space with irrelevant parameters. I solved this with two design decisions: Action-based tool consolidation. Structuring custom tools from day one to avoid CRUD schema duplication. Dynamic tool activation in Pi. Keeping a baseline of 4 tools active, placing everything else on standby, and letting the model or the user activate tools on demand with zero meta-tool schema overhead and automatic TTL cleanup. Benchmarking turn zero context across agent harnesses To measure the scale of the problem, I tested how different coding agent harnesses handle tool schemas and context on a fresh session by sending a single greeting: "hi". 1. Codex: 79 tools and 14.5k tokens by default I turned off every external plugin and MCP server in Codex, leaving only two custom skills alongside the default built-in setup. Then, I started a fresh session and sent "hi". The model answered with a standard one-line greeting ("Hi! How can I help?"). The thread status showed that the session had already consumed 14,534 tokens (6% of the 258k context window gone on turn zero). Figure 1: Codex context consumption after sending a single "hi". 14,534 tokens consumed before any actual work begins. When I asked the agent which tools were currently active and callable, it returned 79 active tools.
Click to view the full list of 79 active tools loaded in Codex apply_patch codex_app__automation_update codex_app__create_thread codex_app__fork_thread codex_app__get_handoff_status codex_app__handoff_thread codex_app__list_archived_threads codex_app__list_projects codex_app__list_threads codex_app__load_workspace_dependencies codex_app__navigate_to_codex_page codex_app__open_in_codex codex_app__read_thread codex_app__read_thread_terminal codex_app__send_message_to_thread codex_app__set_thread_archived codex_app__set_thread_pinned codex_app__set_thread_title codex_app__share_thread codex_app__wait_threads create_goal exec_command get_goal image_gen__imagegen list_available_plugins_to_install list_mcp_resource_templates list_mcp_resources mcp__codex_apps__codex_document_control_execute_document_command mcp__codex_apps__codex_document_control_get_document_tool_schemas mcp__codex_apps__codex_document_control_list_document_sessions mcp__codex_apps__plugin_management_get_app_permissions mcp__codex_apps__plugin_management_get_plugin_dependencies mcp__codex_apps__plugin_management_uninstall_app mcp__codex_apps__plugin_management_update_app_permissions mcp__codex_apps__safety_settings_get_family_info mcp__codex_apps__safety_settings_get_parental_controls mcp__codex_apps__safety_settings_get_trusted_contact mcp__codex_apps__safety_settings_prepare_parental_control_update mcp__codex_apps__safety_settings_update_parental_control mcp__codex_apps__sites_add_custom_domain mcp__codex_apps__sites_change_site_slug mcp__codex_apps__sites_create_site mcp__codex_apps__sites_create_source_repository_write_credential mcp__codex_apps__sites_deploy_private_site_version mcp__codex_apps__sites_deploy_site_version mcp__codex_apps__sites_generate_siwc_bypass_token mcp__codex_apps__sites_get_deployment_status mcp__codex_apps__sites_get_environment_variables mcp__codex_apps__sites_get_site mcp__codex_apps__sites_get_site_version mcp__codex_apps__sites_get_site_worker_logs mcp__codex_apps__sites_list_custom_domains mcp__codex_apps__sites_list_site_versions mcp__codex_apps__sites_list_sites mcp__codex_apps__sites_read_database_overview mcp__codex_apps__sites_read_database_table_rows mcp__codex_apps__sites_refresh_custom_domain_status mcp__codex_apps__sites_remove_custom_domain mcp__codex_apps__sites_save_site_version mcp__codex_apps__sites_update_environment_variables mcp__codex_apps__sites_update_site_access mcp__codex_apps__sites_update_site_metadata mcp__node_repl__js mcp__node_repl__js_add_node_module_dir mcp__node_repl__js_reset multi_agent_v1__close_agent multi_agent_v1__resume_agent multi_agent_v1__send_input multi_agent_v1__spawn_agent multi_agent_v1__wait_agent plugin_management__uninstall_plugin read_mcp_resource request_permissions request_plugin_install update_goal update_plan view_image web__run write_stdin If you enable just one or two extra plugins, such as security scanners or GPT apps, the active tool list passes 100 callable tools.