Static ReadonlyDEFAULT_Default stall threshold: 2 min (Issue #392: 1.5x CC's 90s default, configurable via CLAUDE_STREAM_IDLE_TIMEOUT_MS).
Static ReadonlyDEFAULT_Static ReadonlyDEFAULT_Default timeout for waiting CC to become ready (60s for cold starts).
Static ReadonlyDEFAULT_Max retries if CC doesn't become ready in time.
Load state from disk.
Issue #397: Reconcile after tmux server crash recovery. Called when the monitor detects tmux server came back after a crash. Returns counts for observability.
Save state to disk atomically (write to temp, then rename). #218: Uses a write queue to serialize concurrent saves and prevent corruption.
#357: Debounced save — skips immediate save for offset-only changes. Coalesces rapid successive reads into a single disk write.
Wait for CC to show its idle prompt in the tmux pane, then send the initial prompt. Uses exponential backoff on retry: first attempt waits timeoutMs, subsequent attempts wait 1.5x the previous timeout.
Returns delivery result. Logs warnings on each retry for observability.
OptionaltimeoutMs: numberOptionalmaxRetries: numberOptionalname?: stringOptionalprd?: stringOptionalresumeSessionId?: stringOptionalclaudeCommand?: stringOptionalenv?: Record<string, string>OptionalstallThresholdMs?: numberOptionalpermissionStallMs?: numberOptionalpermissionMode?: stringOptionalautoApprove?: booleanOptionalparentId?: stringIssue #702: Parent session ID for sub-agent hierarchy
Issue #169 Phase 3: Update session status from a hook event. Returns the previous status for change detection. Issue #87: Also records hook latency timestamps.
OptionalhookTimestamp: numberIssue #812: Detect if CC is waiting for user input by analyzing the JSONL transcript. Returns true if the last assistant message has text content only (no tool_use).
Issue #88: Add an active subagent to a session.
Issue #88: Remove an active subagent from a session.
Issue #89 L25: Update the model field on a session from hook payload.
Issue #87: Get latency metrics for a session.
Check if a session's tmux window still exists and has a live process. Issue #69: A window can exist with a crashed/zombie CC process (zombie window). After checking window exists, also verify the pane PID is alive. Issue #390: Check stored ccPid first for immediate crash detection. When CC crashes (SIGKILL, OOM), the shell prompt returns in the pane, so the current pane PID is the shell (alive). Checking ccPid catches the crash within seconds instead of waiting for the 5-min stall timer.
List all sessions.
Issue #607: Find an idle session for the given workDir. Returns the most recently active idle session, or null if none found. Used to resume existing sessions instead of creating duplicates. Issue #636: Verifies tmux window is still alive before returning. Issue #840/#880: Atomically acquires the session under a mutex to prevent TOCTOU race.
Release a session claim after the reuse path completes (success or failure).
Get health info for a session. Issue #2: Returns comprehensive health status for orchestrators.
Send a message to a session with delivery verification. Issue #1: Uses capture-pane to verify the prompt was delivered. Returns delivery status for API response.
Record that a permission prompt was detected for this session.
Approve a permission prompt. Resolves pending hook permission first, falls back to tmux send-keys.
Reject a permission prompt. Resolves pending hook permission first, falls back to tmux send-keys.
Issue #284: Store a pending permission request and return a promise that resolves when the client approves/rejects via the API.
Aegis session ID
Timeout before auto-rejecting (default 10_000ms, matching CC's hook timeout)
OptionaltoolName: stringOptional tool name from the hook payload
Optionalprompt: stringOptional permission prompt text
Promise that resolves with the client's decision
Check if a session has a pending permission request.
Get info about a pending permission (for API responses).
Clean up any pending permission for a session (e.g. on session delete).
Issue #336: Store a pending AskUserQuestion and return a promise that resolves when the external client provides an answer via POST /answer.
Issue #336: Submit an answer to a pending question. Returns true if resolved.
Issue #336: Check if a session has a pending question.
Issue #336: Clean up any pending question for a session.
Send Escape key.
Send Ctrl+C.
Read new messages from a session.
Read new messages for the monitor (separate offset from API reads).
Issue #35: Get a condensed summary of a session's transcript.
Paginated transcript read — does NOT advance the session's byteOffset.
OptionalroleFilter: "user" | "assistant" | "system"Cursor-based transcript read — stable under concurrent appends.
Uses 1-based sequential entry indices as cursors.
beforeId: exclusive upper bound (fetch entries with index < beforeId).
If omitted, fetch the newest limit entries.limit: max entries to return (capped at 200).OptionalbeforeId: numberOptionalroleFilter: "user" | "assistant" | "system"Kill a session.
Coordinates session lifecycle, persistence, transcript discovery, and interactive approval/question flows for all managed Claude Code sessions.