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
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:
- Fetches Team Context - Retrieves your team's shared knowledge base from SageOx
- Injects Context - Provides it to the agent in a format it can use
- 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:
- Repository initialized with SageOx (
ox init) - Valid authentication (
ox login) - 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
| Agent | Status | How it receives SageOx context |
|---|---|---|
| Claude Code | Supported | ox agent prime via CLAUDE.md hook |
| Conductor | Supported | ox agent prime via orchestrated session |
| Codex | Supported | Codex CLI hooks (ox integrate install --codex) |
| Gemini CLI | Supported | Gemini CLI hooks (ox integrate install --gemini) |
| Amp | Supported | AGENTS.md marker (ox integrate install --amp) |
| Pi | Supported | AGENTS.md marker (ox integrate install --pi) |
| OpenCode | Supported | OpenCode plugin (ox integrate install --opencode) |
| Cursor Agents Window | Supported | Cursor Agents Window hooks (ox integrate install --cursor) |
| Factory Droid | Supported | Factory Droid hooks (ox integrate install --droid) |
| OMP | Supported | .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:
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:
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:
| Event | Context Status |
|---|---|
| Session start | Not loaded yet |
/clear command | Cleared |
/compact command | May be lost |
| Context overflow | Truncated |
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/clearor/compact. A manualox agent primelater in that session prints only a short update, so rely on the hook. Runox doctorto check that the hook is installed. - Without hooks: re-run
ox agent primewithout--idempotent. The session is still marked as primed, so--idempotentprints nothing.
Use --idempotent only to skip a repeat prime while the earlier output is still in context.
Flags
| Flag | Description |
|---|---|
--agent | Agent identifier (claude-code, cursor, droid, windsurf) |
--agent-ver | Agent version (for example, 1.0.42) |
--format | Output format: xml (default) or json |
--idempotent | Skip priming if the session is already primed (token optimization) |
--model | Model identifier (for example, claude-opus-4-5, gpt-4o) |
--review | Security audit mode: show an English summary plus JSON |
--text | Output 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 primefor each coding agent - ox doctor - Diagnose configuration issues
- ox login - Authentication

