Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计未展示

traqo-tracing特拉科追踪

Agent Skill

traqo-tracing 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

264

周安装

11

GitHub Stars

公开资料未说明

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:traqo-tracing(特拉科追踪)
来源仓库:https://github.com/cecuro/traqo
仓库路径:skills/traqo-tracing
安装命令:
npx skills add https://github.com/cecuro/traqo --skill traqo-tracing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cecuro/traqo --skill traqo-tracing

简介

traqo-tracing 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态及是否触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

traqo Trace Analysis

Analyze JSONL traces produced by the traqo Python package.

Trace File Structure

Traces are stored as compressed .jsonl.gz files, optionally with a .content.jsonl.zst sidecar for externalized large span inputs. The raw .jsonl buffer is deleted after compression. Last line is always trace_end with summary stats. Start there.

For compressed traces, large span_start inputs (>10 KB) are replaced with {"_ref": "<span_id>", "_size": N} stubs. The full input lives in the companion .content.jsonl.zst file. If you see a _ref stub, use traqo ui (loads on click) or the Python read_content() API to retrieve the original input.

Event Types

EventKey Fields
trace_starttracer_version, input, metadata, tags, thread_id
span_startid, parent_id, name, input, metadata, tags, kind
span_endid, parent_id, name, duration_s, status, output, metadata, tags, kind
eventname, data (arbitrary dict)
trace_endduration_s, output, stats, children

Every event has id, parent_id, and ts (ISO timestamp). span_start and span_end share the same id — use it to correlate a span's start with its end. The kind field categorizes spans: "llm" (model calls), "tool" (tool executions), "chain" (orchestration/graph nodes), "retriever" (search/RAG). LLM-specific data (model, provider, token_usage) lives in metadata. tags is a list of strings for filtering. thread_id groups traces into conversations. event is a point-in-time log entry (via tracer.log()) — no duration, just a name and arbitrary data dict (e.g. checkpoints, metrics).

Error spans have status: "error" and an error object with {type, message, traceback} (e.g. {"type": "APITimeoutError", "message": "Request timed out.", "traceback": "..."}). Success spans have status: "ok".

Event Structure

{"type":"trace_start","ts":"2026-02-20T10:00:00Z","tracer_version":"0.2.0","input":{"query":"hello"},"tags":["production"],"thread_id":"conv-123","metadata":{"run_id":"abc"}}
{"type":"span_start","id":"x1y2z3","parent_id":"a1b2c3","ts":"2026-02-20T10:00:01Z","name":"classify","kind":"llm","tags":["gpt-4o"],"input":[{"role":"user","content":"..."}],"metadata":{"provider":"openai","model":"gpt-4o"}}
{"type":"span_end","id":"x1y2z3","parent_id":"a1b2c3","ts":"2026-02-20T10:00:03Z","name":"classify","kind":"llm","duration_s":1.8,"status":"ok","output":"...","metadata":{"provider":"openai","model":"gpt-4o","token_usage":{"input_tokens":1500,"output_tokens":800,"reasoning_tokens":200,"cache_read_tokens":1200,"cache_creation_tokens":0}}}
{"type":"trace_end","ts":"2026-02-20T10:05:00Z","duration_s":300.0,"output":{"response":"..."},"stats":{"spans":15,"events":5,"total_input_tokens":45000,"total_output_tokens":12000,"total_cache_read_tokens":30000,"total_cache_creation_tokens":5000,"total_reasoning_tokens":2000,"errors":0},"children":[{"name":"agent_a","file":"agent_a_20260220T100000_abc12345.jsonl.gz","duration_s":45.2,"spans":3,"total_input_tokens":5000,"total_output_tokens":2000,"total_reasoning_tokens":500}]}

Nested Traces

Pipelines can split work into child traces — separate .jsonl.gz files for each sub-task (e.g. one per agent, batch item, or concurrent worker). The parent trace's trace_end lists all children in its children array. Each child entry has: name, file (the .jsonl.gz filename), duration_s, spans, total_input_tokens, total_output_tokens, total_reasoning_tokens.

A child trace is a complete, self-contained trace file with its own trace_start/trace_end. Navigate to it by downloading the file referenced in children[].file. Child traces may themselves have children (arbitrary nesting depth).

Reading Traces

File formats

Traces are stored as compressed .jsonl.gz files, with an optional .content.jsonl.zst sidecar for large span inputs:

ls traces/    # Look for .jsonl.gz and .content.jsonl.zst

Use zcat (Linux) or gzcat (macOS) to read, then pipe to grep/jq:

# macOS
gzcat trace.jsonl.gz | tail -1 | jq .

# Linux
zcat trace.jsonl.gz | tail -1 | jq .

Tip: For large traces, prefer traqo ui over shell commands.

Downloading traces from cloud storage

# GCS
gcloud storage cp gs://bucket/prefix/trace.jsonl.gz /tmp/
gcloud storage cp "gs://bucket/prefix/*.jsonl.gz" /tmp/traces/

# S3
aws s3 cp s3://bucket/prefix/trace.jsonl.gz /tmp/
aws s3 cp s3://bucket/prefix/ /tmp/traces/ --recursive --exclude "*" --include "*.jsonl.gz"

Navigation

# Overview (always start here — last line is trace_end with stats)
gzcat trace.jsonl.gz | tail -1 | jq .

# Compact stats (use this for large traces with many children)
gzcat trace.jsonl.gz | tail -1 | jq '{duration_s, stats, children_count: (.children // [] | length)}'

# Trace context (first line has trace name, input, tags, metadata)
gzcat trace.jsonl.gz | head -1 | jq .

# Follow child traces (file field matches the .jsonl.gz filename on disk/cloud)
# Pipelines often split work into child traces (e.g. one per agent or batch item).
# The parent trace_end lists all children with their file, stats, and duration.
gzcat trace.jsonl.gz | tail -1 | jq '(.children // [])[] | {name, file, spans, total_input_tokens}'

Tip: For traces with many children, limit output with |.[:10] (jq array slice) or pipe through | head -20.

Token Usage

# Per-span tokens from metadata (input_tokens includes cached)
gzcat trace.jsonl.gz | jq 'select(.metadata.token_usage) | {name, id, model: .metadata.model, tokens: .metadata.token_usage}'

# Total from summary (includes cache and reasoning breakdown)
gzcat trace.jsonl.gz | tail -1 | jq '.stats | {total_input_tokens, total_output_tokens, total_cache_read_tokens, total_cache_creation_tokens, total_reasoning_tokens}'

Errors

# Single file — error has {type, message, traceback}
gzcat trace.jsonl.gz | jq 'select(.status == "error") | {name, kind, error_type: .error.type, message: .error.message}'

# Multiple files
for f in traces/*.jsonl.gz; do
  gzcat "$f" | jq 'select(.status == "error") | {file: "'"$(basename "$f")"'", name, error_type: .error.type, message: .error.message}'
done

# Total error count from trace summary
gzcat trace.jsonl.gz | tail -1 | jq '.stats.errors'

LLM Spans

# All LLM span_end events with model, duration, and token usage
gzcat trace.jsonl.gz | jq 'select(.type == "span_end" and .kind == "llm") | {name, model: .metadata.model, duration_s, tokens: .metadata.token_usage}'

# Just model names used in a trace
gzcat trace.jsonl.gz | jq -r 'select(.type == "span_end" and .kind == "llm") | .metadata.model' | sort -u

# Count LLM spans and total duration
gzcat trace.jsonl.gz | jq -s '[.[] | select(.type == "span_end" and .kind == "llm")] | {count: length, total_duration_s: (map(.duration_s) | add)}'

All integrations (OpenAI, Anthropic, Gemini, LangChain, cc-sync) use consistent metadata field names: model, model_parameters, time_to_first_token_s, and token_usage with keys input_tokens, output_tokens, reasoning_tokens, cache_read_tokens, cache_creation_tokens.

Tool Usage

# Count tool calls by name
gzcat trace.jsonl.gz | jq -r 'select(.type == "span_end" and .kind == "tool") | .name' | sort | uniq -c | sort -rn

# Tool spans with duration and output preview
gzcat trace.jsonl.gz | jq 'select(.type == "span_end" and .kind == "tool") | {name, duration_s, output: (.output | tostring | .[:100])}'

LLM Reasoning / Thinking

LLM span output is a string for text-only responses, or {"text": "...", "reasoning": "..."} when the model produced thinking/reasoning content.

# Extract reasoning content from LLM spans
gzcat trace.jsonl.gz | jq 'select(.type == "span_end" and .kind == "llm" and (.output | type) == "object" and .output.reasoning) | {name, reasoning: .output.reasoning}'

# All LLM outputs (handles both string and object formats)
gzcat trace.jsonl.gz | jq 'select(.type == "span_end" and .kind == "llm") | {name, output_type: (.output | type), has_reasoning: ((.output | type) == "object" and (.output.reasoning | length) > 0)}'

Span Tree

# Root span (first span_start — in child traces, parent_id points to the parent trace)
gzcat trace.jsonl.gz | jq -s '[.[] | select(.type == "span_start")][0] | {id, parent_id, name, kind}'

# Top-level spans (direct children of root)
gzcat trace.jsonl.gz | jq -s '([.[] | select(.type == "span_start")][0].id) as $root | [.[] | select(.type == "span_start" and .parent_id == $root)] | map({id, name, kind})'

# All spans flat list (parent_id links to parent span)
gzcat trace.jsonl.gz | jq 'select(.type == "span_start") | {id, parent_id, name, kind}'

# Span kinds breakdown
gzcat trace.jsonl.gz | jq -r 'select(.type == "span_end") | .kind' | sort | uniq -c | sort -rn

# Search spans by name pattern (case-insensitive)
gzcat trace.jsonl.gz | jq 'select(.name // "" | test("pattern"; "i")) | {type, name, kind}'

Note: The first two commands use jq -s (slurp) which loads the entire file into memory. For large traces (100K+ spans), use traqo ui instead. For visual tree exploration with waterfall timing, prefer traqo ui./traces/ over shell commands.

Common Investigations

# Find the slowest child trace
gzcat root.jsonl.gz | tail -1 | jq '(.children // []) | sort_by(-.duration_s) | .[0] | {name, file, duration_s, spans}'

# Find the most expensive child trace (by input tokens)
gzcat root.jsonl.gz | tail -1 | jq '(.children // []) | sort_by(-.total_input_tokens) | .[0] | {name, file, total_input_tokens}'

# Download a specific child trace by name (from the children list)
gzcat root.jsonl.gz | tail -1 | jq -r '(.children // [])[] | .file' | grep "agent_name" | xargs -I{} gcloud storage cp "gs://bucket/prefix/{}" /tmp/traces/

# Find which child traces had errors (requires downloading them first)
for f in traces/*.jsonl.gz; do
  errors=$(gzcat "$f" | jq -s '[.[] | select(.status == "error")] | length')
  [ "$errors" -gt 0 ] && echo "$f: $errors errors"
done || true

Note: jq -s (slurp) loads the entire file into memory. For very large traces (100K+ spans), prefer line-by-line jq or use traqo ui instead.

Python reader API

from traqo.reader import iter_llm_spans, aggregate_tokens
from pathlib import Path

# Iterate LLM spans (handles .jsonl and .jsonl.gz transparently)
for span in iter_llm_spans(Path("trace.jsonl.gz")):
    print(f"{span.model}: {span.input_tokens}in/{span.output_tokens}out ({span.duration_s}s)")

# Aggregate tokens by model
aggregate_tokens(Path("trace.jsonl.gz"))
# {'gpt-4o': {'input': 45000, 'output': 12000}}

Retrieving externalized content

When a span_start input was too large (>10 KB), it gets replaced with a reference stub:

{"type":"span_start","id":"abc123","input":{"_ref":"abc123","_size":245000}}

The full input lives in the .content.jsonl.zst sidecar file. To retrieve it:

from traqo.compress import read_content
from pathlib import Path

# read_content streams the zst file and stops at the matching span — ~1 MB memory
data = read_content(Path("trace.content.jsonl.zst"), "abc123")
# Returns the original input dict, or None if not found

In the trace viewer UI (traqo ui), externalized inputs show a "Load full input" button that fetches on click via the /api/content endpoint — no manual work needed.

Claude Code Integration

Convert Claude Code session transcripts into traqo traces.

# Sync a single session
traqo cc-sync path/to/session.jsonl

# Sync all sessions from ~/.claude/projects/
traqo cc-sync --all --output-dir ./traces

# As a Claude Code Stop hook (~/.claude/settings.json)
# { "hooks": { "Stop": [{ "type": "command", "command": "traqo cc-sync --hook" }] } }

Produces one trace per session with turn spans, LLM spans (with token usage including cache breakdown), tool call spans, and subagent hierarchy.

Trace Viewer UI

Built-in React web dashboard. Bundled with the pip package — no extra install needed.

# Local traces
traqo ui traces/

# Custom port
traqo ui traces/ --port 8080

# S3 or GCS
traqo ui s3://bucket/prefix
traqo ui gs://bucket/prefix

Features: span tree with waterfall timing, tag/status filtering, search, token usage charts, cache token totals, keyboard shortcuts (↑/↓ navigate, Esc back,? help). Handles compressed .jsonl.gz traces and loads externalized span inputs on demand via "Load full input" button. Suggest the UI when the user wants to visually explore or browse traces.

Adding Tracing to Code

Decorate a function

from traqo import trace

@trace()
async def my_function(data):
    return process(data)

@trace(metadata={"component": "auth"}, tags=["auth"], kind="tool")
def login(user):
    return authenticate(user)

Access current span from decorated function

from traqo import trace, get_current_span

@trace()
def classify(text):
    span = get_current_span()
    if span:
        span.set_metadata("confidence", 0.95)
    return result

Wrap an LLM client

from traqo.integrations.openai import traced_openai
client = traced_openai(OpenAI(), operation="classify")

from traqo.integrations.anthropic import traced_anthropic
client = traced_anthropic(AsyncAnthropic(), operation="analyze")

from traqo.integrations.langchain import traced_model
model = traced_model(ChatOpenAI(), operation="summarize")

Trace a Claude Agent SDK session

from claude_agent_sdk import query, ClaudeAgentOptions
from traqo.integrations.claude_agent_sdk import traqo_agent

# Standalone
async with traqo_agent("code-review", output_dir="./traces", tags=["review"]) as hooks:
    async for msg in query(prompt="Review this PR", options=ClaudeAgentOptions(hooks=hooks)):
        print(msg)

# Nested inside a parent pipeline trace
with Tracer(Path("traces/pipeline.jsonl"), tags=["ci"]) as tracer:
    async with traqo_agent("code-review", tags=["review"]) as hooks:
        async for msg in query(prompt="Review", options=ClaudeAgentOptions(hooks=hooks)):
            ...

Use spans with metadata

from traqo import get_tracer

tracer = get_tracer()
if tracer:
    with tracer.span("my_step", input=data, metadata={"model": "gpt-4o"}, tags=["llm"], kind="llm") as span:
        result = call_llm()
        span.set_metadata("token_usage", {"input_tokens": 100, "output_tokens": 50})
        span.set_output(result)

Log a custom event

from traqo import get_tracer
tracer = get_tracer()
if tracer:
    tracer.log("checkpoint", {"count": len(results)})

Activate tracing

from traqo import Tracer
from pathlib import Path

with Tracer(
    Path("traces/run.jsonl"),
    input={"query": "hello"},
    metadata={"run_id": "abc123"},
    tags=["production"],
    thread_id="conv-456",
) as tracer:
    result = await main()
    tracer.set_output({"response": result})

Child tracer for concurrent agents

child = tracer.child("my_agent", Path("traces/agents/my_agent.jsonl"))
with child:
    await run_agent()

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.63%
按下载量换算30

Claude

27.92%
按下载量换算25

Cursor

20.26%
按下载量换算18

Gemini CLI

9.39%
按下载量换算8

安全审计

暂无安全审计结果可展示。

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/cecuro/traqo --skill traqo-tracing 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills