Skip to content

Import

The import command converts agent session transcripts into AgentV’s Message[] format for offline grading — no re-running the agent, no API keys needed.

ProviderCommandSource
Claude Codeagentv import claude~/.claude/projects/<path>/<uuid>.jsonl

Codex and Copilot importers are planned for future releases.

Import a Claude Code session transcript.

Terminal window
agentv import claude --list

Output:

Found 5 session(s):
4c4f9e4e-e6f1-490b-a1b1-9aef543ebf22 2m ago -home-user-myproject
087b801a-7a63-48ff-b348-62563a290b23 1h ago -home-user-myproject
ed8b8c62-4414-49fb-8739-006d809c8588 3h ago -home-user-other-project
Terminal window
agentv import claude --discover latest
Terminal window
agentv import claude --session-id 4c4f9e4e-e6f1-490b-a1b1-9aef543ebf22
Terminal window
agentv import claude --discover latest --project-path /home/user/myproject
Terminal window
agentv import claude --discover latest -o transcripts/my-session.jsonl

Default output: .agentv/transcripts/claude-<session-id-short>.jsonl

FlagDescription
--session-id <uuid>Import a specific session by UUID
--discover latestImport the most recent session
--project-path <path>Filter sessions by project path
--output, -o <path>Custom output file path
--projects-dir <dir>Override ~/.claude/projects directory
--listList available sessions instead of importing

The imported transcript is written as JSONL — one Message object per line:

{"role":"user","content":"Fix the bug in auth.ts"}
{"role":"assistant","content":"I'll fix the authentication bug.","toolCalls":[{"tool":"Read","input":{"file_path":"src/auth.ts"},"id":"toolu_01...","output":"...file contents..."}]}

Each message follows AgentV’s standard Message interface with role, content, and optional toolCalls (including tool outputs paired from subsequent events).

Claude EventAgentV Message
user{ role: 'user', content }
assistant{ role: 'assistant', content, toolCalls }
tool_use blocksToolCall { tool, input, id }
tool_result blocksPaired with matching tool_use by ID
progress, systemSkipped
Subagent eventsFiltered out (v1)

Token usage is aggregated from the final cumulative value per LLM request. Duration is computed from first-to-last event timestamp.

Import a session, then run evaluators against it:

Terminal window
# 1. Import the latest Claude Code session
agentv import claude --discover latest
# 2. Run evaluators against the imported transcript
agentv eval evals/my-eval.yaml --transcript .agentv/transcripts/claude-4c4f9e4e.jsonl

See examples/features/import-claude/ for a complete working example.