Set up traceroot tracing in this repo with the traceroot setup wizard.
1. From the repo root, run: npx -y traceroot-cli@latest setup --no-input
- If it says no credential is configured, run npx -y traceroot-cli@latest login
(allow up to 10 minutes), show me the URL and code it prints, and wait while
I sign in. Then run setup again.
- If it stops for any other reason, follow the remedy it prints. Ask me before
choosing a project.
2. Setup writes a project API key to .env.local or .env and an instrumentation task to
.traceroot/prompts/setup-instrument.md. Carry out that task yourself, in this session.
3. When the task is done, don't stop. Rerun the same setup command, keeping all flags,
and add --resume. You're done when it prints a link to the first trace.
Don't print the API key or commit the file that holds it.
Reference: https://traceroot.ai/docs/cli/get-started.md
可以。traceroot Cloud 有免费套餐,无需信用卡。可以自带模型 API key,也可以用托管模型。查看价格,了解包含的用量和付费套餐。
index.md · text/markdown · agent 拿到的内容
# traceroot: the open-source platform that continuously improves your ai agents.
Find the patterns in your agent's production issues. Ship verified fixes
with your coding agent. Everything here runs from the traceroot CLI;
add --json to any command for one machine-readable document on stdout
on success, or a JSON error on stderr on failure.
## Start here
Run setup from the root of the repository to trace. In a terminal, it
signs you in, creates a project API key, has Claude Code or Codex add
the SDK, and waits for the first trace:
npx -y traceroot-cli@latest setup
From a coding agent, run it without prompts:
npx -y traceroot-cli@latest setup --no-input
npx -y traceroot-cli@latest login # if setup reports no credential; # show the user the URL and code # carry out .traceroot/prompts/setup-instrument.md, then rerun the # same setup command, keeping all flags, and add --resume
npx -y traceroot-cli@latest setup --no-input --resume
# prints the first trace's link
To keep the traceroot command for everything below:
npm install -g traceroot-cli
traceroot doctor # credentials, repo, env, skills## Make your coding agent traceroot-aware
traceroot skills list # skills and install status per agent # add tracing to an app
traceroot skills install traceroot-instrument-repo --agent claude
# one runnable trace in minutes
traceroot skills install traceroot-quickstart --agent codex
# offline evals
npx skills add traceroot-ai/traceroot-skills --skill traceroot-eval
Agents: claude (.claude/skills), codex (~/.codex/skills),
generic (.agents/skills).
## Investigate production
traceroot traces list --since 1h --limit 10
traceroot traces get <trace-id> --fields full # span tree with I/O
traceroot traces export <trace-id> --output ./out
traceroot findings list --since 24h # detector findings
traceroot findings get --trace <trace-id> # results and root cause
traceroot sql "SELECT model_name, avg(duration_ms) FROM spans
GROUP BY model_name"
## Close the loop
traceroot detectors create --from-file detector.json
traceroot alerts create --from-file rule.json
traceroot datasets versions get <version-id> # cases and source traces
traceroot evals runs list --evaluation-id <id>
traceroot evals runs get <run-id> # scores, cost, duration
Also: projects, workspaces, dashboards, widgets, sql schema. Run
traceroot <command> --help for every flag.
## Scripting
traceroot traces list --since 24h --json | jq '.data[].trace_id'
Exit codes: 0 ok · 1 internal · 2 usage · 3 auth · 4 not found ·
5 network (retry).
Env: TRACEROOT_API_KEY, TRACEROOT_HOST_URL, TRACEROOT_PROJECT_ID.
## Instrument your app
pip install traceroot # Python
npm install @traceroot-ai/traceroot # TypeScript
Then initialize it in Python where the app starts, not at module scope,
so a test that imports the module doesn't send traces:
import traceroot
from traceroot import Integration
def main():
... # your application
if __name__ == "__main__":
traceroot.initialize(integrations=[Integration.OPENAI])
main()
Run your tests with TRACEROOT_ENABLED=false so they don't send traces.
OpenTelemetry-based, 22 integrations:
https://traceroot.ai/docs/integrations/overview
## Trace your coding agent
claude plugin marketplace add \
traceroot-ai/traceroot-claude-code-plugin
claude plugin install \
traceroot-observability@traceroot-claude-code-plugin
codex plugin marketplace add traceroot-ai/traceroot-codex-plugin
codex plugin add tracing@traceroot-codex-plugin
pi install npm:@traceroot-ai/pi-extension
## How it works
1. Trace: model and tool calls from your agent, with inputs, outputs,
latency and cost.
2. Detect: LLM judges score production runs against what good looks like.
3. Signals: judge outputs are clustered; a background coding agent
investigates traces and GitHub code in a sandbox and pinpoints the
commit, file and line. Alerts go to Slack.
4. Verify: offline evals compare the fix with a baseline before it ships.
New production traffic starts the cycle again.
## Pricing
Free $0 · Starter $30/mo · Pro $200/mo · Enterprise custom.
Free: 2 seats, 50k events/mo, 15-day retention, 100 detector runs/mo.
BYOK or hosted LLM on every plan. https://traceroot.ai/pricing
## Security and self-host
SOC 2 Type II, HIPAA, ISO 27001 audited by Oneleet. https://traceroot.ai/security
git clone https://github.com/traceroot-ai/traceroot.git
cd traceroot && make prod # full stack in Docker Compose
Kubernetes: traceroot-ai/traceroot-k8s (Helm chart)
AWS: traceroot-ai/traceroot-terraform-aws (experimental)
Apache-2.0 outside ee/ directories, which use the Enterprise License.
## Links
- CLI docs: https://traceroot.ai/docs/cli/get-started
- CLI source: https://github.com/traceroot-ai/traceroot-cli
- Docs index: https://traceroot.ai/docs/llms.txt
- Platform: https://github.com/traceroot-ai/traceroot
- Skills: https://github.com/traceroot-ai/traceroot-skills
- Python SDK: https://github.com/traceroot-ai/traceroot-py
- TS SDK: https://github.com/traceroot-ai/traceroot-ts
- App: https://app.traceroot.ai