---
title: "Agent Oversight for Claude Code and Codex CLI"
description: "Inspect tools for reviewing agent work, session records, and controlled writes. Read setup, source evidence, and limits before using them in a workflow."
canonical: "https://scalewithsearch.com/code/agent-oversight"
date: "2026-10-06"
---
# Agent Oversight for Claude Code and Codex CLI.

Check agent work from outside the agent. Seven tools score responses, report sessions and recorded tokens, bind review receipts to file hashes, and control REST writes.

[Source repository](https://github.com/b2bvic/agent-oversight)

## Team workflow with the agent-oversight repository

Select the evidence you need before accepting a completion claim. Inspect process and transcript observations, run the applicable checks, and review their output. Enforce authorization in the service that executes an external action.

## Quick start for the agent-oversight repository

Use Python 3.11 or newer. Observer-daemon requires Rust 1.88 or newer and Cargo. Observer-protocol requires Node.js 22 or 24 and npm.

```sh
git clone https://github.com/b2bvic/agent-oversight.git
cd agent-oversight
python3 -m unittest discover -s tests -v
```

The root suite uses synthetic fixtures without reading private transcripts. Follow each component README before compiling or installing its runtime.

## How the agent-oversight repository works

Each tool runs independently, keeps its tests in its folder, and reports what it checked. You supply coordination, scheduling, and approval integration. The root fixtures cover provider identity collisions, mirrored assistant text, tool correlation, and recorded token fields. You inspect EVALUATION.md to record inputs, revisions, failures, and missing evidence. Component tests check their own implementations.

## Components of the agent-oversight repository

Select a component to inspect its purpose, example, and limits:

- [agent-monitor](#agent-monitor)
- [observer-daemon](#observer-daemon)
- [observer-protocol](#observer-protocol)
- [swarm-contract](#swarm-contract)
- [effect-gate-template](#effect-gate-template)
- [safe-api](#safe-api)
- [skills](#skills)

Start each component example from the cloned repository root. Use a fresh shell for each example.

### agent-monitor

You inspect local Claude Code and Codex CLI processes and recorded usage with agent-monitor. You select transcript roots, a time window, and report paths. Read the coverage warnings alongside provider cache fields and cumulative usage observations. The example writes reports from synthetic fixtures.

```sh
cd components/agent-monitor
python3 ./agent-monitor \
  --claude-root tests/fixtures/multiple_projects/claude/projects \
  --codex-root tests/fixtures/multiple_projects/codex \
  --ps-file tests/fixtures/processes/empty.jsonl \
  --now 2026-01-15T13:00:00Z \
  --json-output ./status.json ./status.md
```

**Limits**

- The tool reads local Claude Code and Codex CLI transcripts. Protect reports that contain session observations.
- Missing or unsupported records leave coverage unknown or partial. Cumulative usage observations can remain ambiguous.
- The report provides no account billing totals, cost estimate, or remaining subscription allowance.

See the source repository’s RELEASING.md before packaging a source change.

### observer-daemon

You score responses against configured writing rules with observer-daemon. You select a rubric and record violations from supported Claude and Codex JSONL messages. Use a copied spec with isolated ledger paths for one-shot validation before reviewing transcript watch paths for daemon mode.

```sh
cd components/observer-daemon
mkdir -p .demo
sed 's|~/.observer/|./.demo/|g' spec.toml.example > .demo/spec.toml
cargo run --locked -- --config .demo/spec.toml --validate "The file is ready."
```

**Limits**

- Scores do not verify facts, completed work, or permission to act. Scoring does not block outbound actions.
- Daemon mode reads configured Claude and Codex transcripts on macOS or Linux. Use append-only transcripts.
- Quotations and task-specific language can trigger false matches. Review violations before changing rules.

See the source repository’s RELEASING.md for packaging.

### observer-protocol

You capture Markdown intake, corrections, and local draft status with observer-protocol. You inspect heuristic findings against the source records. Use a temporary record for the CLI example. Review loop configuration before starting the optional server, which starts configured active loops.

```sh
cd components/observer-protocol
npm ci
npm run build
demo_record=$(mktemp -d)
export VAULT_PATH="$demo_record"
node dist/cli.js init
node dist/cli.js intake "Review the synthetic release notes."
node dist/cli.js status
node dist/cli.js reflect -d 7
```

**Limits**

- Draft approval changes local status. It does not publish or authorize external actions, and pending drafts do not stop active schedules.
- Loop paths, regexes, and the vault must be trusted. Identifier validation does not create a filesystem sandbox.
- Privacy filters match basic text patterns. They do not prove that output contains no private information.

### swarm-contract

You check packet ownership paths and file-bound review receipts with swarm-contract. You detect overlapping paths and reject receipts after listed file content changes. The checker requires passing test and lint statuses and a reviewer identity different from the worker. You must verify the supplied evidence yourself.

```sh
cd components/swarm-contract
python3 swarm_contract.py examples/packets.json
```

**Limits**

- The checker cannot authenticate reviewers or verify that tests ran. A trusted coordinator must verify review provenance and supply the complete changed-file manifest.
- Unlisted files and Git commit metadata are outside the digest.
- The checker does not create worktrees, dispatch agents, merge code, or enforce operating-system isolation.

### effect-gate-template

You bind structured authorization to an action, account, target, and payload with effect-gate-template. You record authorization before calling a local adapter and record completion or failure afterward. The offline fixture refuses missing authorization, then executes an in-memory stub with synthetic authorization.

```sh
cd components/effect-gate-template
python3 examples/demo.py
```

**Limits**

- The caller must supply trusted authorization. Do not accept model-authored approval fields; an `approved_by` string does not authenticate a human.
- Only adapters invoked through `execute` are gated. The template supplies no expiry, replay prevention, idempotency, or durable receipt storage.
- An effect may succeed before its completion receipt fails. Reconcile that outcome before retrying.

### safe-api

You wrap REST writes with configured dry-run, first-path-segment scope, duplicate-callback, and circuit-breaker controls using safe-api. You select the destination and log directory. The example records an intended POST without sending an HTTP request. Implement approval and destination verification in your integration.

```sh
cd components/safe-api
python3 - <<'PYTHON'
import tempfile
from safe_api import SafeAPIClient

with tempfile.TemporaryDirectory() as logs:
    client = SafeAPIClient(
        base_url="https://api.example.com/v1",
        allowed_endpoints=["/contacts"],
        log_dir=logs,
        execute=False,
    )
    print(client.post("/contacts", {"name": "Example"}, reason="synthetic demo"))
    print(client.log_tail())
PYTHON
```

**Limits**

- Callers must enforce authorization, idempotency, payload validation, and remote outcome verification. Execute mode can send live REST writes.
- Configure allowed first path segments explicitly. Reads and redirect destinations are not scope-gated.
- Logs can contain payloads and server errors. The wrapper has no log redaction or remote rollback.

### skills

You use eight Claude Code skills for session search, process reports, writing checks, context selection, logs, handoffs, and declared artifact verification. The completion helper checks existence, SHA-256, exact JSON, and an optional Git HEAD. Use the synthetic suite before installing skill folders.

```sh
cd components/skills
python3 -m unittest discover -s tests -v
```

**Limits**

- Skill text does not enforce permissions. Both check helpers retain `action_authorized: false`.
- Completion checks evaluate declared local artifacts. They do not certify deployment, external acceptance, or task completion.
- The installer targets Claude Code skill folders. It does not install a Codex CLI adapter.

## Limits of the agent-oversight repository

You receive configured checks and synthetic examples. You do not get evidence of measured team deployment or comparative model performance. A writing score, local draft approval, or execution flag does not authorize an external action.

## Model assistance in the agent-oversight repository

The root README discloses model assistance for its text. Component READMEs carry their own disclosures. Review the code and tests to assess each tool.

## Repositories related to the agent-oversight repository

- [owned-record](/code/owned-record)
- [b2bvic](/code/b2bvic)

[Discuss a scoped build](/work).
