AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻译准备中
开源 CLI,跟踪 Claude Code、Cursor、Gemini CLI 和 Codex 的令牌使用和成本。本地优先:每个事件记录在文件中,您可以读取。
AI 翻译
Open-source CLI that tracks token usage and cost for Claude Code, Cursor, Gemini CLI, and Codex. Local first: every event lands in a file you can read.
开发工具Go · HTMLGitHub @promptconduit在线运营者未确认
试用过了吗? 点一下就好,无需登录。
开源 CLI,跟踪 Claude Code、Cursor、Gemini CLI、Codex、Copilot 和 Grok Build 的令牌使用、成本、提示和工具调用。本地优先:事件记录在 JSONL 文件中,您可以读取。
AI 翻译
Open-source CLI that tracks token usage, cost, prompts, and tool calls for Claude Code, Cursor, Gemini CLI, Codex, Copilot, and Grok Build. Local-first: events land in a JSONL file you can read.
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Every great workflow you build in Claude Code disappears when the session ends. PromptConduit captures your AI coding sessions and turns repeated patterns into reusable slash commands — automatically, and without a platform account.
Turn your existing AI coding transcripts into reusable Claude Code skills — no sign-up required.
Skills are written directly to ~/.claude/skills/ and show up in Claude Code's / autocomplete immediately. Reads from Claude Code, OpenAI Codex CLI, and GitHub Copilot CLI — whichever you have installed.
Jump to full local skills docs →查看完整 README ↗Every great workflow you build in Claude Code disappears when the session ends. PromptConduit captures your AI coding sessions and turns repeated patterns into reusable slash commands — automatically, and without a platform account.
Turn your existing AI coding transcripts into reusable Claude Code skills — no sign-up required.
# Install
curl -fsSL https://promptconduit.dev/install | bash
# Generate skills from your transcripts (uses your Claude Code subscription)
promptconduit skills generate --local
Skills are written directly to ~/.claude/skills/ and show up in Claude Code's / autocomplete immediately. Reads from Claude Code, OpenAI Codex CLI, and GitHub Copilot CLI — whichever you have installed.
Jump to full local skills docs →
PromptConduit CLI captures prompts, tool executions, and session events from AI coding assistants and forwards them to the PromptConduit platform for analysis and insights.
Real-time hooks (written to ~/.promptconduit/events.jsonl with no account; a platform account is only required to sync events to the cloud):
| Tool | Events Captured |
|---|---|
| Claude Code | Prompts, Tools, Sessions, Attachments |
| Cursor | Prompts, Shell, MCP, Files, Attachments |
| Gemini CLI | Prompts, Tools, Sessions |
| OpenAI Codex CLI | Prompts, Tools, Permissions, Sessions |
| GitHub Copilot CLI | Prompts, Tools, Subagents, Errors, Sessions |
| Grok Build | Prompts, Tools, Sessions, Subagents |
Local skill generation (no account required):
| Tool | Transcript Location |
|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl |
| OpenAI Codex CLI | ~/.codex/**/*.jsonl |
| GitHub Copilot CLI | ~/.copilot/session-state/**/*.jsonl |
The CLI automatically extracts and uploads attachments from prompts:
curl -fsSL https://promptconduit.dev/install | bash
Or with your API key pre-configured:
curl -fsSL https://promptconduit.dev/install | bash -s -- YOUR_API_KEY
git clone https://github.com/promptconduit/cli.git
cd cli
make build
make install
Download the latest release for your platform from the releases page.
Once installed, promptconduit checks GitHub releases at most once every 24 hours
in the background. When a newer version is published it prints a one-line notice
to stderr and applies the upgrade in the background (atomic self-replace; the
running process is unaffected). The next invocation runs the new version.
promptconduit upgrade # upgrade now (interactive)
promptconduit upgrade --check # only check; don't download
# Opt out of background upgrades:
promptconduit config set --disable-auto-update=true
# Or via environment:
PROMPTCONDUIT_AUTO_UPDATE=0 promptconduit ...
The check uses the unauthenticated GitHub API (60 requests/hour/IP) and is
cached at ~/.config/promptconduit/update.json.
No account? See No Account? Start Here above.
promptconduit init
The interactive wizard signs you in through your browser, detects your installed AI tools, and installs their hooks — the whole setup in one command. Sign up at promptconduit.dev first if you don't have an account.
promptconduit status
promptconduit login # browser sign-in; saves your key to config
promptconduit install claude-code # or: cursor | gemini-cli | codex | copilot | grok
promptconduit status
For CI or scripted setups, set the key directly instead of the browser flow:
promptconduit config set --api-key="your-api-key" # ~/.config/promptconduit/config.json
# Install hooks for a tool
promptconduit install <tool>
# Uninstall hooks from a tool
promptconduit uninstall <tool>
# Show installation status
promptconduit status
# Test API connectivity
promptconduit test
# Generate skills locally (no account needed)
promptconduit skills generate --local [flags]
# Generate skills via platform (requires account)
promptconduit skills generate [flags]
# Sync transcripts (manual)
promptconduit sync [tool] [flags]
# Show version
promptconduit version
# Upgrade to the latest release
promptconduit upgrade
# Tail outbound HTTP traffic in real time (great for debugging hooks)
promptconduit watch
promptconduit watch --verbose # also pretty-print request/response bodies
promptconduit watch --lines 20 # backfill the last 20 entries before going live
# Team AI spend, savings, budgets and client tags (add --json for agents)
promptconduit team [subcommand]
Everything on the web team page is also a command, so you can ask your
coding agent "what did we spend on AI this week, and are we over budget?"
and it can answer, and act, without anyone opening a dashboard. Every
subcommand takes --json.
promptconduit team # teams you belong to
promptconduit team create "Acme Eng" # start a team (free up to 3 people)
promptconduit team invite [email protected] # prints an invite link
promptconduit team join <invite-link> # accept an invite
promptconduit team spend --period 7d # totals + top members, repos, models
promptconduit team spend --by client --json # one breakdown: member|repo|client|model|branch|pr|day
promptconduit team savings # cache savings, model mix, runaway sessions
promptconduit team export --by member -o spend.csv # CSV: client|repo|member|pr|day
promptconduit team budgets # month-to-date and projected spend per budget
promptconduit team budgets set --org-wide --monthly 2000
promptconduit team budgets set --repo acme/api --monthly 500
promptconduit team budgets set --member [email protected] --monthly 150
promptconduit team budgets rm <budget-id>
promptconduit team tag acme/api "Acme Corp" # roll a repo's spend up to a client
promptconduit team tag acme/api --clear
If you belong to more than one team, pass --org <id|slug|name> or set
PROMPTCONDUIT_ORG. Budgets, tags and invites need an owner or admin.
The CLI includes a Model Context Protocol
server, so Claude Code, Cursor and Gemini CLI can answer cost questions
themselves: "what has this session cost?", "what did we spend on AI this
week?", "is any budget about to run over?". promptconduit install registers it
for those three tools automatically (skip with --no-mcp).
promptconduit mcp install # register with every tool that has hooks installed
promptconduit mcp install cursor # or name tools: claude-code, cursor, gemini-cli
promptconduit mcp uninstall # remove everywhere (and don't re-add after upgrades)
promptconduit mcp tools # list what agents see
promptconduit mcp status --json # where it is registered (machine-readable)
| Tool | Needs an account | What it does |
|---|---|---|
session_cost | no | Cost of the current session (tokens, per-model USD) |
cost_history | no | Daily cost on this machine |
recent_sessions | no | Recent sessions with their resume ids |
setup_status | no | What's installed, signed in, local or syncing |
team_spend, team_savings, team_budgets, team_export_csv, team_list | yes | Team spend by member, repo, client, model, PR and day, savings levers, budgets, CSV |
team_set_budget, team_remove_budget, team_tag_repo, team_invite, team_create, team_join | yes | Change team settings (marked as writes, so your agent asks first) |
The local tools read only files on your machine. The server also ships three
prompts that show up as slash commands in Claude Code: spend_review,
budget_check and session_cost.
To register it with another MCP client, point it at promptconduit mcp (stdio).
For Claude Code by hand: claude mcp add --scope user promptconduit -- "$(which promptconduit)" mcp.
promptconduit watch streams every HTTP request the CLI makes to the
platform — hook envelope sends, transcript syncs, insights queries,
skills traffic — to your terminal as it happens. Useful for answering
"is my hook actually sending anything when Claude Code fires?" without
spelunking the debug log.
Each request appears as a one-line summary by default:
15:30:42 POST /v1/events/raw 3.2KB → 200 (87ms)
Add --verbose to also see the pretty-printed JSON body underneath
each summary.
Implementation note: every request the CLI makes is mirrored to
~/.config/promptconduit/outbound.ndjson (mode 0600). Authorization,
Cookie, and similar credential headers are redacted before write;
bodies are capped at 64KB per row and the file rotates to
outbound.ndjson.1 when it crosses 50MB. Update-check traffic from
internal/updater uses a separate HTTP client and is not mirrored
— that traffic is predictable and noisy and isn't what watch is for.
The sync command uploads conversation transcripts to the platform. With an API key, SessionEnd and Stop hooks upload that session's transcript automatically. promptconduit sync with no flags is the backfill for history that was never uploaded — local-only mode, or sessions from before you signed in.
# Sync all supported tools
promptconduit sync
# Sync only Claude Code transcripts
promptconduit sync claude-code
# Sync only Cursor transcripts
promptconduit sync cursor
# Preview what would be synced (no uploads)
promptconduit sync --dry-run
# Force re-sync already synced files
promptconduit sync --force
# Only sync transcripts newer than a date
promptconduit sync --since 2025-01-01
# Limit to N most recent transcripts
promptconduit sync --limit 10
How it works:
~/.claude/projects/ and ~/.cursor/projects/*/agent-transcripts/ (parent sessions and subagents)tool: "claude-code" or tool: "cursor")~/.config/promptconduit/sync_state.json to avoid duplicates~/.claude/plans/ ride along with Claude Code sync only--dry-run first to preview, then run without flags to syncHooks vs Sync:
Extract reusable skills from your AI coding transcripts — no platform account required. Uses your existing Claude Code subscription (or an API key) to analyze patterns and write skill files directly to ~/.claude/skills/.
# Analyze all tools, write skills globally
promptconduit skills generate --local
# Analyze only Claude Code transcripts
promptconduit skills generate --local --tool claude-code
# Scope skills to current git repo
promptconduit skills generate --local --repo owner/repo
# Re-analyze previously seen transcripts
promptconduit skills generate --local --force
# Preview what would be generated
promptconduit skills generate --local --dry-run
AI provider auto-detection (in priority order):
claude CLI binary in PATH — uses your existing Claude Code / claude.ai Pro subscriptionANTHROPIC_API_KEY env var — direct Anthropic API accessOPENAI_API_KEY env var — OpenAI fallback (gpt-4o-mini)How it works:
--force to override)SKILL.md files with YAML frontmatter to ~/.claude/skills/<name>/~/.config/promptconduit/local_skills_state.json/ autocompleteOutput example:
Analyzing 47 local transcripts (global)...
Using Claude Code (claude CLI).
Detected 3 skills:
/ci-monitor (workflow, 90%)
CI Monitor
Check CI status and fix failures until green.
→ Written to: /Users/you/.claude/skills/ci-monitor/SKILL.md
3 skills written. Use them with /ci-monitor, etc.
PromptConduit has a Free tier that is 100% local: every event is captured to a file on your machine and none of your event data is ever sent to the cloud. You register for free, and your prompts, sessions, and costs never leave your computer. The only network calls are the update check, the public rate-card refresh, and an anonymous daily usage ping you can turn off (see Anonymous usage ping).
Local-only mode is the default whenever no API key is configured — installing hooks and capturing events works with no account at all. You can also opt in explicitly (useful if you have a key but want to stay local):
# Capture locally, never send — even if an API key is set
promptconduit config set --local-only=true
# Or enable it at install time
promptconduit install claude-code --local-only
# Or per-invocation via environment variable
PROMPTCONDUIT_LOCAL_ONLY=1 ...
promptconduit status shows whether you're in Free (local-only) or
Cloud sync mode. To enable cloud sync later, set an API key and turn
local-only off (promptconduit config set --local-only=false).
events.jsonl)Every captured event is written — before any network send — to:
~/.promptconduit/events.jsonl
This file is the durable, send-independent record of your events. It is written
in both Free and Cloud modes (in Cloud mode the same envelope is then also
sent to the platform). Each line is exactly one event envelope — the same JSON
the CLI would POST to /v1/events/raw:
{"envelope_version":"1.2","tool":"claude-code","hook_event":"UserPromptSubmit","captured_at":"2026-06-23T21:11:57Z","native_payload":{ ... },"enrichment":{ ... }}
This format is a stable contract for local tooling (e.g. an editor extension
that reads events.jsonl to show a live cost estimator). Secrets matching
well-known patterns (API keys, bearer tokens) are redacted before write; the
file rotates to events.jsonl.1 at 50MB. Disable all local logging — including
this file — with PROMPTCONDUIT_EVENT_LOG=0 or
promptconduit config set --disable-event-log=true.
Note:
events.jsonl(raw events, captured before send) is distinct fromevents.ndjson(the send-outcome diagnostics log, written only when an event is actually sent).
The CLI bundles the PromptConduit cost editor extension and sideloads it into Cursor automatically when you install hooks:
promptconduit install cursor # wires hooks AND installs the cost status-bar extension
The extension is embedded in the CLI binary (no marketplace, no separate
download) and installed via Cursor's cursor --install-extension CLI, so its
version is always locked to the CLI's cost-feed schema. It reads the same local
cost feed promptconduit cost produces and shows live request/session cost — and
the cost-reduction signals — right in the status bar.
promptconduit install cursor --no-extensionpromptconduit install cursor. The hooks are installed either way..vsix is refreshed with make refresh-extension.The CLI supports multiple configuration methods with the following priority:
~/.config/promptconduit/config.json)The config file supports multiple environments, making it easy to switch between local development, staging, and production:
# Show current configuration
promptconduit config show
# Set API key for current environment
promptconduit config set --api-key=sk_your_key_here
# Set API URL (for local development)
promptconduit config set --api-url=http://localhost:8787
# Enable debug mode
promptconduit config set --debug=true
# Show config file path
promptconduit config path
Create environments for local, dev, and prod:
# Create local environment
promptconduit config env add local \
--api-key=sk_local_key \
--api-url=http://localhost:8787 \
--debug
# Create dev environment
promptconduit config env add dev \
--api-key=sk_dev_key \
--api-url=https://dev-api.promptconduit.dev
# Create prod environment
promptconduit config env add prod \
--api-key=sk_prod_key \
--api-url=https://api.promptconduit.dev
# Switch environments
promptconduit config env use local
promptconduit config env use prod
# Shorthand alias
promptconduit config set-env local
# List all environments
promptconduit config env list
# Show current environment
promptconduit config show
Important: After switching environments, start a new Claude Code session for the hooks to pick up the new configuration. The --continue flag preserves the old environment.
Environment variables override config file settings:
| Variable | Required | Default | Description |
|---|---|---|---|
PROMPTCONDUIT_API_KEY | Yes | - | Your API key |
PROMPTCONDUIT_API_URL | No | https://api.promptconduit.dev | API endpoint |
PROMPTCONDUIT_DEBUG | No | false | Enable debug logging |
PROMPTCONDUIT_TIMEOUT | No | 30 | HTTP timeout in seconds |
PROMPTCONDUIT_TOOL | No | Auto-detect | Force specific adapter |
PROMPTCONDUIT_TELEMETRY | No | on | 0/false/off disables the anonymous usage ping |
DO_NOT_TRACK | No | unset | 1 disables the anonymous usage ping |
Warning: If using multi-environment config, avoid setting
PROMPTCONDUIT_API_KEYin your shell profile. The env var will override the config file's environment-specific key, which can cause mismatches (e.g., prod API key with local URL). Use the config file exclusively or env vars exclusively, but not both.
Enable debug mode to log hook activity:
# Via config
promptconduit config set --debug=true
# Via environment variable
export PROMPTCONDUIT_DEBUG=1
Debug logs are written to $TMPDIR/promptconduit-hook.log (on macOS this is typically /var/folders/.../promptconduit-hook.log).
┌─────────────────────────────────────────────────────────────┐
│ AI Coding Tools │
├─────────────┬─────────────────────┬─────────────────────────┤
│ Claude Code │ Cursor │ Gemini CLI │
└──────┬──────┴──────────┬──────────┴───────────┬─────────────┘
│ │ │
└─────────────────┼──────────────────────┘
▼
┌─────────────────────┐
│ promptconduit │ ← Hook receives raw JSON
│ hook │ from stdin
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ Raw Envelope │ ← Wraps event with
│ + Git Context │ metadata & repo state
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ Async Send │ ← Non-blocking POST to
│ (subprocess) │ /v1/events/raw
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ PromptConduit API │ ← Server-side adapters
│ (normalization) │ transform to canonical
└─────────────────────┘
The CLI is intentionally thin: it forwards each AI tool's raw hook event
untouched in native_payload, plus an enrichment block of locally
computed context (git, host, correlation IDs). The platform's server-side
adapters do the categorization and normalization. That keeps the CLI
small and lets the platform evolve event taxonomy without forcing CLI
upgrades.
The envelope is currently at version 1.2:
{
"envelope_version": "1.2",
"cli_version": "v0.5.0",
"tool": "claude-code",
"hook_event": "UserPromptSubmit",
"captured_at": "2026-05-16T13:04:11Z",
"native_payload": {
"session_id": "abc123",
"hook_event_name": "UserPromptSubmit",
"prompt": "Refactor the auth module",
"cwd": "/Users/me/my-project"
},
"enrichment": {
"git": {
"repo_name": "my-project",
"branch": "main",
"commit_hash": "abc123",
"is_dirty": true,
"remote_url": "[email protected]:me/my-project.git"
},
"source": "github",
"correlation": {
"trace_id": "151a9441671718243f44d5b0fa183894",
"span_id": "143855046e61e7f8"
},
"host": "my-laptop",
"os": "darwin",
"arch": "arm64"
}
}
Field reference:
| Field | Description |
|---|---|
envelope_version | Schema version. Currently 1.2. |
cli_version | Version of promptconduit that produced the event. |
tool | claude-code, cursor, gemini-cli, codex, copilot, grok, or unknown. |
hook_event | The tool's native hook event name (e.g. UserPromptSubmit, preToolUse). Not canonicalized — that happens server-side. |
captured_at | ISO 8601 timestamp at the moment the hook fired. |
native_payload | Raw JSON the tool wrote to the hook's stdin. Pass-through. |
enrichment.git | Repo metadata derived from cwd (branch, dirty state, commit hash, remote). Omitted when not in a git repo. |
enrichment.source | Git provider derived from the remote URL (github, gitlab, bitbucket, azure). |
enrichment.correlation | W3C Trace Context-compatible IDs so events stitch into a single trace. trace_id is stable per session; span_id is unique per event. |
enrichment.host, os, arch | Machine identity, runtime GOOS, runtime GOARCH. |
attachments | When present: array of {attachment_id, filename, content_type, size_bytes, type}. Binary data is sent as a separate multipart field. |
Image and document bytes ride alongside the envelope as multipart parts
on the same /v1/events/raw request — never embedded as base64 in the
JSON.
PromptConduit hooks work in Claude Code's headless/print mode (claude -p "...") without any changes. Hooks fire and capture events identically in both interactive and non-interactive sessions.
--bare mode limitation: When running claude --bare -p "...", Claude Code skips auto-discovery of hooks and settings, so PromptConduit hooks will not fire. To capture events in bare mode, explicitly pass your settings file:
claude --bare -p "your prompt" --settings ~/.claude/settings.json
Note: --bare is expected to become the default for -p in a future Claude Code release. The --settings workaround ensures capture until that changes.
# Build binary
make build
# Run tests
make test
# Build for all platforms
make build-all
# Create snapshot release
make snapshot
.
├── cmd/ # CLI commands
│ ├── root.go # Root command + background update-check wiring
│ ├── install.go # Install hooks for AI tools (5 tools)
│ ├── uninstall.go # Remove hooks
│ ├── status.go # Show installation status
│ ├── test.go # Test API connectivity
│ ├── hook.go # Hook entry point (receives raw events)
│ ├── config.go # Config management
│ ├── sync.go # Manual transcript sync
│ ├── upgrade.go # `promptconduit upgrade` (self-replace)
│ ├── watch.go # `promptconduit watch` (tail outbound traffic)
│ ├── insights.go # Personal usage insights
│ ├── team.go # Team spend, savings, budgets, client tags, invites
│ ├── mcp*.go # MCP server command, tools/prompts, agent registration
│ ├── skills.go # Skill detection (platform)
│ ├── skills_local.go # Skill detection (local, no account)
│ ├── correlation.go # W3C trace_id/span_id helpers
│ └── debug.go # Internal debugging commands
├── internal/
│ ├── envelope/ # Raw event envelope types (v1.2)
│ ├── client/ # HTTP client with multipart upload
│ ├── correlation/ # W3C trace_id/span_id generation + persistence
│ ├── git/ # Git context extraction
│ ├── outbound/ # http.RoundTripper that mirrors outbound traffic
│ │ # to outbound.ndjson (drives `watch`)
│ ├── sync/ # Transcript sync and parsing
│ │ ├── claudecode.go # Claude Code transcript parser
│ │ ├── state.go # Sync state management
│ │ └── types.go # Parser interface and types
│ ├── transcript/ # Transcript parsing & attachment extraction
│ └── updater/ # GitHub-release version check + atomic self-replace
├── scripts/
│ └── install.sh # Curl installer
├── .goreleaser.yaml # Release configuration
├── Makefile # Build commands
└── go.mod # Go module
--local-only), events are
captured to ~/.promptconduit/events.jsonl and nothing is sent to the
cloud. See Free Tier — Local-Only Mode.~/.promptconduit/events.jsonl (mode 0644) before any send, with secrets
redacted; rotates at 50MB. Disable with PROMPTCONDUIT_EVENT_LOG=0.~/.config/promptconduit/outbound.ndjson (mode 0600,
owner-only) so you can tail it with promptconduit watch.
Authorization, Cookie, and any header matching token / secret /
key is redacted to *** before write. Bodies are capped at 64KB
per row; the file rotates to outbound.ndjson.1 at 50MB./repos/promptconduit/cli/releases/latest (no auth, no
payload uploaded). Disable with
promptconduit config set --disable-auto-update=true or
PROMPTCONDUIT_AUTO_UPDATE=0.To count active installs, the CLI sends one anonymous ping per day to
POST /v1/ping on the configured API URL (https://api.promptconduit.dev by
default). This is the complete payload:
| Field | Example | What it is |
|---|---|---|
install_id | 3f2b8c1e-… | Random UUID generated on your machine (stored in ~/.config/promptconduit/telemetry.json) |
cli_version | 0.28.0 | CLI version |
os, arch | darwin, arm64 | Operating system and CPU architecture |
tools | ["claude-code","cursor"] | Which AI tools have PromptConduit hooks installed |
extension_version | 0.23.0 | Installed cost extension version, if any |
logged_in | false | Whether an API key is configured |
It never includes your name, email, file paths, repository or branch names,
prompts, or costs, and the server does not store your IP address with it. The
request is mirrored to outbound.ndjson like every other request, so
promptconduit watch shows it.
promptconduit config set --disable-telemetry=true, DO_NOT_TRACK=1, or
PROMPTCONDUIT_TELEMETRY=0. It is also off when CI is set, and only
tagged release builds send it (local make and snapshot builds never do).
If config.json can't be parsed, the ping stays off rather than guessing.
promptconduit config show reports the current state.MIT - Copyright (c) 2026 PromptConduit