You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
save-session.sh aborts (exit 1) under --max-turns 1 when user has Stop hooks #100
The autonomous save pipeline (scripts/save-session.sh) never writes memory in my setup. The Haiku extraction step exits 1 every run, so the pipeline aborts before writing now.md / handoff.
Root cause
save-session.sh invokes the nested summarizer as claude -p --model haiku --allowedTools "" --max-turns 1 ... (hardcoded on lines 176 and 242 in v0.7.3). The nested claude -p invocation inherits the user's configured Stop hooks (in my case a memory-review gate). That hook forces an additional turn, so the run uses 2 turns, hits the --max-turns 1 cap, and returns:
{"subtype":"error_max_turns","is_error":true,"num_turns":2,
"errors":["Reached maximum number of turns (1)"]}
Exit code is 1, and save-session.sh:179 treats any non-zero exit as fatal (exit 1), so no memory is ever written. This is not auth/rate-limit — the API call succeeds and bills normally.
Reproduction
With any Stop hook configured in ~/.claude (e.g. a Stop hook that prints output), run:
The same call with --max-turns 4 returns subtype: success, exit 0 — confirming the cap is the cause (the hook consumes the extra turn).
Environment
remember plugin v0.7.3
Claude Code with user-level Stop hooks configured (memory-review gate)
Suggested fix
Raise --max-turns to at least 2 (ideally 3-4 for margin) on both lines 176 and 242, or make it configurable via an env var (e.g. REMEMBER_MAX_TURNS) so users with hooks can adjust it. A nested invocation that inherits user Stop hooks cannot reliably complete in a single turn.
Fixed in #101 — thank you! 🙏 The Stop-hook angle was the key extra insight: a user Stop hook consumes another turn, so even 2 can be too tight. The default is now 4 (clears the 2.x prompt-delivery turn plus a Stop-hook turn, with margin) and is overridable via REMEMBER_MAX_TURNS.
Activity
refactor: single claude call site — bash delegates to pipeline call-h…
refactor: single claude call site — bash delegates to pipeline call-h…
refactor: one claude call site (fixes CC 2.x max-turns #98/#100 + mcp…
fdaviddpt commentedon Jun 18, 2026
Fixed in #101 — thank you! 🙏 The Stop-hook angle was the key extra insight: a user Stop hook consumes another turn, so even 2 can be too tight. The default is now 4 (clears the 2.x prompt-delivery turn plus a Stop-hook turn, with margin) and is overridable via
REMEMBER_MAX_TURNS.release: 0.8.0 (#106)