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 CLI ~/.kimi/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.1.tar.gz (169.9 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.1-py3-none-any.whl (128.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentstracer-1.0.1.tar.gz
  • Upload date:
  • Size: 169.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e0967e306d2821f78899da0f17c65e094752439d1cecbb0b3066c1bbdbfd88dc
MD5 02554b50e4258ad93e502aef3bb9675c
BLAKE2b-256 3ff78365aa45b8865a6e9c7458fa09100e98347522fe792906986449460f5f1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentstracer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 128.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa0eb1719baf9d9b506dc52d72aef4fa77019e0e2ddfc575358643b68368a91a
MD5 081ddf7f233c4330a9a1e1f5fd85bdcf
BLAKE2b-256 7bdc3a2481c0f4d27cc84ecbdae1e5bf1bb46e215890cda73982687f625ee613

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