Repository navigation
Deregister DietCode's own MCP tools; cadence-based fold with dedup + cache_control - #11
Merged
Merged
Conversation
…cache_control - Keep only sd_retrieve as an agent-facing MCP tool (src/index.ts). sd_compress, sd_summarize, sd_classify, and sd_extract are no longer exposed to the agent — they're already applied automatically by DietCode's hooks and proxy, so keeping them as tools only taxed every request's `tools` array and relied on the model choosing to call them. Deleted the now-unused tool wrapper files and updated mcp-contract.test.ts / integration.test.ts accordingly. - Proxy compaction (src/proxy/transform.ts) now folds on a turn cadence (foldEveryTurns, default 3, SCALEDOWN_PROXY_FOLD_TURNS) in addition to the existing token threshold, so stale tool output doesn't sit in the live window as long. Deduplication of repeated tool output (re-read files, re-run commands) is delegated to the ScaleDown summarize call itself via an updated SUMMARY_INSTRUCTIONS prompt, not separate local logic. - The folded summary block gets an explicit `cache_control: ephemeral` breakpoint once it's large enough to be cacheable (>=1024 tokens) and the request hasn't already used all 4 allowed breakpoints, so it's a cache read instead of full reprocessing between compaction steps. New SCALEDOWN_PROXY_CACHE_CONTROL_DISABLE kill switch. - Updated README and setup.ts's printed tool list to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCuayQcRKWyJdDfTVzLksL
Decided to accept the Cursor regression from deregistering sd_compress/ sd_summarize/sd_classify/sd_extract (Cursor has no hook system, so those MCP tools were its only path to any of this) rather than add client-conditional tool registration. Bring the docs in line with that: - cursor-rules/dietcode.mdc and its source of truth, reconcile.ts's CURSOR_RULES_CONTENT (dietcode setup writes this verbatim), no longer instruct Cursor's agent to call tools that don't exist. - agents-md/AGENTS.md (Codex CLI) now describes what's actually available: automatic hooks for everything, sd_retrieve as the one on-demand tool. - README: corrected the "supported clients" note, the Cursor setup section, the feature comparison table, and the usage examples to reflect that Cursor currently gets no DietCode optimization. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCuayQcRKWyJdDfTVzLksL
varchanaiyer
approved these changes
Sep 8, 2026
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.
Keep only sd_retrieve as an agent-facing MCP tool (src/index.ts). sd_compress,
sd_summarize, sd_classify, and sd_extract are no longer exposed to the agent —
they're already applied automatically by DietCode's hooks and proxy, so
keeping them as tools only taxed every request's
toolsarray and relied onthe model choosing to call them. Deleted the now-unused tool wrapper files
and updated mcp-contract.test.ts / integration.test.ts accordingly.
Proxy compaction (src/proxy/transform.ts) now folds on a turn cadence
(foldEveryTurns, default 3, SCALEDOWN_PROXY_FOLD_TURNS) in addition to the
existing token threshold, so stale tool output doesn't sit in the live
window as long. Deduplication of repeated tool output (re-read files,
re-run commands) is delegated to the ScaleDown summarize call itself via an
updated SUMMARY_INSTRUCTIONS prompt, not separate local logic.
The folded summary block gets an explicit
cache_control: ephemeralbreakpoint once it's large enough to be cacheable (>=1024 tokens) and the
request hasn't already used all 4 allowed breakpoints, so it's a cache read
instead of full reprocessing between compaction steps. New
SCALEDOWN_PROXY_CACHE_CONTROL_DISABLE kill switch.
Updated README and setup.ts's printed tool list to match.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01DCuayQcRKWyJdDfTVzLksL