Skip to content

Deregister DietCode's own MCP tools; cadence-based fold with dedup + cache_control - #11

Merged
varchanaiyer merged 2 commits into
mainfrom
claude/repo-contents-overview-k8rhm3
Sep 8, 2026
Merged

varchanaiyer merged 2 commits into
mainfrom
claude/repo-contents-overview-k8rhm3

Conversation

@soham96

@soham96 soham96 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
  • 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

…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
varchanaiyer merged commit dfff67b into main Sep 8, 2026
3 of 6 checks 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.

3 participants