# Sessions Source: https://docs.ideharmony.com/tui/sessions A session is a durable conversation with an agent, owned by the daemon. Your terminal is a view onto it. Getting the six session verbs straight prevents most accidental work loss. ## The six verbs | Command | Effect on the session | Effect on your terminal | |---|---|---| | `/attach` | Connects you to an existing session | Shows it | | `/detach` | **Keeps it running** | Releases your terminal | | `/resume` | Reconnects to the most recent paused session | Shows it | | `/fork` | Branches a copy from the current state | Shows the branch | | `/stop` | **Cancels the in-flight turn** | Stays attached | | `/quit` | Detaches all sessions and exits | Closes | > [!IMPORTANT] > `/detach` and `/stop` are the pair people confuse. Detach leaves the agent > working and gives you your terminal back. Stop cancels the current turn but > leaves you attached. They are close to opposites. ## Detaching is the normal thing to do If an agent is doing something that takes minutes, you do not have to sit and watch: ```text /detach ``` The turn continues in the daemon. Come back with: ```text /resume ``` Or attach to a specific session: ```text /attach ``` ## Forking `/fork` branches from the current conversation state, which is useful when you want to try a second approach without losing the first. > [!TIP] > Fork before a risky instruction, not after it goes wrong. Forking preserves > the state you had at the fork point; it cannot recover a state you already > talked past. ## Sessions survive more than you expect Because the daemon owns them, sessions survive: - Closing the TUI - Closing the desktop - Closing the terminal - Rebooting the machine They do not survive being explicitly stopped, and they do not survive past their retention window. **Verify what exists:** ```powershell harmony sessions list ``` ## Clearing versus compacting | Command | Does | |---|---| | `/clear` | Clears the composer | | `/compact` | Summarizes and compacts the conversation to reclaim context budget | Compacting is lossy by design — it trades detail for room. Do it at a natural boundary. ## Common recovery | Symptom | Cause | Fix | |---|---|---| | Session missing after restart | Stopped, not detached | Nothing to recover; check `harmony sessions` | | `/resume` finds nothing | No paused session for this workspace | `harmony sessions` to list what exists | | Attached but the transcript is empty | Reattached to a fresh session | Check the session id in the header | | Turn will not cancel | Provider is not responding to cancellation | `/stop`, then check the provider pane | ## Related - [Session survival](/docs/concepts/session-survival) - [The composer](/docs/tui/composer) - [Daemon problems](/docs/troubleshooting/daemon)