# Session-Close Protocol Template Reference template for memory-enabled agents. Copy the **Session Close** block into `agents/agent-.md` and adapt the metrics line to the agent. ## Session Close 1. Update `## Accumulated Findings`, `## What Worked`, and `## Watch Points` as needed. 2. Append one line to `## Session Log`: `YYYY-MM-DD · · `. 3. Bump `last_updated` to today and increment `session_count` in memory frontmatter. 4. Record session metrics (adjust flags to match outcome): ```bash kaizen-agentic metrics record --success --time --quality <0.0-1.0> # or on failure: kaizen-agentic metrics record --failure --time ``` Optional: pass a full JSON record (ADR-004 schema) via stdin: ```bash echo '{"success": true, "quality_score": 0.9, "primary_metric": {"name": "...", "value": 1.0, "target": 1.0}}' \ | kaizen-agentic metrics record --json ``` Use `--idempotency-key ` to avoid duplicate records if the close protocol runs more than once for the same session. ## Pilot agents `tdd-workflow` is the reference implementation (WP-0003 Part 5). Other memory-enabled agents should adopt this block as the metrics CLI becomes available in their workflows.