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

# Agent supervision

> Run AI coding tools through Rye with PTY wrapping, file telemetry, approval capture, and proxy injection.

Use `rye wrap` when you want to supervise one command invocation.

```bash theme={null}
rye wrap claude
rye wrap codex
rye wrap -- bash -c "claude"
```

The default mode starts the child process inside a pseudo-terminal. Interactive terminal apps continue to work normally.

## What supervised wrapping does

During a wrapped session, Rye:

* Injects `HTTP_PROXY` and `HTTPS_PROXY` for the child process.
* Injects `NODE_EXTRA_CA_CERTS` when the Rye CA exists.
* Relays keystrokes and terminal output between you and the child process.
* Watches the working directory recursively for file creates, edits, deletes, and renames.
* Batches file-change telemetry and sends it to the daemon.
* Emits session start and session end events with command, PID, CWD, exit code, and duration.
* Forwards terminal resize and interrupt signals to the child.
* Scans terminal output for approval events when possible.

<Note>
  Some tools use product-specific CA variables. For Codex CLI, you may also need to set `CODEX_CA_CERTIFICATE` or `SSL_CERT_FILE` to `$(rye ca path)`, depending on the Codex version and HTTP stack.
</Note>

## Use Rye commands inside a session

In a supervised session, type `/rye` at the start of an input line to run Rye from the parent wrapper process.

Examples:

```txt theme={null}
/rye
/rye status
/rye doctor
/rye history --last 10m
```

This is useful when the assistant terminal is full screen and you do not want to open another terminal.

## Approval events

Rye scans terminal output for approval messages from supported agents. It records:

* The agent name.
* The approved command or action.
* Whether the approval was one-time or persistent.
* The persistent rule pattern when available.
* A generated approval ID that can link future uses of the same persistent rule.

Inspect approvals:

```bash theme={null}
rye approvals --last 1h
```

## Legacy wrap modes

Use these only when you need a simpler process model:

```bash theme={null}
rye wrap --exec claude
rye wrap --tee claude
```

| Mode     | Behavior                                                                            |
| -------- | ----------------------------------------------------------------------------------- |
| Default  | PTY supervision, file watching, telemetry, and proxy injection.                     |
| `--exec` | Replaces the current process with the child and only injects environment variables. |
| `--tee`  | Pipes stdout and stderr for byte counting without a PTY.                            |

## When to use app shims

Use `rye wrap` for explicit one-off sessions. Use [app shims](/app-shims) when you want every `claude` or `codex` command to run through Rye automatically.
