---
created: 2026-04-12T15:20:00.000Z
title: Stop hook commune wrapper for automatic Psyche updates
area: psyche
files: []
---

## Problem

Currently, communes to Psyche only happen when the user or agent explicitly triggers `/spt:commune`. This means Psyche often lacks context about what Self has been working on, leading to stale or irrelevant pulses/insights.

## Solution

Automatic, frequent hidden communes via a Stop hook mechanism:

1. **Stop hook** spawns a ~5s delayed, detached "commune wrapper" process
2. The wrapper performs a `--resume` of the current Claude Code session, branching context at the stopping point
3. The wrapper passes in a prompt telling Self this is a **commune checkpoint** — Self should consider if there's anything worth communing
4. If Self decides yes, it outputs `[COMMUNE] message here` and ends its turn
5. If stdout matches that format, the commune wrapper forwards the message to Psyche's inbox as a COMMUNE
6. If Self decides nothing is worth communing, it outputs nothing and the wrapper exits silently

This gives Psyche a continuous drip of context without the user or Self needing to explicitly commune. The 5s delay avoids interfering with rapid consecutive turns.
