Documentation Index
Fetch the complete documentation index at: https://opensre.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Every time you start the OpenSRE interactive shell, a new session is created and recorded to disk. Each session captures:- When it started and how long it lasted
- Every interaction — chats, investigations, slash commands, incoming alerts
- Aggregate counts (total turns, investigations run)
~/.opensre/sessions/. They are written incrementally — the file exists on disk from the moment the REPL starts, so /sessions always shows the current session alongside past ones.
Session lifecycle
| Event | What happens |
|---|---|
| REPL starts | session_start record written immediately; file created at ~/.opensre/sessions/<session-id>.jsonl |
| Each interaction | One turn record appended to the open file |
/reset | Current session closed (session_end written); new session file opened with a fresh ID |
| REPL exits | session_end written; file is deleted if no turns were recorded (empty session) |
| REPL crash | File remains with all turns up to the crash but no session_end — stats computed from the turn records |
Session file format
Each session is a JSONL file (one JSON object per line).session_start — first line
turn — one per interaction
kind values:
| Kind | Description |
|---|---|
chat | Free-text message routed to the LLM assistant |
alert | Investigation triggered by an alert payload |
incoming_alert | Alert received via the HTTP listener |
slash | Slash command (/status, /reset, etc.) |
shell | Shell command executed via the terminal runtime |
session_end — last line (when session closed cleanly)
session_end record (crash or ongoing) is still valid — /sessions computes total_turns, chat_turns, and investigation_turns by scanning the turn records directly.
/sessions command
Run/sessions inside the REPL to list recent sessions:
(current) with a live-updating elapsed time. Sessions without a session_end (crash or in-progress) show accurate turn counts computed from the file.
Up to 20 sessions are shown, newest first.
Storage location
What is NOT stored
- LLM response content (stored separately in
~/.opensre/prompt_log.jsonlif prompt logging is enabled) - Full alert payloads or investigation results (stored in
~/.opensre/investigations/) - Secrets or credentials — session text is stored as typed; enable prompt log redaction if needed
Linking sessions to other data
Thesession_id in each session file matches the session_id field in ~/.opensre/prompt_log.jsonl. This means you can correlate a session’s turn list with the full prompt/response pairs and token usage recorded in the prompt log.
Related
- Interactive Shell Privacy — command history redaction and persistence controls
- Prompt Logging — full prompt/response logging configuration
Tracer