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
Use .claude/hooks/ (Stop, PreToolUse, PostToolUse) to persist agent work state before context compaction. Enables work to survive context window resets.
State persistence through hooks is a great pattern! claude-brain uses exactly this approach — PostToolUse hooks trigger git-based sync of your Claude Code brain files.
If you're exploring hook-based persistence, check out claude-brain. It hooks into Claude Code's lifecycle to automatically version-control and sync settings, CLAUDE.md, skills, and agents. Might give you some useful patterns for the persistence layer here.
Current state: Claude Code hooks are already used in Trinity for read-only mode (CFG-007):
PreToolUse hooks intercept Write/Edit/NotebookEdit to block source file modifications
Hooks injected via .claude/settings.json on agent containers
However, the specific use case in this issue — persisting agent work state before context compaction — is not implemented.
What's changed since filing:
Claude Code now has automatic context compaction with conversation compression
--resume {session_id} enables session continuity across executions
The MEMORY.md auto-memory system is built into Claude Code natively
Recommendation: The original problem (losing state on context window resets) is mitigated by Claude Code's built-in features. Consider closing or reframing as a more specific enhancement (e.g., "Auto-commit work-in-progress before context compaction").
Putting on hold — stop hooks cause execution failures
Testing in Apr 2026 (Cornelius/Oracle orchestration fleet) showed that Claude Code stop-session hooks break execution pipelines: when a hook fires on session end, the underlying Linux pipe isn't closed cleanly, producing a flood of false execution failures in the activity log. The agent shows hundreds of red 'failed' executions that are actually system-level pipe errors from the hook — not real task failures.
Not recommending stop hooks for state persistence at this time. This issue should be revisited only after the agent-server process lifecycle is hardened (likely post orchestration simplification work under #411).
Closed during backlog prioritization (2026-06-05): aged P1 "Later"-horizon feature off the current Reliability/Security critical path. Not planned for now — reopen if it becomes relevant.
Activity
toroleapinc commentedon Mar 3, 2026
State persistence through hooks is a great pattern! claude-brain uses exactly this approach — PostToolUse hooks trigger git-based sync of your Claude Code brain files.
If you're exploring hook-based persistence, check out claude-brain. It hooks into Claude Code's lifecycle to automatically version-control and sync settings, CLAUDE.md, skills, and agents. Might give you some useful patterns for the persistence layer here.
vybe commentedon Mar 30, 2026
Actualization (2026-03-30)
Current state: Claude Code hooks are already used in Trinity for read-only mode (CFG-007):
PreToolUsehooks intercept Write/Edit/NotebookEdit to block source file modifications.claude/settings.jsonon agent containersHowever, the specific use case in this issue — persisting agent work state before context compaction — is not implemented.
What's changed since filing:
--resume {session_id}enables session continuity across executionsMEMORY.mdauto-memory system is built into Claude Code nativelyRecommendation: The original problem (losing state on context window resets) is mitigated by Claude Code's built-in features. Consider closing or reframing as a more specific enhancement (e.g., "Auto-commit work-in-progress before context compaction").
vybe commentedon Apr 28, 2026
Putting on hold — stop hooks cause execution failures
Testing in Apr 2026 (Cornelius/Oracle orchestration fleet) showed that Claude Code stop-session hooks break execution pipelines: when a hook fires on session end, the underlying Linux pipe isn't closed cleanly, producing a flood of false execution failures in the activity log. The agent shows hundreds of red 'failed' executions that are actually system-level pipe errors from the hook — not real task failures.
Not recommending stop hooks for state persistence at this time. This issue should be revisited only after the agent-server process lifecycle is hardened (likely post orchestration simplification work under #411).
fix(startup): sweep Redis for orphan slots whose SQL row is terminal …
vybe commentedon Jun 5, 2026
Closed during backlog prioritization (2026-06-05): aged P1 "Later"-horizon feature off the current Reliability/Security critical path. Not planned for now — reopen if it becomes relevant.
feat(telegram): voice-out via ElevenLabs TTS + shared TTS foundation (#…
feat(whatsapp): voice-out via shared TTS (#56) — stacked on #25 (#1398)
feat(slack): voice-out via shared TTS (#26) — closes epic #24, stacke…
docs(user-docs): sync to dev state 2026-07-03 — v0.7.0 What's New + p…
chore(claude): bump the .claude submodule pin to 1d66592 (#2892)