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,toolsand 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.
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:
- The hook adds the envelope to a local spool,
~/.promptconduit/spool-<hash>.jsonl, and returns. -
A background process uploads the spool in batches over HTTPS to
api.promptconduit.dev, with the same masking applied again on the way out. -
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 statusshows what's waiting. - 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.
- 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.