Skip to main content

Review, score, and curate your coding agent conversation traces locally

Project description

AgentsTrace (Local-Only Fork)

原版:kaiaiagent/clawtrace


快速开始

安装

pip install agentstracer

或从源码安装:

git clone https://github.com/cyijun/agentstracer.git
cd agentstracer
pip install -e .

基本使用

# 1. 配置导出源(claude/kimi/codex/gemini/all)
agentstracer config --source all

# 2. 导出对话记录
agentstracer export --no-push -o my_conversations.jsonl

私人使用(保留 API Keys)

# 禁用 secrets 脱敏(仅建议本地私人使用)
agentstracer config --no-secrets-redaction

# 导出(包含原始 API keys)
agentstracer export --no-push -o my_data.jsonl

# ⚠️ 警告:此文件包含明文 API keys,请勿分享!

其他命令

# 列出发现的项目
agentstracer list

# 启动本地 Web UI
agentstracer serve

# 查看配置
agentstracer config

支持的 AI 工具

工具 数据位置 状态
Claude Code ~/.claude/projects/
Kimi Code CLI ~/.kimi-code/sessions/
Codex CLI ~/.codex/sessions/
OpenCode ~/.local/share/opencode/
OpenClaw ~/.openclaw/
Gemini CLI ~/.gemini/tmp/

导出格式

JSONL(每行一个 JSON 对象):

{"session_id": "abc-123", "model": "kimi-k2", "messages": [...], ...}
{"session_id": "def-456", "model": "claude-3-7", "messages": [...], ...}

主要字段

字段 说明
session_id 会话唯一标识
model AI 模型名称
project 项目名称(已脱敏)
source 来源(claude/kimi/codex等)
start_time / end_time ISO 8601 时间
messages 对话消息列表
stats 统计信息

messages 结构

{
  "role": "user|assistant",
  "content": "消息内容",
  "thinking": "思考过程(assistant)",
  "timestamp": "2024-01-01T12:00:00Z",
  "tool_uses": [{
    "tool": "bash",
    "input": {"command": "ls -la"},
    "output": {"text": "..."},
    "status": "success"
  }]
}

关于本版本

这是 AgentsTrace 的修改版本,专注于本地隐私保护纯离线使用

主要修改点

1. 移除所有网络功能

  • ❌ 云上传功能
  • ❌ Skill 下载功能
  • ❌ 浏览器自动打开
  • ❌ 所有 urllib 网络请求

2. 可选禁用 Secrets 脱敏

  • 新增 --no-secrets-redaction 配置
  • 私人使用时保留 API keys
  • 路径/用户名脱敏始终启用

3. 安全审查

  • ✅ 无 eval() / exec() / compile()
  • ✅ 无动态代码执行
  • ✅ 无反序列化风险
  • ✅ 路径遍历已防护

与原版对比

功能 原版 本版本
云上传 ❌ 已移除
Skill 下载 ❌ 已移除
可选禁用脱敏 ✅ 支持
适用场景 分享数据集 私人本地分析

许可证

MIT License - 详见 LICENSE

Copyright (c) 2024 kaiaiagent (Original Author)
Copyright (c) 2024 cyijun (Modified Version)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentstracer-1.0.4.tar.gz (167.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentstracer-1.0.4-py3-none-any.whl (125.7 kB view details)

Uploaded Python 3

File details

Details for the file agentstracer-1.0.4.tar.gz.

File metadata

  • Download URL: agentstracer-1.0.4.tar.gz
  • Upload date:
  • Size: 167.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentstracer-1.0.4.tar.gz
Algorithm Hash digest
SHA256 27973b8ccaf6e8e660b4c1de5c9eea95319a826203eef8bafe9f2f445150e736
MD5 c5ac89166bf4c28404798e95324f3555
BLAKE2b-256 3846b55a6efe7092a32c62c2c6dcee1ec11a13424db5a23f2479410d9ee77187

See more details on using hashes here.

File details

Details for the file agentstracer-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: agentstracer-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 125.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentstracer-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3518ef98a6b05edcb2d88dec79c0622bac1d0b80619a989fdd66d8a622db43ab
MD5 09440bc88a854398b9c6b28f2e4f06f8
BLAKE2b-256 8fa0232266598a2e6c62f5c700fb2059c0bcf4aa96275e299c8ac07485e86290

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page