Sessions
Session Lifecycle: Create, Reuse, and Clean Up
Use sessions to keep conversation continuity and reproducibility in scripts and operations.
Step 1: Create first sessions through ask/chat
mosaic --project-state --profile default ask "hello session"
mosaic --project-state --profile default chat
Exit chat with /exit so session files are flushed.
Step 2: List all sessions
mosaic --project-state --profile default session list
Step 3: Inspect one session in detail
mosaic --project-state --profile default session show <session_id>
Step 4: Resume a previous session
mosaic --project-state --profile default session resume <session_id>
# continue via ask/chat with explicit session binding
mosaic --project-state --profile default ask --session <session_id> "continue from previous context"
mosaic --project-state --profile default chat --session <session_id>
Step 5: Rotate between sessions
mosaic --project-state --profile default ask --session <session_a> "summary A"
mosaic --project-state --profile default ask --session <session_b> "summary B"
mosaic --project-state --profile default session list
Step 6: Clear obsolete sessions
mosaic --project-state --profile default session clear <session_id>
# full cleanup
mosaic --project-state --profile default session clear --all
Step 7: JSON mode for CI and audit pipelines
mosaic --project-state --profile default --json session list
mosaic --project-state --profile default --json session show <session_id>
Step 8: Troubleshooting
- If session commands fail with config errors, run
setupfor that profile first. - If resume is inconsistent, verify
--profileand--project-stateare unchanged. - Use
logs --tail 120anddoctorfor diagnosis.