Skip to main content

Overview

The Sessions Registry schema defines the structure for managing multiple concurrent work sessions within CLEO. It enables parallel work on different task groups (epics, task groups, phase-filtered views) while maintaining isolated focus state and scope boundaries for each session.

Schema Definition

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://cleo.dev/schemas/v1/sessions.schema.json",
  "schemaVersion": "1.0.0",
  "title": "CLEO Sessions Registry Schema",
  "description": "Multi-session management for concurrent LLM agents...",
  "type": "object",
  "required": ["version", "project", "sessions", "_meta"],
  "additionalProperties": false
}

Properties

Root Properties

PropertyTypeRequiredDescription
versionstringYesLegacy schema version (deprecated, use _meta.schemaVersion)
projectstringYesProject identifier. Must match todo.json project.name
_metaobjectYesRegistry metadata for integrity and configuration
configobjectNoSession registry runtime configuration
sessionsarrayYesActive and suspended sessions
sessionHistoryarrayNoEnded sessions preserved for resume capability

_meta Object

PropertyTypeRequiredDescription
schemaVersionstringYesSchema version (semver). Canonical source for version
checksumstringYesSHA-256 truncated hash of sessions array (16 hex chars)
lastModifiedstringYesISO 8601 timestamp of last modification
totalSessionsCreatedintegerNoRunning count of all sessions ever created
lastSessionIdstring/nullNoMost recently created/modified session ID

config Object

PropertyTypeRequiredDefaultDescription
maxConcurrentSessionsintegerNo5Maximum active sessions allowed (1-10)
maxActiveTasksPerScopeintegerNo1Maximum active tasks within a single session scope (1-3)
scopeValidationstringNo”strict”strict/warn/none - validation level for scope overlap
allowNestedScopesbooleanNotrueAllow session scopes that are subsets of other scopes
allowScopeOverlapbooleanNofalseAllow sessions with partially overlapping scopes

Session Object

PropertyTypeRequiredDescription
idstringYesUnique session ID (format: session_YYYYMMDD_HHMMSS_6hex)
statusstringYesactive, suspended, ended, or archived
endedAtstring/nullNoWhen session was ended (null if active/suspended)
agentIdstring/nullNoOptional agent identifier (e.g., ‘opus-1’)
namestring/nullNoOptional human-readable session name (max 100 chars)
scopeobjectYesSession scope definition
focusobjectYesSession-local focus state
startedAtstringYesISO 8601 timestamp when session was created
lastActivitystringYesMost recent activity timestamp
suspendedAtstring/nullNoWhen session was suspended
archivedAtstring/nullNoWhen session was archived
resumeCountintegerNoNumber of times session has been resumed
statsobjectNoSession activity statistics

Session Scope Object

PropertyTypeRequiredDescription
typestringYestask, taskGroup, subtree, epicPhase, epic, or custom
rootTaskIdstringYesAnchor task ID (must exist in todo.json)
phaseFilterstring/nullNoOptional phase filter (lowercase with hyphens)
labelFilterarray/nullNoLabels required for tasks to be in scope
includeDescendantsbooleanNoInclude all descendants (true) or direct children only (false)
maxDepthinteger/nullNoDepth limit from rootTaskId (1-10, null = unlimited)
explicitTaskIdsarray/nullNoFor custom type: explicit list of task IDs
excludeTaskIdsarray/nullNoTask IDs explicitly excluded from scope
computedTaskIdsarray/nullNoCached list of task IDs in scope (read-only)
computedAtstring/nullNoWhen computedTaskIds was last calculated

Session Focus Object

PropertyTypeRequiredDescription
currentTaskstring/nullNoTask ID being worked on (must be within scope)
currentPhasestring/nullNoPhase of currently focused task (cached)
previousTaskstring/nullNoPreviously focused task for quick switching
sessionNotestring/nullNoContext and progress notes (max 2000 chars)
nextActionstring/nullNoSpecific next step when resuming (max 500 chars)
blockedReasonstring/nullNoWhy session is blocked (max 500 chars)
focusHistoryarray/nullNoRecent focus changes (max 20 items)

Session Stats Object

PropertyTypeRequiredDefaultDescription
tasksCompletedintegerNo0Tasks marked done during this session
tasksCreatedintegerNo0Tasks created during this session
tasksUpdatedintegerNo0Tasks modified during this session
focusChangesintegerNo0Number of focus switches during session
totalActiveMinutesintegerNo0Cumulative active time (excluding suspended)
suspendCountintegerNo0Number of times session was suspended

Session History Entry Object

PropertyTypeRequiredDescription
idstringYesSession ID
namestring/nullNoSession name
agentIdstring/nullNoAgent identifier
scopeobjectYesSession scope
startedAtstringYesSession start timestamp
endedAtstringYesSession end timestamp
endReasonstringNocompleted, timeout, user_ended, error, or superseded
endNotestring/nullNoFinal session note (max 2000 chars)
lastFocusedTaskstring/nullNoLast focused task when session ended
statsobjectNoSession statistics
resumablebooleanNoWhether session can be resumed
resumedAsstring/nullNoNew session ID if this was resumed

Examples

Valid Sessions Registry

{
  "version": "1.0.0",
  "project": "my-project",
  "_meta": {
    "schemaVersion": "1.0.0",
    "checksum": "a1b2c3d4e5f67890",
    "lastModified": "2026-01-27T20:00:00Z",
    "totalSessionsCreated": 3,
    "lastSessionId": "session_20260127_221258_c83952"
  },
  "config": {
    "maxConcurrentSessions": 5,
    "maxActiveTasksPerScope": 1,
    "scopeValidation": "strict",
    "allowNestedScopes": true,
    "allowScopeOverlap": false
  },
  "sessions": [
    {
      "id": "session_20260127_221258_c83952",
      "status": "active",
      "name": "Auth Implementation",
      "agentId": "claude-code-1",
      "scope": {
        "type": "epic",
        "rootTaskId": "T1001",
        "includeDescendants": true
      },
      "focus": {
        "currentTask": "T2597",
        "currentPhase": "implementation",
        "previousTask": null,
        "sessionNote": "Working on schema documentation",
        "nextAction": "Complete remaining schema docs",
        "blockedReason": null,
        "focusHistory": [
          {
            "taskId": "T2597",
            "timestamp": "2026-01-27T22:15:00Z",
            "action": "focused"
          }
        ]
      },
      "startedAt": "2026-01-27T22:12:58Z",
      "lastActivity": "2026-01-27T22:30:00Z",
      "endedAt": null,
      "suspendedAt": null,
      "archivedAt": null,
      "resumeCount": 0,
      "stats": {
        "tasksCompleted": 0,
        "tasksCreated": 0,
        "tasksUpdated": 1,
        "focusChanges": 1,
        "totalActiveMinutes": 17,
        "suspendCount": 0
      }
    }
  ],
  "sessionHistory": []
}

Usage

The sessions schema is used in the following CLEO components:
  • .claude/sessions.json: Stores the active sessions registry
  • cleo session commands: All session management operations validate against this schema
  • Multi-agent coordination: Enables parallel work by different agents on non-overlapping scopes
  • Session persistence: Allows resuming work across Claude Code sessions

Scope Types

The scope.type field determines how tasks are included:
  • task: Single task only
  • taskGroup: Parent task and its direct children
  • subtree: Parent task and all descendants
  • epicPhase: Epic tasks filtered by a specific phase
  • epic: Full epic tree with all descendants
  • custom: Explicit list of task IDs

Status Transitions

Sessions follow this status lifecycle:
  1. activesuspended: Pause work temporarily
  2. activeended: Complete or stop work
  3. suspendedactive: Resume work
  4. suspendedended: End without resuming
  5. endedarchived: Move to read-only history