docs / how-it-works

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

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

CallWhenSendsTurn it off
Event uploadAfter hooks, when signed inMasked envelopesconfig set --local-only=true
Transcript syncAt the end of each turn when signed in, or promptconduit syncThe session's transcriptLocal-only mode
Usage pingOnce a day, from release buildsAn anonymous install ID, versions, OS, which assistants have hooks, signed in or notconfig set --disable-telemetry=true, DO_NOT_TRACK=1. Local-only mode doesn't stop it.
Update check and upgradeOnce a day, from most commandsNothing about you: it reads the latest release from GitHubconfig set --disable-auto-update=true
Rate cardOnce a day, with the update checkNothing: it downloads promptconduit.dev/model-rates.jsonSame as above
Sign-inlogin and initA device-code requestDon't sign in
Team, insights and skills commands, and their MCP toolsWhen you or your agent run themThe request, with your API keyDon't run them
ci audit and ci syncWhen you run themaudit reads Actions metadata from GitHub with your token. sync also uploads it to PromptConduitDon't run them
skills generate --localWhen you run itConversation summaries to your model provider, not to PromptConduitDon't run it
cost refresh-pricingOnly when you run itNothing: it downloads LiteLLM's public price listIt'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.
  • The remote MCP server: an agent you approve with OAuth reads your team's data. See AI agents (MCP).
  • 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.

Next steps