> ## Documentation Index
> Fetch the complete documentation index at: https://critiqor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Integration: Full Agent Monitoring Setup and Usage

> Critiqor integrates with OpenClaw via a bundled plugin that captures runtime events automatically. No code changes to your agent are required.

OpenClaw is the only currently supported agent framework. Integration is zero-config: Critiqor ships a bundled plugin that auto-loads into OpenClaw, captures runtime events from startup to teardown, and writes structured evidence locally — all without any changes to your agent code.

## How It Works

Critiqor ships a bundled OpenClaw plugin at `critiqor/clawhub/critiqor-openclaw/`. When you run `critiqor monitor openclaw`, Critiqor sets the `OPENCLAW_BUNDLED_PLUGINS_DIR` environment variable, which tells OpenClaw to automatically discover and load the plugin before launching.

The plugin:

* Registers itself as `"critiqor"` (id: `critiqor`, name: `Critiqor Evidence Collector`)
* Activates immediately when OpenClaw loads it — no manual activation required
* Observes all runtime events passively; it does not score runs, generate diagnoses, or alter agent behaviour
* Writes a structured `session.json` evidence file to your local `runs/` directory

You do not need to change your agent code, configure environment variables, or install anything beyond Critiqor itself.

## Prerequisites

* **Critiqor**: `pip install critiqor`
* **OpenClaw**: installed and available on your `PATH`, compatible with plugin API `>=2026.6.1`
* **Python**: 3.10 or newer

## Setup

The complete workflow from install to results:

```bash theme={null}
# 1. Install Critiqor
pip install critiqor

# 2. Verify OpenClaw is available
openclaw --version

# 3. Start a monitored session
#    Critiqor initialises the session, enables the plugin, and launches OpenClaw
critiqor monitor openclaw

# 4. Use OpenClaw as normal — Critiqor observes silently
#    (interact with the OpenClaw TUI as you normally would)

# 5. Exit the OpenClaw TUI, then finalize the session
critiqor finalize
```

`critiqor monitor openclaw` creates the run session and launches the OpenClaw TUI in the same terminal. `critiqor finalize` stops the observer, generates `diagnosis.json`, and opens the local dashboard automatically.

## What the Plugin Collects

The plugin collects runtime evidence across two layers:

| Layer                         | Events                                                                                                                                                                                                                                                 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Extension API (`api.on(...)`) | `agent_start`, `agent_end`, `turn_start`, `turn_end`, `session_start`, `session_end`, `before_provider_request`, `after_provider_response`, `message_received`, `message_sent`, `message_start`, `message_update`, `message_end`, `input`, `user_bash` |
| Tool Hooks                    | `tool_call`, `tool_result`, `tool_execution_start`, `tool_execution_update`, `tool_execution_end`                                                                                                                                                      |

Memory tool calls (`memory_search`, `memory_get`) are additionally re-emitted as a `memory_event` type entry so that memory integrity analysis can run as a dedicated diagnostic pass.

Each collected event is normalised and appended to `runs/<run_id>/session.json`. For tool hook events, the plugin records `tool_name`, `tool_call_id`, error status, and wall-clock `duration_ms`. Older OpenClaw builds that do not expose a specific event type will gracefully skip that subscription — the collector is forward- and backward-compatible.

## Plugin Configuration

The plugin has no user-configurable settings. All runtime configuration is supplied via environment variables set automatically by `critiqor monitor openclaw`:

| Variable            | Purpose                                             |
| ------------------- | --------------------------------------------------- |
| `CRITIQOR_RUN_ID`   | The identifier for the current run (e.g. `run_001`) |
| `CRITIQOR_RUNS_DIR` | The directory where `session.json` is written       |

You should not need to set these manually.

## Advanced: Custom OpenClaw Command

If your OpenClaw binary is not named `openclaw`, or you need to pass additional arguments when launching, use the `--openclaw-command` flag:

```bash theme={null}
critiqor monitor openclaw --openclaw-command "openclaw chat --model gpt-4"
```

The `CRITIQOR_RUN_ID` environment variable is injected into the child process environment regardless of the command used, so the plugin will always write to the correct session.

## Compatibility

* **Plugin API**: `>=2026.6.1` (as specified in the plugin's `package.json` `compat` field)
* **Build target**: OpenClaw `2026.6.1`
* Older OpenClaw builds that do not expose specific event types will skip those subscriptions silently — no errors, no data loss for supported events
