Behavior change: per-observation LLM compression is now opt-in. If you were relying on LLM-generated summaries, set `AGENTMEMORY_AUTO_COMPRESS=true` in `~/.agentmemory/.env` and restart.
Fixed
- Stop silently burning Claude API tokens on every tool invocation (#138, thanks @olcor1) — the old `mem::observe` path fired `mem::compress` unconditionally on every PostToolUse hook, which called Claude via the user's `ANTHROPIC_API_KEY` to turn each raw observation into a structured summary. An active coding session could burn hundreds of thousands of tokens in minutes, which is the opposite of what a memory tool should do. The new default path skips the LLM call and uses a zero-token synthetic compression that derives `type`, `title`, `narrative`, and `files` from the raw tool name, input, and output directly. Recall and BM25 search still work.
Added
- `AGENTMEMORY_AUTO_COMPRESS` env var — default `false`. When `true`, restores the old per-observation LLM compression path. Startup banner prints a loud warning when it's on.
- `src/functions/compress-synthetic.ts` — `buildSyntheticCompression()` with camelCase-aware substring matching for `Read`/`Write`/`Edit`/`Bash`/`Grep`/`WebFetch`/`Task`/etc., file-path extraction, and 400-char narrative truncation.
- 8 regression tests in `test/auto-compress.test.ts` — full suite now 707 passing.
Migration
If your token usage suddenly drops after upgrading, that's working as intended. If you want richer LLM-generated summaries back:
```env
~/.agentmemory/.env
AGENTMEMORY_AUTO_COMPRESS=true
```
Restart the engine. Existing compressed observations on disk are untouched.
Upgrade
```bash
npm install @agentmemory/agentmemory@0.8.8
or standalone:
npx -y @agentmemory/mcp
```
Full changelog: v0.8.7...v0.8.8