SageOx

The hivemind for agentic engineering

Cookbooks

SageOx + OpenClaw

OpenClaw orchestrates automated AI coding sessions — spawning agents that work on issues, PRs, and maintenance tasks without human intervention. SageOx gives those agents the same team context a human coworker would have, and their discoveries flow back into your team's knowledge base.

How it works

Loading diagram...
Mermaid diagram

Every factory-spawned session follows the same lifecycle as a human coding session — it receives team context on startup, and its discoveries flow back into the knowledge base.

What you need

  • SageOx CLI installed (ox)
  • A connected repo (ox init)
  • An OpenClaw account with factory access

Setup

1. Connect your repo

terminal
$
$
$

ox init configures your CLAUDE.md with the ox agent prime hook. This is the universal integration point — any tool that starts Claude Code in your repo gets SageOx context automatically, including OpenClaw.

2. Verify factory agents receive context

When OpenClaw spawns a session, it starts Claude Code in your repo. Claude Code reads CLAUDE.md and runs ox agent prime. Verify with:

terminal
$

Each factory agent receives the full team context payload:

Context layerWhat the agent receives
Team normsAGENTS.md conventions, coding standards
Architecture decisionsDistilled discussions and recordings
Domain terminologyTeam-specific vocabulary and concepts
Recent memorySummaries from recent team activity
Current workWhat's happening across your product

3. Enable session capture

Configure factory sessions to use session capture:

/ox-session-start
... agent works on the issue ...
/ox-session-stop

Session transcripts — the agent's reasoning, decisions, and code changes — get committed to your repo's Ledger and feed into future sessions.

The overnight factory pattern

Run OpenClaw agents on a nightly schedule against your backlog:

  1. OpenClaw picks issues labeled factory-ready from your tracker
  2. For each issue, it spawns a Claude Code session in the relevant repo
  3. ox agent prime injects team context including yesterday's distilled insights
  4. The agent works on the issue, commits code, opens a PR
  5. Session artifacts are captured to the Ledger
  6. Distillation extracts insights for future sessions

Your team arrives to PRs ready for review, with full context on why each change was made.

Multi-agent awareness

When multiple agents run in parallel — each in its own git worktree working on a different issue — SageOx ensures they share context:

  • An agent refactoring the auth module knows another agent is adding a new endpoint that depends on auth
  • An agent updating types knows another agent changed the schema those types derive from
  • Merge conflicts and duplicate work drop because agents are aware of each other's in-flight changes

This is the difference between N isolated agents and N agents that collaborate.

Cross-platform context

Most coding agents have some form of memory or team context — but it's locked to that vendor. Claude Code's memory doesn't reach Codex. If your team uses more than one agent platform, each agent operates blind to what the others know.

SageOx sits underneath all of them. Because context flows through the repo itself via ox agent prime, it works with any agent that reads CLAUDE.md or AGENTS.md. A discovery made in one agent is available to every other agent in the next session.

The compounding loop

The real power is the feedback loop between factory agents and distillation:

  1. Factory agent works on an issue — discovers that the payment service needs a retry wrapper
  2. Session gets captured to the Ledger
  3. Distillation extracts the insight — "payment service calls need retry wrappers due to intermittent timeouts"
  4. Next factory session receives this via team context
  5. That agent adds retries proactively when touching payment code

After a month of factory runs plus distillation, your agents have absorbed hundreds of codebase-specific insights that no prompt engineering could replicate.

Best practices

Start with well-scoped issues Factory agents work best on issues with clear acceptance criteria. "Add retry logic to payment service" beats "improve reliability".

Review PR descriptions Factory agents include their reasoning in PR descriptions. This becomes part of the permanent record and feeds future context.

Capture important sessions Use /ox-session-start for sessions that produce valuable insights. Not every session needs capturing — focus on debugging breakthroughs and architecture decisions.

Feed recordings into context Import Loom walkthroughs and design sessions. Factory agents implementing UI benefit from design rationale captured in recordings.

What's next