Skip to main content

What is a session?

Every successful analyze run creates a work session: a snapshot of the analysis (full issue list, blast radius, metadata) stored on disk so you can autofix, verify, and diff without rescanning the tree. Sessions are identified by a short hex id (for example a1b2c3) and progress through phases:
PhaseMeaning
analyzedScan finished; issues are available for the issue browser and autofix
fixingReserved for in-progress fix passes
fixedautofix completed (applied and blocked counts recorded)
verifiedverify completed (per-file confidence and checks recorded)

Where sessions live

Sessions are stored as JSON under your project:
.refactron/work-sessions/{session-id}.json
The active session in memory is whichever run of analyze or session (with a session id) last activated a session. Commands such as autofix, verify, diff, and issues use the active session.

Typical workflow

  1. analyze src/ — Creates a new session, sets it active, opens the interactive issue browser.
  2. Fix in the browser or run autofix — Updates the same session with fix results (applied vs blocked).
  3. verify — Runs verification for fixable files and updates the session with pass/block counts.
  4. session list — Lists saved sessions on disk (newest first).
  5. session + session id — Loads a previous session and makes it active so you can continue without a new scan (example: session a1b2c3).

What is stored

Each session file includes:
  • Analysis — Target path, file counts, full CodeIssue[] list (including blast radius), timestamps.
  • Fix (after autofix) — Dry-run flag, applied vs blocked fix queue items, optional diffs.
  • Verify (after verify) — Per-file entries with safe, confidence, checks run, and blocking reasons.
This design keeps the REPL responsive: heavy analysis runs once; later steps reuse the stored issues.
CommandRole
statusShows the active session (or the latest saved session if none is active)
issuesReopens the issue browser for the active session
diffPrints unified diffs from the last autofix results in the active session
If you restart the CLI, run session list and then session with the desired id to resume work without re-running analyze.