Crowdsource agent traces to HuggingFace Hub
Project description
opentraces
Open schema + CLI for collecting, reviewing, and publishing agent traces to Hugging Face Hub.
Every coding session leaves behind the data you actually want: prompts, tool calls, reasoning, edits, outcome signals, and eventually the code that shipped. opentraces captures that locally, runs layered security passes, lets you review it, and publishes sharded JSONL datasets in an open schema.
Sharing traces can leak secrets, credentials, internal paths, or customer data. opentraces reduces that risk, but it does not remove it. Read the security docs before you publish anything.
What It Does
- Capture traces from supported agents such as Claude Code.
- Enrich them with task, model, token, dependency, and git metadata.
- Run regex, entropy, optional TruffleHog, and optional LLM review passes.
- Stage traces locally for review in the terminal, browser, or CLI inbox.
- Publish them as immutable JSONL shards to a Hugging Face dataset.
- Correlate traces to later commits via
blameandgraph, with evidence-tieredGitLinkattribution (tool_emitted,overlapping,orphan), powered by an optional background watcher. - Export staged traces to downstream formats such as
atifandagent-trace. - Import existing datasets with
opentraces pull --parser hermes, routed through the same security and staging flow.
Install
Preferred end-user install:
pipx install opentraces
Homebrew:
brew install JayFarei/opentraces/opentraces
skills.sh (installs the opentraces skill so your coding agent can drive the workflow):
npx skills add jayfarei/opentraces
From source:
git clone https://github.com/JayFarei/opentraces
cd opentraces
python3 -m venv .venv
source .venv/bin/activate
pip install -e packages/opentraces-schema
pip install -e ".[dev]"
Use plain pip install opentraces only in CI or disposable environments.
Both review surfaces (opentraces web, opentraces tui) ship in the default install, no extras required.
Quick Start
opentraces has a two-phase bootstrap: setup wires the machine once, init wires each repo.
# one-time machine setup (capture hooks, watcher, HF login, optional tiers)
opentraces setup
# initialize this repo (agents, review policy, remote dataset)
opentraces init
# review traces locally
opentraces web
# or: opentraces tui
# stage reviewed traces for upload
opentraces add --all
# publish the staged set
opentraces push
init writes the committable marker at .opentraces.json. Captured traces, runtime state, and upload bookkeeping stay machine-local under ~/.opentraces/projects/<slug>/.
Useful follow-ups:
opentraces doctorchecks auth, integrations, and pipeline health.opentraces blame <sha>andopentraces graphshow commit-to-trace attribution (runopentraces setup gitfirst to install the post-commit correlator).opentraces setup trufflehogenables Tier 1.5 scanning.opentraces setup llm-reviewconfigures Tier 2 semantic review.opentraces push --llm-reviewgates uploads on a clean Tier 2 verdict.opentraces assessscores trace quality locally or across a remote dataset.opentraces pull owner/dataset --parser hermesimports traces from an existing Hugging Face dataset.opentraces loglists recent pushes grouped by date;-vexpands to per-trace rows with tokens and cost.opentraces resume <trace-id>reopens the upstream agent session behind a trace.
Tell Your Agent
Paste this into your coding agent:
Set up opentraces in this project.
1. Check whether `opentraces --version` works.
If not, install with `pipx install opentraces`.
2. Run the one-time machine setup:
`opentraces setup`
This walks each integration (capture hooks, watcher, entity parser,
HuggingFace login, optional TruffleHog, optional LLM review).
3. Confirm authentication:
`opentraces auth whoami`
If unauthenticated, use browser login (`opentraces auth login`)
or token login (`opentraces auth login --token`).
4. Initialize the repo:
`opentraces init`
This prompts for agents, review policy, and the HuggingFace remote.
5. After init, the daily workflow is:
- `opentraces status`
- `opentraces web` or `opentraces tui`
- `opentraces add --all`
- `opentraces push`
6. Optional hardening:
- `opentraces doctor`
- `opentraces setup trufflehog`
- `opentraces setup llm-review`
- `opentraces push --llm-review`
7. Attribution queries (run `opentraces setup git` once to install the post-commit correlator):
- `opentraces blame <sha>`
- `opentraces graph`
8. Import from an existing dataset:
- `opentraces pull owner/dataset --parser hermes`
Security
The built-in pipeline is versioned independently from the CLI and schema (currently SECURITY_VERSION = 0.3.0). Run opentraces doctor --security to see the exact tiers, versions, and commands active in your install.
| Tier | Name | Status | What it does |
|---|---|---|---|
| 1a | Regex patterns | always on | Built-in secret detectors for known token and key formats |
| 1b | Shannon entropy | always on | Flags high-entropy strings that look like secrets |
| 1.5 | TruffleHog | optional | Local scan for broader secret detection, findings redacted in place |
| 2 | LLM trace review | optional, on demand | Semantic review over the whole trace transcript |
| 3 | Human review | always available | Web inbox, TUI, and CLI review before upload |
See security tiers and scanning details.
Schema
The trace format lives in packages/opentraces-schema/. Each JSONL line is one TraceRecord, with:
- task and agent identity
- TAO-loop steps
- tool calls and observations
- token and cost metrics
- outcome signals
- security metadata
- optional attribution and commit correlation data
The schema is a superset of ATIF and borrows ideas from Agent Trace, ADP, and OTel GenAI. Current schema version: 0.3.0.
Docs
Packages
| Package | Description |
|---|---|
src/opentraces/ |
CLI, capture, review, publish, security, enrichment |
packages/opentraces-schema/ |
Standalone Pydantic schema package |
packages/opentraces-ui/ |
Shared design tokens and UI primitives |
Project Layout
packages/
opentraces-schema/
opentraces-ui/
src/opentraces/
cli/
core/
capture/
publish/
enrichment/
quality/
security/
clients/
web/
viewer/
site/
coming-soon/
tests/
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e packages/opentraces-schema
pip install -e ".[dev]"
pytest tests/ -v
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opentraces-0.3.3-py3-none-any.whl.
File metadata
- Download URL: opentraces-0.3.3-py3-none-any.whl
- Upload date:
- Size: 604.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6608516824e983f02a037c1e742d8c9521dab1420467bcfadc4e76a06aa35ea2
|
|
| MD5 |
ef3ddb3f1279802ff46cfd8d208b69ab
|
|
| BLAKE2b-256 |
9dfdf5af3582224504472f583ed29dfe00b56c9589e3ca7edec535c2ace8fcbd
|
Provenance
The following attestation bundles were made for opentraces-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on JayFarei/opentraces
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opentraces-0.3.3-py3-none-any.whl -
Subject digest:
6608516824e983f02a037c1e742d8c9521dab1420467bcfadc4e76a06aa35ea2 - Sigstore transparency entry: 1343436898
- Sigstore integration time:
-
Permalink:
JayFarei/opentraces@a18b9434a97fc083b7951545399fe4b8d261a019 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/JayFarei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a18b9434a97fc083b7951545399fe4b8d261a019 -
Trigger Event:
release
-
Statement type: