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

# How it works

> The tagged, idempotent config edit @carbon-js/connect makes to each coding app, and how disconnect reverts it.

`@carbon-js/connect` doesn't run a daemon, proxy your traffic, or parse transcripts. It makes one **tagged, idempotent edit** to the app's own config that turns on the app's built-in OpenTelemetry **logs** exporter and points it at Carbon's OTLP endpoint. The app does the exporting itself.

## The edit, per app

<Tabs>
  <Tab title="Claude Code">
    Edits `~/.claude/settings.json` — adds an `env` block that enables telemetry, selects the OTLP/HTTP **logs**
    exporter, and sets the Carbon endpoint and your API key as the bearer token. Unrelated settings are left untouched.
  </Tab>

  <Tab title="Codex">
    Edits `~/.codex/config.toml` — adds an `[otel]` table that enables the OTLP/HTTP **logs** exporter and sets the
    Carbon endpoint and your API key as the bearer token. Unrelated settings are left untouched.
  </Tab>
</Tabs>

Only the **logs** signal is enabled — Carbon ingests the apps' structured usage logs, not traces. Restart the app after connecting so it reloads the config and begins exporting.

## Safe and reversible

* **Idempotent.** The edit is tagged, so re-running `connect` updates in place rather than duplicating anything.
* **Scoped.** Only the telemetry keys are added; the rest of your config is preserved exactly.
* **Cleanly reverted.** `@carbon-js/connect disconnect <app>` removes exactly the keys it added, leaving the rest of your config untouched.

```bash theme={null}
@carbon-js/connect disconnect codex
```

## What leaves your machine

Once connected, the app exports its telemetry directly to Carbon over OTLP — authenticated with your API key. That payload is **dimensions only**: model, token usage, cost, timing, status, and the session/turn correlation keys. Prompts, responses, and tool input/output text are not included. See [Privacy](/documentation/connect/privacy).
