Documentation
CLICommands

ox agent

Commands for AI coding assistants. Provides session management, Team Context access, and diagnostics.

These commands are designed for AI coworkers, not humans. Your AI coworker runs these commands automatically when configured via CLAUDE.md or AGENTS.md hooks.

Usage

terminal
$

Subcommands

CommandDescription
ox agent primeInitialize agent session, inject Team Context
ox agent listList active AI coworkers and session state
ox agent <id> doctorCheck session health and find incomplete sessions
ox agent <id> sessionManage sessions (start, stop, summarize, etc.)
ox agent <id> tasksExecute scheduled work (list, next, done, cancel, extend)
ox agent <id> heartbeatSend a heartbeat and receive pending whispers
ox agent <id> whisperCheck for pending whispers
ox agent <id> querySemantic search across Team Context
ox agent <id> contextReport which surfaced context you used
ox agent hookHandle coding agent hook events
ox agent team-ctxRead Team Context content
ox agent redactView and test redaction policy

How it works

When an AI coworker starts working in a repository:

  1. Prime - The agent runs ox agent prime to get an agent_id and load Team Context
  2. Session start - Optionally starts a session to track the conversation
  3. Work - The agent performs tasks
  4. Session stop - Saves the session for future reference

The agent_id (e.g., Oxa7b3) identifies the agent throughout its session and is used as a prefix for subsequent commands.

ox agent prime

Initialize an agent session and inject Team Context. This is the most common agent command.

terminal
$

Output is XML by default; pass --format json for JSON. With --text, the output starts with the agent ID, for example Agent: Oxa7b3.

The returned agent_id is used as a prefix for all subsequent agent commands in that session.

For detailed coverage of context injection, see ox prime.

ox agent list

List all active AI coworkers and their session state.

terminal
$

ox agent <id> doctor

Check session health for a specific agent and find incomplete sessions.

terminal
$

Session management

Session commands track AI coworker conversations for future reference and team visibility.

Session subcommands

CommandDescription
startBegin recording a new session
stopEnd recording and save
logAppend a conversation entry
summarizeGenerate session summary
importImport a prior session
capture-priorCapture untracked history
recoverRecover stale/crashed session
abortDiscard active session
deleteDelete a completed session
remindEmit reminder info for active session
recordRecord batch session entries
planSave plan document to session
context-traceAccess context trace events
subagent-completeReport subagent completion to parent
subagent-listList subagent sessions

Start a session

terminal
$
FlagDescription
--titleHuman-readable session title

Stop a session

Stop recording and save the session.

terminal
$

Summarize a session

Generate a summary of the session content.

terminal
$
FlagDescription
--fileSession file to summarize

Log a conversation entry

Append a conversation entry to the active session.

terminal
$

Import a prior session

Import a session from another source, on stdin or with --file.

terminal
$
FlagDescription
--titleSession title
--filePath to session file

Capture prior history

Capture conversation history from a previous session that wasn't tracked. The input is schema-validated.

terminal
$
FlagDescription
--titleSession title
--filePath to history file
--session-idSpecific session ID to capture
--adapterAdapter for history format

Recover a session

Recover a stale or crashed session.

terminal
$

Abort a session

Discard the active session without saving. This is destructive.

terminal
$

Delete a session

Delete a completed session. This is destructive.

terminal
$

Scheduled tasks

Execute scheduled work. Run each task in a fresh-context subagent.

CommandDescription
ox agent <id> tasks listList ready agent tasks
ox agent <id> tasks nextClaim the top ready task
ox agent <id> tasks done <task-id>Mark a task completed
ox agent <id> tasks cancel <task-id>Mark a task canceled
ox agent <id> tasks extend <task-id>Extend the lease on long work
terminal
$

Whispers

Check for pending whispers (messages from humans or other AI coworkers).

terminal
$

During long tasks, send a heartbeat to stay in sync. The heartbeat also delivers pending whispers.

terminal
$

Query Team Context and repository knowledge.

terminal
$
FlagDescription
--limitMaximum number of results
--teamFilter by team ID
--repoFilter by repo ID

Report context you used

Report which surfaced context changed your work. Record an item when it changes what you do, or report that nothing did.

terminal
# A surfaced item changed what you do
$
# Nothing surfaced changed your work
$
# Surfaced items and their use evidence
$
FlagDescription
--whyOne line on how the context changed your work
--noneReport that no surfaced context was used

Lifecycle hooks

Handle coding agent hook events. Your coding agent's hooks call this command; it needs no agent ID.

terminal
$

The event is the coding agent's own hook event name, such as SessionStart, UserPromptSubmit, PostToolUse, or Stop.

Team Context access

Read Team Context content directly.

terminal
$

Without a slug, returns the full Team Context. With a slug, returns a specific section.

Redaction

View and test the redaction policy that filters sensitive information.

View policy

terminal
$

Test redaction

Test how a sample string would be redacted. Pass - to read the text from stdin.

terminal
$

Flags

These flags work with all ox agent commands:

FlagDescription
--reviewSecurity audit mode: human summary plus machine output
--textHuman-readable text output instead of the default machine output (JSON; ox agent prime defaults to XML)
--forceSkip confirmation for destructive operations, such as session abort and session delete

CLAUDE.md integration

AI coworkers like Claude Code are configured to run ox agent prime automatically via CLAUDE.md:

<!-- ox:prime --> Run `ox agent prime` on session start, after compaction, or clear.

This ensures the agent has Team Context loaded before starting work. The agent should re-prime after /clear or /compact commands that may clear context.

What's next