Skip to content

feat: shrink default tool surface + cap memory files#39

Merged
arniesaha merged 1 commit intomainfrom
feat/tool-surface-and-memory-caps
Apr 23, 2026
Merged

feat: shrink default tool surface + cap memory files#39
arniesaha merged 1 commit intomainfrom
feat/tool-surface-and-memory-caps

Conversation

@arniesaha
Copy link
Copy Markdown
Owner

Summary

  • Split the always-registered tool set: coreTools (fs, shell, ssh, nix-relay, gpu) stay on by default; BROWSER / LINKEDIN / IOS / LAUNCHPAD / SUBAGENT groups are now opt-in via MAX_TOOLS_<GROUP>=true (or MAX_TOOLS_ALL=true for the old behavior). Tool schemas ship on every request, so this cuts baseline input tokens meaningfully when those groups aren't needed.
  • Cap each memory file at MAX_MEMORY_FILE_CHARS (default 20K) in loadMemory, with a warn log and a visible truncation marker, so an unbounded MEMORY.md or daily log can't silently bloat the system prompt.

Part of the context-optimization series — see also #(PR1 ctx-ignore), #(PR3 lower compaction threshold), #(PR2 per-tool caps + stale pruning). PR 4 (Mux prompt caching) is next, in the mux repo.

Test plan

  • npm run build — clean
  • npm test — 72/72 pass
  • Deploy and confirm log line Tool groups active: core (9 tools) on startup with no MAX_TOOLS_* flags set
  • Temporarily grow a memory file past 20K; confirm warn log + truncation marker appear
  • Set MAX_TOOLS_IOS=true and confirm ios_* tools are registered

🤖 Generated with Claude Code

Split staticTools into coreTools (always on) and opt-in groups via
MAX_TOOLS_BROWSER / LINKEDIN / IOS / LAUNCHPAD / SUBAGENT env flags
(or MAX_TOOLS_ALL for legacy behavior). Tool schemas ship on every
request, so this cuts baseline input tokens meaningfully when only
core tools are needed.

Also cap each memory file at MAX_MEMORY_FILE_CHARS (default 20K)
with a warn log so an unbounded MEMORY.md or daily log can no longer
silently bloat the system prompt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arniesaha arniesaha force-pushed the feat/tool-surface-and-memory-caps branch from 4d095e6 to ac4975e Compare April 23, 2026 07:43
@arniesaha arniesaha merged commit b18b283 into main Apr 23, 2026
1 check passed
@arniesaha arniesaha deleted the feat/tool-surface-and-memory-caps branch April 23, 2026 07:44
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.

1 participant