> ## 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.

# critiqor monitor openclaw — Start Agent Observation

> critiqor monitor openclaw launches OpenClaw with runtime observation. Options: --agent-id, --runs-dir, --difficulty-tier, --timeout, --visibility.

`critiqor monitor openclaw` launches the OpenClaw TUI via `openclaw chat` and wraps it with Critiqor's runtime observer. While the session is active, Critiqor captures tool calls, state transitions, process events, and plugin evidence — everything needed to produce an accurate diagnosis when you later run `critiqor finalize`.

## Syntax

```bash theme={null}
critiqor monitor openclaw [OPTIONS] [-- AGENT_COMMAND...]
```

## Arguments

| Argument                     | Description                                                                                                                  |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `AGENT_COMMAND` *(optional)* | Legacy: pass `-- <command> [args...]` to run and observe a custom agent command instead of launching OpenClaw interactively. |

## Options

| Option                    | Default                     | Description                                                        |
| ------------------------- | --------------------------- | ------------------------------------------------------------------ |
| `--agent-id TEXT`         | `openclaw_agent`            | Agent identifier used in run metadata and dashboard                |
| `--tenant-id TEXT`        | `default`                   | Tenant identifier for multi-agent setups                           |
| `--visibility`            | `private`                   | Evidence visibility: `private`, `public`, `anonymous`, or `shared` |
| `--events TEXT`           | `.critiqor/events.jsonl`    | Legacy event log path for custom command runs                      |
| `--evaluation TEXT`       | `.critiqor/latest_run.json` | Output path for the latest run diagnosis JSON                      |
| `--benchmark-id TEXT`     | `openclaw_runtime_v1`       | Versioned benchmark spec ID                                        |
| `--difficulty-tier`       | `standard`                  | Benchmark difficulty tier: `easy`, `standard`, `hard`, or `stress` |
| `--runs-dir TEXT`         | `runs`                      | Directory where run artifacts are stored                           |
| `--openclaw-command TEXT` | `openclaw chat`             | Command used to launch OpenClaw                                    |
| `--cwd TEXT`              | *(current directory)*       | Working directory for the OpenClaw process                         |
| `--timeout FLOAT`         | *(none)*                    | Optional timeout in seconds — terminates OpenClaw if exceeded      |

## What happens when you run it

1. **Checks for an existing active session** — if `runs/active_session.json` already exists, the command exits with instructions to run `critiqor finalize` first.
2. **Verifies `openclaw` is on PATH** — resolves the executable from `--openclaw-command`. If not found, exits with an error and installation guidance.
3. **Creates a new session** in `runs/<run_id>/` with status `MONITORING` and writes `runs/active_session.json`.
4. **Sets environment variables** so the Critiqor plugin inside OpenClaw knows where to write evidence: `CRITIQOR_RUN_ID`, `CRITIQOR_RUNS_DIR`, `CRITIQOR_AGENT_ID`, `CRITIQOR_TENANT_ID`, `CRITIQOR_VISIBILITY`, and `CRITIQOR_EVENT_SOURCE`.
5. **Launches `openclaw chat`** as a child process with the plugin active, printing confirmation before handing control to the TUI:
   ```
   ✓ OpenClaw detected
   ✓ Runtime observer attached
   ✓ Event collection active

   Launching OpenClaw...
   ```
6. **Waits for the OpenClaw session to end**, forwarding the process exit code.

## After OpenClaw exits

When the OpenClaw process terminates (whether by user exit, error, or `--timeout`), Critiqor prints:

```
OpenClaw session ended.
Run `critiqor finalize` to stop monitoring and generate a diagnosis report.
```

The collected evidence remains in `runs/<run_id>/` until you finalize. Nothing is lost if you close your terminal — run `critiqor finalize` from the same working directory to complete the session.

## Troubleshooting

**"OpenClaw command not found"**
: OpenClaw is not installed or is not on your `PATH`. Install OpenClaw, or pass `--openclaw-command` with the full path to the executable, for example:

```bash theme={null}
critiqor monitor openclaw --openclaw-command /usr/local/bin/openclaw chat
```

**"Critiqor monitoring is already active for \<run\_id>"**
: A previous session was never finalized. Run `critiqor finalize` to close it before starting a new one.
