← 返回
未分类

atifact

This skill should be used when the user asks to "extract agent trajectory", "convert HAR to trajectory", "get trajectory from session", "parse agent session"...
当用户请求“提取代理轨迹”、“将HAR转换为轨迹”、“从会话获取轨迹”或“解析代理会话”时使用此技能。
waldekmastykarz
未分类 clawhub v0.7.0 1 版本 99621.2 Key: 无需
★ 0
Stars
📥 263
下载
💾 0
安装
1
版本
#latest

概述

Extract Agent Trajectories with atifact

Convert agent session recordings (HAR files, Claude Code JSONL logs, Copilot CLI JSONL logs) into structured ATIF v1.6 trajectory JSON using the atifact CLI.

Prerequisites

Verify the CLI is available:

command -v atifact

If not installed, install globally:

npm install -g atifact

Supported input formats

FormatFile typeDescription
--------------------------------
har.harHAR files with OpenAI (Chat Completions, Responses API) or Anthropic (Messages API) requests
claude-code-jsonl.jsonlClaude Code CLI session logs
copilot-cli-jsonl.jsonlCopilot CLI session logs

Format is auto-detected from file contents (not extension). Use --format / -f to force a specific format when auto-detection fails.

Usage

Basic conversion

The --output / -o option takes a prefix, not a filename. Output files are derived from the prefix:

  • Main trajectory: .trajectory.json
  • Subagent trajectories: .trajectory..json

Default prefix is the input file path:

atifact session.har
# Writes: session.har.trajectory.json

Specify output prefix

atifact session.har -o out
# Writes: out.trajectory.json
# If subagents exist: out.trajectory.<name>.json

Force input format

Use when auto-detection picks the wrong format for .jsonl files:

atifact session.jsonl -f claude-code-jsonl
atifact session.jsonl -f copilot-cli-jsonl

Pipe JSON to stdout

Use --json with --quiet to suppress diagnostics and get clean JSON on stdout. Output is a JSON array of all trajectories (main first, then subagents). No files are written.

atifact session.har --json --quiet

Combine with other tools:

atifact session.har --json --quiet | jq '.[0].steps | length'

CLI options

OptionAliasDescription
----------------------------
Path to the input file (required)
--output-oOutput path prefix. Main: .trajectory.json, subagents: .trajectory..json (default: input file path)
--format-fForce input format: har, claude-code-jsonl, copilot-cli-jsonl
--jsonWrite JSON array of all trajectories to stdout (no files written). First element is main, rest are subagents.
--quiet-qSuppress progress messages (stderr only)

Exit codes

CodeMeaning
---------------
0Success
1Runtime error (parse failure, I/O error)
2Invalid usage (bad arguments, missing file)

Workflow

  1. Identify the input file and its format (HAR or JSONL).
  2. For .jsonl files, determine the source (Claude Code or Copilot CLI) to use the correct --format if auto-detection fails.
  3. Run atifact with the input file. Use -o to set the output prefix (e.g., atifact /path/to/session.har -o /path/to/session). The main trajectory is written to .trajectory.json.
  4. Report the output file path(s) and key metrics (total steps, total cost) from the generated trajectory.

Notes

  • HAR files may contain multiple API formats (OpenAI + Anthropic); all are parsed.
  • Multi-turn HAR conversations are deduplicated (each request carries full history).
  • Utility calls (e.g., gpt-4o-mini title generation) are excluded from the trajectory.
  • Tool results from request N are attached as observations to the agent step from request N-1.
  • Copilot CLI logs with subagent task tool calls produce separate trajectory files per subagent. The main trajectory references them via subagent_trajectory_ref with trajectory_path pointing to the sibling file.
  • All timestamps are preserved from source data as-is (ISO 8601).

版本历史

共 1 个版本

  • v0.7.0 当前
    2026-05-21 14:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

gitload

waldekmastykarz
此技能应在用户请求“下载 GitHub 文件”“从仓库获取文件夹”“获取 GitHub 代码”或“下载 GitHub仓库”时使用。
★ 3 📥 3,477

mdstr

waldekmastykarz
用于在用户请求将 Markdown 转换为 JSON 字符串、转义 Markdown 为 JSON、让 Markdown 符合 JSON 安全或将其嵌入…时使用。
★ 0 📥 276

jyml

waldekmastykarz
当用户请求将YAML转换为JSON、将JSON转换为YAML、转换YAML文件、转换JSON文件或转换配置时使用此技能。
★ 0 📥 269