Documentation
CLICommands

ox agent prime

ox agent prime injects Team Context into AI coding agents, providing them with domain-specific guidance, architectural decisions, and coding conventions.

Usage

terminal
$

The command is designed for fail-fast operation. It never blocks coding agents for extended periods.

How it works

When an agent runs ox agent prime:

  1. Fetches Team Context - Retrieves your team's shared knowledge base from SageOx
  2. Injects Context - Provides it to the agent in a format it can use
  3. Confirms with Agent ID - Returns a unique identifier confirming context is active

The agent then has access to:

  • Team norms and conventions
  • Architectural decisions
  • Distilled learnings from past work
  • Domain-specific guidance

Setup

Context injection is automatically configured when you run ox init in a repository. The agent needs:

  1. Repository initialized with SageOx (ox init)
  2. Valid authentication (ox login)
  3. Shell access to run the command

Agents like Claude Code can be configured to run ox agent prime automatically via CLAUDE.md instructions.

Supported agents

AgentStatusHow it receives SageOx context
Claude CodeSupportedox agent prime via CLAUDE.md hook
ConductorSupportedox agent prime via orchestrated session
CodexSupportedCodex CLI hooks (ox integrate install --codex)
Gemini CLISupportedGemini CLI hooks (ox integrate install --gemini)
AmpSupportedAGENTS.md marker (ox integrate install --amp)
PiSupportedAGENTS.md marker (ox integrate install --pi)
OpenCodeSupportedOpenCode plugin (ox integrate install --opencode)
Cursor Agents WindowSupportedCursor Agents Window hooks (ox integrate install --cursor)
Factory DroidSupportedFactory Droid hooks (ox integrate install --droid)
OMPSupported.omp/AGENTS.md marker (ox integrate install --omp)

Because SageOx injects context through the repo itself (not through a vendor-specific API), a discovery made by a Claude Code session is available to a Codex agent in the next session. No vendor lock-in on your team's accumulated knowledge.

Check that it's working

Agent has context

Ask the agent: "Are you using SageOx?"

A primed agent responds with its agent_id:

agent response
Yes, I'm using SageOx. My agent ID is: Oxa7b3

Command output

Output is XML by default, structured for the agent to read. Pass --format json for JSON, or --text for a human-readable summary that starts with the agent ID:

ox agent prime --text
Agent: Oxa7b3
...

Pass --review for a security audit view: an English summary of what the agent receives, plus the JSON.

Doctor check

Run ox doctor to verify context injection is configured.

When context is lost

Agents lose injected context when:

EventContext Status
Session startNot loaded yet
/clear commandCleared
/compact commandMay be lost
Context overflowTruncated

After these events, the agent needs a full prime again:

  • With hooks (ox integrate install): the hook primes the agent in full when a session starts and after /clear or /compact. A manual ox agent prime later in that session prints only a short update, so rely on the hook. Run ox doctor to check that the hook is installed.
  • Without hooks: re-run ox agent prime without --idempotent. The session is still marked as primed, so --idempotent prints nothing.

Use --idempotent only to skip a repeat prime while the earlier output is still in context.

Flags

FlagDescription
--agentAgent identifier (claude-code, cursor, droid, windsurf)
--agent-verAgent version (for example, 1.0.42)
--formatOutput format: xml (default) or json
--idempotentSkip priming if the session is already primed (token optimization)
--modelModel identifier (for example, claude-opus-4-5, gpt-4o)
--reviewSecurity audit mode: show an English summary plus JSON
--textOutput human-readable text instead of JSON

Troubleshooting

No agent_id returned - Check ox doctor for configuration issues

Context not reflected in responses - Verify the agent actually ran the command (check for agent_id)

Stale context - Re-run ox agent prime to load the latest Team Context

What's next

  • ox init - Initialize repository (required first)
  • ox integrate - Install the hooks that run ox agent prime for each coding agent
  • ox doctor - Diagnose configuration issues
  • ox login - Authentication