Highlights
engram setup --protocol=<slim|full> — opt-in slim SessionStart hooks
Claude Code sessions receive the Engram memory protocol twice: once from the SessionStart hook's static prose and once from the MCP server instructions (served since v1.4.0). This release lets tooling opt a slug into a slim hook that drops the duplicated static prose (~3.6KB / ~900 tokens per session) while keeping everything dynamic and load-bearing:
- The session CONTEXT block (recent sessions, prompts, pinned and recent observations).
- The post-compaction recovery header and numbered steps — always emitted, in every mode.
How it works
engram setup <slug> --protocol=<slim|full>persists a per-slug mode atomically inprotocol-mode.jsonunder the data dir (ENGRAM_DATA_DIRhonored end to end). Corrupted files are never overwritten and other slugs are never dropped.- A new
engram protocol-mode <slug>subcommand is the runtime read path for the version-pinned plugin hooks: it printsslimonly when the persisted mode is slim and the binary meets the v1.4.0 instructions-channel floor — every failure path printsfull. It is excluded from the startup update check, so hooks never pay a network call. engram setup --helpnow lists flags (including--protocol) and never reads stdin — external tools can probe capability safely with stdin detached and a timeout.cmdSetupargument handling is now a two-pass, order-independent classifier:--protocolis honored wherever it appears, unknown flags still fall back to the interactive menu, and setup never fails because of the flag.
Compatibility
Fully backward compatible. No flag → today's behavior everywhere. Old hooks + new binary and new hooks + old binary both degrade safely to the full protocol text. Downstream consumers (gentle-ai) detect the flag automatically via setup --help and start forwarding it — no coordination needed beyond upgrading.
Changelog
Verification: 25+ new Go tests (strict TDD), race-detector clean, live-binary probe validated, and a 16-entry adversarial review ledger archived with the change (openspec/changes/archive/2026-07-08-setup-protocol-flag/).