Overview
A Session is a single chat conversation with an AI assistant within a worktree. Each worktree can have multiple sessions, allowing you to work on different tasks simultaneously or organize your work by topic.Session Structure
Session Type
Chat Message
Tool Calls
Assistant messages contain tool calls representing AI actions:Tool calls are displayed inline in the chat, showing what the AI is doing (reading files, running commands, editing code).
Session Lifecycle
1. Creation
Sessions are created automatically when you open a worktree for the first time, or manually via the “New Session” button.2. Active Session Management
Jean tracks the active session per worktree:active_session_id and persists it to disk.
3. Running a Session
When you send a message:- Message is added to
session.messages - AI backend starts streaming response
- Tool calls are executed in real-time
- Assistant message is saved when complete
- Session
updated_attimestamp is updated
4. Archiving
Archive a session to hide it from the active list:- Sets
archived_attimestamp - Hidden from session tabs
- Viewable in “Archived Sessions” modal
- Deleted after retention period (default: 7 days)
5. Deletion
Permanently delete a session:Session Naming
Jean can automatically name sessions based on your first message:- User sends first message
- AI generates a short, descriptive name (max 4-5 words)
- Session name is updated (e.g., “Fix login button bug”)
session_naming_completedis set totrue
Auto-naming prompt
Auto-naming prompt
The default naming prompt is:You can customize this in Settings → Advanced → Magic Prompts.
Context Management
Session Context (JSONL Logs)
Each session stores full conversation logs in JSONL format:Saving Context
Save important context for reuse:- Generates an AI summary of the session
- Saves as markdown file with frontmatter
- Stored in
~/Library/Application Support/<app>/session-context/ - Can be loaded into any future session
Loading Context
Load saved context into a session:Session Recovery
Jean automatically recovers from crashes:last_run_status: 'running':
- Jean detects the crash
- Recovers the partial message from JSONL logs
- Marks message with
recovered: true - Shows recovery banner in UI
Session Digests (Recaps)
When you return to a session that was active in the background, Jean can generate a brief recap:Experimental feature. Enable in Settings → Advanced → Session Recap.
Waiting for Input States
Sessions can wait for user input in two scenarios:1. AskUserQuestion
The AI asks for clarification:2. ExitPlanMode (Plan Approval)
In plan mode, the AI proposes a plan and waits for approval:Permission Denials
When tools require approval (in plan mode or restricted tools):Code Review Results
Sessions can store AI code review results:Labels
Organize sessions with custom labels:Token Usage Tracking
Storage Format
Sessions are stored in JSON:Related
Projects and Worktrees
Learn about project organization and worktree management
AI Chat
Configure AI backends, models, and chat settings