Skip to content

fix(routing): learned-mcp-patterns.md loads before the first MCP write, not on every build - #182

Merged
MendixMau merged 1 commit into
masterfrom
fix/mcp-patterns-on-demand
Sep 30, 2026
Merged

MendixMau merged 1 commit into
masterfrom
fix/mcp-patterns-on-demand

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

learned-mcp-patterns.md was a baseline row for Stage 5 and sat in mdl-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 of learned-mdl-preflight.md, which stays always-on, so nothing is lost at the moment of choice. The row is now ondemand, and its trigger names the moment the file is needed: before the first MCP write in a session (mxcli --mcp exec, or a pg_*/ped_* call). One TSV row changed; README, ROUTING, the runbook table and the mdl-agent template were re-rendered by bin/render-routing.sh, and the always-on sentence in CLAUDE.md was updated by hand.

Field evidence

bin/render-routing.sh --check, before → after:

Before After
Stage 5 pack 74,055 words / 23 files 71,443 words / 22 files
Baseline total 79,752 words 77,140 words

Found through the context report built from bin/context-audit.sh (#181) plus the per-stage pack sizes.

Checklist

  • No client data (leak guard + denylist grep)
  • Size cap
  • Test tier: render-routing.sh --check clean; the one fixture naming this file (test-bug12-sync.sh) plants its own hand-written table and does not read the TSV
  • Instrument rules: n/a (routing only)
  • Routing row: changed via the TSV, surfaces re-rendered
  • CHANGELOG line
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…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
@MendixMau
MendixMau merged commit c7c14d3 into master Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants