REA tools filling Claude Code's context
Unofficial guide. This site is an independent community guide and is not affiliated with the REA project. For authoritative docs see the official REA website and the morluto/rea GitHub repository. Commands here are taken from the official README/docs (checked 2026-10-13); REA changes quickly, so verify against the official docs.
Symptom
Claude Code pointed at a third-party Anthropic-compatible endpoint (e.g. DeepSeek) reports autocompact thrashing after adding REA.
Cause
Claude Code turns tool search off when ANTHROPIC_BASE_URL is not first-party, so every REA tool definition is sent with every request (#2019). The docs measured ~496 KB with the default profile vs ~290 KB with compact (172 tools).
Fixes
- Add
"REA_MCP_INPUT_SCHEMA_PROFILE": "compact"to theenvofmcpServers.reain~/.claude.json, then restart Claude Code. - Make Claude Code assume the model's real window: set
CLAUDE_CODE_MAX_CONTEXT_TOKENS(DeepSeek's guide uses a[1m]model suffix). - If the endpoint supports
tool_referenceblocks,ENABLE_TOOL_SEARCH=truerestores deferred loading.
Related guides
- MCP setup for Claude Code & Cursor
- REA with Windsurf, Gemini CLI, VS Code & more
- Troubleshooting & FAQ
Sources: client-configuration.md#claude-code · issue #2019