Brokk Observe — plugin for Claude Code and OpenAI Codex
Records every Claude Code and Codex session for your organization's audit trail. The plugin captures prompts, tool calls (with inputs, outputs and timings), permission decisions, subagents, compactions, commits and PRs, and sends them to a Brokk Observe server. The server then:
- runs security detectors on each event and an optional LLM security review on each session,
- ranks people and agents on leaderboards,
- traces bugs back to the session that introduced them.
With enforce mode on, the plugin also applies your organization's central guardrail policies before each tool call runs (allow / ask / deny).
One plugin serves both agents: the two run command hooks that receive the same JSON, so the same script handles both. What differs in Codex is listed below.
Install
Sign in to your Brokk Observe dashboard, open Connect an agent, and run the command it shows in a terminal:
curl -fsSL https://observe.example.com/register.sh | bash -s [email protected]
It mails you a link and prints a short code. Open the link, enter the code, and the machine is registered to you: the script saves the server address and a key of its own in ~/.config/brokk-observe/config, then installs this plugin into Claude Code and into Codex, whichever of the claude and codex commands it finds. There is nothing else to set up. Start a new session and it appears in the dashboard.
Codex needs one more step. Codex does not run a plugin's hooks until you have reviewed them. The next time you start Codex it says that hooks need review: choose to trust the Brokk Observe ones there, or run /hooks. Until you do, nothing is recorded. After a plugin update that changes the hook script, Codex asks again.
If a command is not on your PATH, the script says so; install the plugin by hand instead. In Claude Code:
/plugin marketplace add BrokkAi/brokk-observe-plugin
/plugin install brokk-observe@brokk
For Codex, in a terminal:
codex plugin marketplace add BrokkAi/brokk-observe-plugin
codex plugin add brokk-observe@brokk
For CI, fleets and managed settings, skip registration and set a shared ingest token in the environment: export OBSERVE_URL=https://observe.example.com OBSERVE_TOKEN=bko_ingest_… (tokens are created in the dashboard under Settings → API keys).
Check it with /brokk-observe:status in Claude Code.
Commands
These are Claude Code slash commands.
| Command | What it does |
|---|
/brokk-observe:status | Server, token, enforcement mode, spooled events, and a live connectivity check |
/brokk-observe:session | This session's audit summary: tool calls, cost, risk score, open findings, dashboard link |
/brokk-observe:flush | Send any locally spooled events now |
/brokk-observe:backfill | Import this machine's sessions from before the plugin now, in the background, instead of at the next session start |
Codex has no plugin slash commands. Run the script behind them in a terminal instead, with --status, --session, --flush or --backfill codex:
~/.codex/plugins/cache/brokk/brokk-observe/*/scripts/observe-hook.sh --status
Codex
Requires a Codex CLI with plugin hooks; tested with 0.167.0.
| Claude Code | Codex |
|---|
| Shell commands | Bash | Bash (same detectors and policies) |
| File edits | Edit, Write, one call per file | apply_patch, one call for a whole patch. The server checks and counts it as the file writes and edits it makes, so a policy on Edit|Write and a file path covers it |
| Policy deny | blocks the call | blocks the call |
| Policy ask | pauses for the developer to approve | denies. A Codex hook cannot ask, and Codex would run the call if the hook tried to. The reason tells the developer to run it themselves if it is intended |
| Policy warn | adds the message to the agent's context | the same |
| Tokens and cost | from the transcript, or OpenTelemetry | reported by Codex after each model request |
| Failed commands | reported by a hook | the exit code is read from the session log, so it shows once the log is uploaded (at the end of each turn) |
| Permissions bypassed | reported by a hook | Codex reports a bypass whenever it will not ask for approval, even inside its sandbox. That is recorded as never-ask; the permissions bypassed finding needs the session log, which says whether the sandbox was off too |
| Session end | delivered before Claude Code exits | delivered in the background: Codex stops that hook after three seconds |
| Hosted tools (web search) | hooked | not hooked by Codex, so not recorded |
The hooks Codex runs are in hooks/codex-hooks.json. Both agents share one registration and one config file; each keeps its own local spool.
Settings