fix(routing): learned-mcp-patterns.md loads before the first MCP write, not on every build - #182
Merged
Merged
Conversation
…e, not on every build It was in the Stage 5 baseline pack and mdl-agent's always-read rows, so every build session and MDL helper agent carried ~4,900 tokens of MCP rules, including cloud sessions where MCP does not exist. The write-mode choice is Step 0 of learned-mdl-preflight.md, which stays always-on. Stage 5 pack 74,055 -> 71,443 words; baseline 79,752 -> 77,140. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
Merged
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why (one paragraph)
learned-mcp-patterns.mdwas a baseline row for Stage 5 and sat inmdl-agent's always-read table. So every build session and every MDL helper agent carried about 4,900 tokens of MCP save and handoff rules and JSON payloads, including sessions that never open Studio Pro and cloud containers where MCP does not exist. The write-mode choice (CLI vs MCP+MDL vs hand-rolled MCP) is already Step 0 oflearned-mdl-preflight.md, which stays always-on, so nothing is lost at the moment of choice. The row is nowondemand, and its trigger names the moment the file is needed: before the first MCP write in a session (mxcli --mcpexec, or apg_*/ped_*call). One TSV row changed; README, ROUTING, the runbook table and the mdl-agent template were re-rendered bybin/render-routing.sh, and the always-on sentence inCLAUDE.mdwas updated by hand.Field evidence
bin/render-routing.sh --check, before → after:Found through the context report built from
bin/context-audit.sh(#181) plus the per-stage pack sizes.Checklist
render-routing.sh --checkclean; the one fixture naming this file (test-bug12-sync.sh) plants its own hand-written table and does not read the TSV🤖 Generated with Claude Code
https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
Generated by Claude Code