# Claude Office Agents

> Send Claude Office Agents session telemetry — prompts, tool calls, API costs, and errors — to Last9 via OpenTelemetry.

Source: https://last9.io/docs/integrations/claude-office-agents/

Claude Office Agents let Claude work across desktop apps like Excel and PowerPoint, sharing context between them as it completes multi-step tasks. Office Agents emit OpenTelemetry events using the same schema as [Claude Code](/docs/integrations/claude-code/) and [Claude Cowork](/docs/integrations/claude-cowork/), so the same Last9 setup gives you visibility into every Office Agents session: prompts submitted, tools invoked, API costs, and errors.

:::note
Office Agents monitoring is configured by an administrator through the Claude admin console — no environment variables required. Cross-app context (Excel ↔ PowerPoint) is governed by the **Let Claude work across apps** toggle on the same settings page.
:::

## What gets exported

Office Agents export five event types as OpenTelemetry log records, identical in structure to Claude Code and Cowork events:

| Event                       | Emitted when               | Key attributes                                                      |
| --------------------------- | -------------------------- | ------------------------------------------------------------------- |
| `claude_code.user_prompt`   | User submits a prompt      | `prompt.length`, `session.id`, `user.email`                         |
| `claude_code.api_request`   | Claude API responds        | `llm.usage.total_tokens`, `cost_usd`, `model`, `duration_ms`        |
| `claude_code.api_error`     | API call fails             | `error.message`, `http.status_code`, `retry_attempt`                |
| `claude_code.tool_result`   | Tool execution completes   | `tool.name`, `tool.success`, `duration_ms`                          |
| `claude_code.tool_decision` | Permission prompt resolved | `tool.name`, `tool.decision` (`accept`/`reject`), `decision.source` |

All events include a `prompt.id` UUID linking every event produced while processing a single user prompt.

:::note
Office Agents export logs/events only. Metrics and traces are not currently supported.
:::

## Prerequisites

1. **Last9 account** — Sign up at [app.last9.io](https://app.last9.io)
2. **Claude desktop app** with Office Agents enabled
3. **Admin access** to the Claude organization
4. **OTLP credentials** — Get your endpoint and auth header from [**Integrations → OpenTelemetry**](https://app.last9.io/integrations?integration=OpenTelemetry)

## Setup

1. **Get your Last9 OTLP credentials**

   Navigate to [**Integrations → OpenTelemetry**](https://app.last9.io/integrations?integration=OpenTelemetry) in your Last9 dashboard. Copy:

   - **OTLP Endpoint** (e.g., `https://otlp-aps1.last9.io:443`)
   - **Authorization header** (e.g., `Basic <base64-token>`)

2. **Open Office Agents settings**

   In the Claude admin console, go to **Organization settings → Office agents** ([claude.ai/admin-settings/office-agents](https://claude.ai/admin-settings/office-agents)). Scroll to the **Monitoring** section.

3. **Configure the OTLP connection**

   Fill in the three fields under **Monitoring**:

   | Field         | Value                                         |
   | ------------- | --------------------------------------------- |
   | OTLP endpoint | `https://<your-last9-otlp-endpoint>/v1/logs`  |
   | OTLP protocol | `http/json`                                   |
   | OTLP headers  | `Authorization=Basic <your-last9-auth-token>` |

   :::tip
   If you have already configured monitoring for [Claude Cowork](/docs/integrations/claude-cowork/), click **Copy settings from Cowork** to reuse the same endpoint, protocol, and headers.
   :::

   :::caution
   The placeholder in the UI shows `Authorization=Bearer your-token`. For Last9, use `Basic`, not `Bearer`.
   :::

4. **Save and restart the Claude desktop app**

   Click **Save**. Configuration is loaded at session start — **you must restart the desktop app** for the settings to take effect.

5. **Run an Office Agents task and verify**

   Trigger any Office Agents task across Excel or PowerPoint. Navigate to **Logs** in Last9 and search for `claude_code.api_request` to confirm events are flowing.

## What you can do in Last9

### Cost tracking per user

Every `claude_code.api_request` event carries `cost_usd`, `input_tokens`, and `output_tokens` tagged with `user.email`. Filter Last9 Logs by user to see per-person Office Agents spend across your organization.

### Session replay via `prompt.id`

All events from a single user interaction share a `prompt.id` UUID. Filter Last9 Logs by a specific `prompt.id` to reconstruct the full sequence:

```
user_prompt → api_request → tool_decision → tool_result → api_request
```

### Tool usage audit

`claude_code.tool_decision` events record every permission prompt with `tool.decision = accept | reject`. Use this to audit which Office app actions (Excel cell writes, PowerPoint slide edits, cross-app context shares) users are approving or blocking.

### Cross-app context visibility

When **Let Claude work across apps** is enabled, Office Agents share context between apps (e.g., Excel data referenced from a PowerPoint task). Tool decision and result events capture each cross-app interaction so you can audit which data flows are actually used.

## Shared schema with Claude Code and Cowork

Office Agents reuse the Claude Code OTel event schema via the Claude Agent SDK. If you are already sending [Claude Code](/docs/integrations/claude-code/) or [Claude Cowork](/docs/integrations/claude-cowork/) telemetry to Last9, Office Agents events land in the same log stream and can be distinguished by:

- **`service.name`** — `claude-code` vs `cowork` vs `office-agents`
- **`terminal.type`** — `cli` for Claude Code, `cowork` for Cowork sessions
- **`workspace.host_paths`** — only present in Cowork events

You can build a single Last9 dashboard covering all three products by grouping on `service.name`.

---

## Troubleshooting

- **No events in Last9 after running an Office Agents task**

  - Confirm you restarted the Claude desktop app after saving the settings — configuration loads at session start only
  - Verify the OTLP protocol is set to `http/json` — Last9 requires HTTP, not gRPC
  - Confirm the endpoint includes the `/v1/logs` suffix — required when using `http/json` or `http/protobuf`
  - Check the header format: `Authorization=Basic <token>` with no extra quotes

- **401 / authentication errors**

  - Confirm you are using `Basic`, not `Bearer`, in the Authorization header
  - Regenerate the token from [**Integrations → OpenTelemetry**](https://app.last9.io/integrations?integration=OpenTelemetry) if it has expired

- **Settings panel not visible**

  - Office Agents monitoring configuration requires admin access — confirm your role in the Claude admin console

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
