[BUG] System prompt consumes ~9.3M tokens on every session after installing Claude Desktop on Windows (WSL setup)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Every Claude Code session in WSL fails immediately with "Prompt is too long" -- the system prompt, tool definitions, and attachment content consume ~9.3M tokens against a 1M token limit. The conversation itself is only ~1300-1500 tokens. /clear, /compact, and double-Esc do not resolve it -- the error appears on the very first message of a fresh session.
What Should Happen?
I should be able to interact with claude code (CLI via WSL) without receiving an error that my request is too large. System prompt + tool definitions should consume a few hundred thousand tokens at most, leaving usable context for actual work.
Error Messages/Logs
<img width="1092" height="129" alt="Image" src="https://github.com/user-attachments/assets/a89cf992-fe5f-4da0-8a45-72e83c20b007" />
<img width="473" height="227" alt="Image" src="https://github.com/user-attachments/assets/d143292d-927a-46d4-bb22-c80739e00694" />
Steps to Reproduce
- Set up Claude Code in WSL2 on Windows, logged in via claude.ai OAuth (work/team account)
- Confirm Claude Code works normally -- sessions start, prompts go through
- Install Claude Desktop on the Windows host using the same claude.ai account
- Return to WSL and start a new Claude Code session
- Send any prompt, even a single word
- Session immediately fails with "Prompt is too long -- the request is ~9339829 tokens (limit 1000000) but this conversation is only ~1317 tokens"
- /clear, /compact, and double-Esc all fail with the same error
- Error persists across all projects and from the home directory
Expected: Session starts normally, prompt sends successfully
Actual: Every session is bricked on the first message, system prompt alone exceeds the token limit by ~9x
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.162
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Environment:
Claude Code version: 2.1.162
OS: Ubuntu (WSL2) on Windows
Claude Desktop: installed on Windows host, same claude.ai account
Install method: native
Timeline:
This started approximately 18 hours after installing Claude Desktop on Windows. Prior to that, Claude Code in WSL worked normally on the same machine and account.
What I've ruled out:
- CLAUDE.md files are small (4168 bytes global, 2699 bytes project-level)
- Only 2 MCP servers registered: claude.ai Figma (unauthenticated) and github (connected)
- No claude_desktop_config.json visible from WSL
- tengu_claudeai_mcp_connectors: true is set in cachedGrowthBookFeatures -- env var ENABLE_CLAUDEAI_MCP_SERVERS=false had no effect
- remote-settings.json present with allowlist of 2 MCP servers and permission rules -- does not appear to be the source
- settings.json is minimal
- DISABLE_GROWTHBOOK=true claude did not work, so it looks like GrowthBook and the feature flags aren't the cause
Showing cached comments. Read the full discussion on GitHub ↗
11 Comments
Looking at the error message, it says that you have 4.5m tokens worth of tools enabled. Try disabling your MCP servers and see if that resolves the problem. If it does, one or both of the MCP servers might be misbehaving
This looks like a useful MCP/tooling-readiness failure mode rather than a normal conversation-size issue. From the public evidence, the next checks I would isolate are:
No private logs or account access needed; this is just a public triage checklist for narrowing the tool/context source.
Hey @CptnFizzbin and @maxim-ultra, thanks for the suggestions.
I actually tried disabling MCP servers early on.. ran with
--strict-mcp-config --mcp-config '{"mcpServers":{}}'and the token count didn't budge. Still 4.5M in system tools./contextbreaks it down like this:So it's definitely not MCP: or at least not the MCP servers I have registered.
Something else is getting loaded into system tools that I can't see or control from the outside.
Any idea what else could be injecting tool definitions at that scale?
Thanks for checking that. If an empty MCP config still leaves
System toolsat 4.5M, I would stop treating this as a normal MCP-server schema problem.The next split I would make is tool source vs. tool duplication:
/context; if fresh is normal, diff only the config/plugin/skill/tool-source paths the broken profile loadsNo private logs needed. A redacted
/contextplus a fresh-profile comparison should narrow whether this is one pathological tool definition or a duplicated tool registry.Thanks for the suggestion @maxim-ultra!
A fresh profile comparison gave us something concrete:
<redacted>@gmail.com): 15.2k system tools (normal)alton@<redacted>.org): 4.5M system tools (broken)Same machine, same Claude Code version, same blank profile with zero local config, zero MCP servers. The only variable is the account. So this is definitively server-side and tied to the work account specifically - nothing local is causing it.
Would love to know what's attached to that account server-side that's generating 4.5M tokens of system tools.
Happy to provide any additional info that would help narrow it down.
That profile/account split is strong evidence. At this point I would frame the bug for maintainers as account-scoped server-side tool registry inflation, not WSL, local MCP, or local config.
A tight next diagnostic packet, without exposing secrets, would be:
If Claude Code has any command that emits tool-source identifiers/counts without dumping tool contents, that would be the highest-value artifact now. Something like
source -> tool_count -> token_estimate, with names redacted if needed, would let support identify whether this is one gigantic tool source or many duplicated sources.Until that exists, the most useful public evidence may be a screenshot or pasted
/contextsummary from both fresh profiles plus the exact account type difference. No private tokens, org internals, or full tool dumps needed.@maxim-ultra no tool-source command exists as far as I can tell -- mcp list just shows the two registered servers, nothing about tool counts or schemas.
Here's the clean diagnostic packet:
Known-good control:
Broken variant:
Local config, WSL, MCP server schemas, and Claude Desktop are all ruled out.
The only variable is the account/org.
A fair guess at this point is something attached to my org, but no other members of my org are experiencing this, which probably rules out an org-wide attachment.
It's more likely something specific to my user account within the org -- a connector, entitlement, or tool bundle tied to my account specifically rather than the org itself?
The Desktop install is still the most likely trigger since the timing lines up exactly, even if uninstalling it didn't resolve it. Is there a way to inspect or reset what tool sources are attached to a specific user account?
Following a suggestion to run a proxy to capture the raw API request, here's what I found.
Method:
What this means:
The tool definitions being sent include the full Claude Agent SDK / multi-agent harness: Workflow, orchestration patterns, agent spawning, the works. A single field has a maxLength of 524,288 characters. This is not standard Claude Code tooling. Something attached to my work account is injecting an entirely different and vastly larger tool set on every session that I never explicitly enabled.
Timing still lines up with installing Claude Desktop. My guess is it likely enrolled my account in a multi-agent feature without opt-in.
Is there a way to detach or disable this agent SDK harness from a specific user account?
@maxim-ultra @CptnFizzbin
Looking at your repro, the smoking gun is in your "What I've ruled out" — 9.3M tokens after
claude_desktop_config.jsonpropagation, with only 2 MCP servers and small CLAUDE.md files. That ratio (system + tools = 9.3M, actual conversation = 1.3k) almost certainly means one of those MCP servers is exposing a tool schema with a giant inline payload — Figma's MCP is the usual suspect, since file attachments and asset metadata in Figma tools can be encoded into the schema definition itself.A few things I'd try in order:
claude mcp remove figmaor setdisabledMcpServersin~/.claude/settings.json) and start a new session. If the 9.3M drops, you've confirmed Figma is the source. If it stays at 9.3M, the issue is something else (likely an OAuth-scoped attachment from claude.ai that the Desktop install is injecting, since both are signed in with the same account).npm i -g ccglass && ccglass claude) for this — it shows the full system prompt, per-tool schema size, and a token breakdown by section. You can see which tool is contributing the most tokens. In your case I'd expect to see one tool definition in the 8-9M range, not 100+ small ones. Also: ccglass has an MCP server, so once it's running you can ask Claude directly "which of your tools has the largest schema?" and it'll tell you from inside the session.~/.claude.jsonsize before and after installing Desktop — the 18-hour delay suggests Desktop is writing a large OAuth-scoped payload asynchronously. If the file size jumps by 8-9MB at some point, you've found it. (du -h ~/.claude.jsonbefore and after a few hours.)claude.aiaccount in a different browser profile. If the issue doesn't repro there, it confirms something Desktop is syncing into the existing account's state.The 18-hour delay is also telling — this isn't a config change at install time, it's something Desktop writes or refreshes asynchronously in the background (likely a sync of claude.ai attachment metadata or project state).
Worth filing a separate issue with the per-tool schema sizes once you've narrowed it down — that's the actionable version of this report.
Update:
It's working again as of this morning, which strongly suggests something was fixed server-side on my account.
I did get further into the diagnostics using ccglass and a local proxy to capture the raw API request, but by the time we had those tools running the issue had already resolved itself (or Anthropic fixed it) so we were effectively profiling a working session, not the broken one.
The tool registry we captured had 30 tools including Workflow, CronCreate, ScheduleWakeup, DesignSync, Monitor and others that aren't part of standard Claude Code, suggesting the full multi-agent/Ultracode harness was loaded. But since we couldn't capture a request from the broken session, we can't confirm whether that was the actual source of the inflation or just normal for a claude_team account.
The key finding that still stands:
Fresh profile + zero local config + personal account (claude_pro) = 15.2k system tools.
Same setup + work account (claude_team, Codethedream org) = 4.5M system tools.
That should rule out local config, MCP servers, and WSL entirely - whatever it was lived on the account server-side.
Leaving this open for a couple days in case it regresses. Happy to provide diagnostics if it comes back now that I have the proxy and ccglass set up, I can actually capture the broken state next time.
Thank you for taking the time to report this.
Closing as resolved per your confirmation that the account returned to normal system tool sizing on June 17 and has remained stable since. The fresh-profile comparison isolating the inflation to a single account's server-side tool registry was a useful diagnostic.
If the inflated
/contextnumbers reappear on the same account, please open a new issue referencing this one.