---
title: "How PromptConduit works — PromptConduit docs"
description: "One event from hook to dashboard: the envelope, the local event log and masking, batched upload, what the platform keeps, and every network call the CLI makes."
image: "https://promptconduit.dev/og-image.png"
---

<!-- Markdown copy of https://promptconduit.dev/docs/how-it-works. Index of every page: https://promptconduit.dev/llms.txt -->

# How PromptConduit works

What happens between your assistant's hook and a number on a dashboard, and every network call the CLI makes.

PromptConduit is built so you can check it. The CLI is [open source](https://github.com/promptconduit/cli), everything it captures is written to one file you can read, and it uploads only when you sign in. This page follows one event from start to finish.

## 1\. A hook fires

`promptconduit install` adds hook entries to your assistant's own config file, such as `~/.claude/settings.json`. Each time the assistant fires a hook (a prompt, a tool call, the end of a turn), it starts `promptconduit hook` and passes the event's JSON on stdin. The hook always tells the assistant to continue, even if something fails, so PromptConduit never blocks your work.

## 2\. The event becomes an envelope

The CLI wraps the assistant's JSON, unchanged, in an envelope: an id, the time, the assistant, the hook name and the session. Then it adds **enrichments**, computed on your machine:

-   `env`: host, OS and working directory.
-   `vcs`: repository, branch, commit, and the pull request when known.
-   `cost`: tokens and USD for the request, priced against the local rate card.
-   `trace`, `prompt`, `tools` and others: timing, prompt length, tool outcomes.

Enrichments are names and numbers. The assistant's own JSON is kept as it came, and depending on the hook it can hold your prompt text and tool inputs. The [API reference](https://promptconduit.dev/docs/api-reference) has the full envelope.

## 3\. It's written to your disk first

Before any network call, the envelope is masked and appended to `~/.promptconduit/events.jsonl`, one JSON line per event. Masking replaces values that look like secrets with `***REDACTED***`: `Bearer` tokens, `sk-` and `sk_` keys (Anthropic, OpenAI and PromptConduit), AWS access key IDs, GitHub tokens, and JSON fields named like `api_key`, `token`, `secret` or `password`.

```bash
promptconduit events -n 5
```

That file is what `cost`, `graph`, `sessions` and the editor extension read. It keeps 30 days by default; see [Retention](https://promptconduit.dev/docs/configuration#retention).

## 4\. It's uploaded, if you signed in

With no API key, or in local-only mode, the event stops here. Otherwise:

1.  The hook adds the envelope to a local spool, `~/.promptconduit/spool-<hash>.jsonl`, and returns.
2.  A background process uploads the spool in batches over HTTPS to `api.promptconduit.dev`, with the same masking applied again on the way out.
3.  If a send fails for a reason that may clear, such as no connection or a server error, the events are kept and retried. Events still unsent after 30 days are dropped. `promptconduit status` shows what's waiting.
4.  At the end of each turn, the hook also uploads that session's transcript, which is how session detail and skills work. Transcripts are sent as your assistant saved them.

> [!WARNING]
> Uploads are masked from CLI v0.43.5 on. Earlier versions masked only the local file and uploaded envelopes as captured. Synced transcripts aren't masked yet. Run `promptconduit upgrade`, and don't paste secrets into prompts.

## 5\. The platform prices and groups it

The API stores each envelope, then a per-assistant adapter reads it. The cost the CLI computed is rolled up by member, repo, client, model, branch, pull request and day, for you and your team. Raw events are kept for 90 days; the daily cost totals stay after that.

## Every network call the CLI makes

| Call | When | Sends | Turn it off |
| --- | --- | --- | --- |
| Event upload | After hooks, when signed in | Masked envelopes | `config set --local-only=true` |
| Transcript sync | At the end of each turn when signed in, or `promptconduit sync` | The session's transcript | Local-only mode |
| Usage ping | Once a day, from release builds | An anonymous install ID, versions, OS, which assistants have hooks, signed in or not | `config set --disable-telemetry=true`, `DO_NOT_TRACK=1`. Local-only mode doesn't stop it. |
| Update check and upgrade | Once a day, from most commands | Nothing about you: it reads the latest release from GitHub | `config set --disable-auto-update=true` |
| Rate card | Once a day, with the update check | Nothing: it downloads promptconduit.dev/model-rates.json | Same as above |
| Sign-in | `login` and `init` | A device-code request | Don't sign in |
| Team, insights and skills commands, and their MCP tools | When you or your agent run them | The request, with your API key | Don't run them |
| `ci audit` and `ci sync` | When you run them | `audit` reads Actions metadata from GitHub with your token. `sync` also uploads it to PromptConduit | Don't run them |
| `skills generate --local` | When you run it | Conversation summaries to your model provider, not to PromptConduit | Don't run it |
| `cost refresh-pricing` | Only when you run it | Nothing: it downloads LiteLLM's public price list | It's opt-in |

## Other ways data reaches PromptConduit

-   **Claude Code telemetry:** Claude Code can send its own OpenTelemetry straight to the API, with no CLI. See [Claude Code telemetry](https://promptconduit.dev/docs/claude-code-telemetry).
-   **The remote MCP server:** an agent you approve with OAuth reads your team's data. See [AI agents (MCP)](https://promptconduit.dev/docs/agents#remote).
-   **Team settings:** a Slack webhook for budget alerts, client tags, and history you choose to share when you join a team. See [Set up a team](https://promptconduit.dev/docs/teams).

## Next steps

-   [Security and privacy](https://promptconduit.dev/security): what’s masked, what’s stored, and how to report a problem.
-   [Configuration](https://promptconduit.dev/docs/configuration): local-only mode, retention, batching and the usage ping.
-   [API reference](https://promptconduit.dev/docs/api-reference): the envelope and every ingest endpoint.

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "@id": "https://promptconduit.dev/#software",
  "name": "PromptConduit",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "macOS, Linux, Windows",
  "description": "PromptConduit shows what AI coding costs per developer, repo, and pull request across Claude Code and Cursor. An open-source CLI records every session to a local JSONL file first, with git context and exact cost computed on your machine. Teams sync to see spend across members, models, repos, and clients, with budgets and alerts.",
  "url": "https://promptconduit.dev",
  "installUrl": "https://promptconduit.dev/docs/installation",
  "softwareHelp": {
    "@type": "CreativeWork",
    "url": "https://promptconduit.dev/docs"
  },
  "releaseNotes": "https://promptconduit.dev/changelog",
  "license": "https://opensource.org/licenses/MIT",
  "isAccessibleForFree": true,
  "publisher": {
    "@id": "https://promptconduit.dev/#organization"
  },
  "offers": [
    {
      "@type": "Offer",
      "name": "Free",
      "description": "The full CLI on your machine, and a team of up to 3.",
      "price": "0",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 3,
        "unitText": "members"
      }
    },
    {
      "@type": "Offer",
      "name": "Team",
      "description": "Up to 15 members. One flat price, no seat math.",
      "price": "99",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "priceSpecification": {
        "@type": "UnitPriceSpecification",
        "price": "99",
        "priceCurrency": "USD",
        "unitCode": "MON",
        "referenceQuantity": {
          "@type": "QuantitativeValue",
          "value": 1,
          "unitCode": "MON"
        }
      },
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 15,
        "unitText": "members"
      }
    },
    {
      "@type": "Offer",
      "name": "Growth",
      "description": "Up to 50 members, for teams and agencies running AI across many repos.",
      "price": "249",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "priceSpecification": {
        "@type": "UnitPriceSpecification",
        "price": "249",
        "priceCurrency": "USD",
        "unitCode": "MON",
        "referenceQuantity": {
          "@type": "QuantitativeValue",
          "value": 1,
          "unitCode": "MON"
        }
      },
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 50,
        "unitText": "members"
      }
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://promptconduit.dev/#organization",
  "name": "PromptConduit",
  "url": "https://promptconduit.dev",
  "logo": "https://promptconduit.dev/favicon.svg",
  "email": "hello@promptconduit.dev",
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "hello@promptconduit.dev",
    "url": "https://promptconduit.dev/about"
  },
  "sameAs": [
    "https://github.com/promptconduit/cli",
    "https://github.com/promptconduit/editor-extension",
    "https://twitter.com/promptconduit"
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://promptconduit.dev/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Docs",
      "item": "https://promptconduit.dev/docs"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "How PromptConduit works",
      "item": "https://promptconduit.dev/docs/how-it-works"
    }
  ]
}
```
