@alwaysmeticulous/agent-traces
v3.2.0
Published
Converts coding-agent session transcripts to ATIF trajectories and prepares them for upload to Meticulous
Readme
AI-generated: This file was generated by AI and has not yet been reviewed by a human.
@alwaysmeticulous/agent-traces
Turns coding-agent sessions (Claude Code, Codex, Cursor, Devin, OpenCode and
Pi) into ATIF trajectories and
prepares them for upload to Meticulous. The converters work on file contents
that have already been read. findTraceSessions (src/from-files/) finds
the sessions in files and directories a user names, for
meticulous traces upload; discovering every session on a machine is left to
the uploader.
| Directory | Contents |
| ---------------------------- | -------------------------------------------------------------------------- |
| src/types/ | The ATIF trajectory, raw envelope and summary shapes, and the ingest API |
| src/atif/ | Helpers shared by the converters and by readers of ATIF |
| src/git/ | Normalising remotes, branch names and pull request URLs |
| src/<agent>/ | Each agent's converter (convert*Session) and its strip*ToolOutputs |
| src/hook-events/ | The hook events the agent traces plugin spools (input to Cursor and Devin) |
| src/identity/ | Who and where a session ran: git config, OS and cloud environment |
| src/tool-output-exclusion/ | excludeToolOutputs and the per-agent TOOL_OUTPUT_STRIPPERS |
| src/redact/ | redactSecrets, which blanks anything that looks like a credential |
| src/upload/ | SessionPayload, buildSummary and prepareSessionUpload |
| src/from-files/ | findTraceSessions: trace files a user names, grouped into sessions |
| src/user-config/ | The developer's ~/.meticulous/traces-config.json |
A converter's SessionPayload goes through prepareSessionUpload, which
excludes tool outputs, redacts secrets, gzips the ATIF and raw envelope and
hashes the raw files, giving the bodies of the presigned uploads. Everything
is exported from src/index.ts.
Sessions from files
findTraceSessions(paths, options) collects files (crawling directories for
.jsonl, .json and .txt), detects each one's format from its first lines
(detect/), groups them into sessions (group/<format>/, mirroring how the
uploader lays out each agent's sessions, including subagents beside a
session) and returns each with a prepare that reads and converts it:
| Format | Detected by |
| ----------------------------- | ------------------------------------------------------------------------ |
| Codex rollout | A session_meta first line with a payload.id |
| Pi session | A session first line with an id and no payload |
| Cursor transcript | Lines with a top-level role and no type, or user: / <user_query> |
| Claude Code transcript | Typed lines with a sessionId, uuid or leafUuid, and no role |
| opencode export | info.id starting ses_, and messages |
| ATIF | schema_version starting ATIF-, agent and steps |
| Claude Code subagent metadata | Its name, agent-<id>.meta.json |
An ATIF file is uploaded as is, under the agent it names (other if we don't
know it), with rawFormat: "atif" on its envelope so tool output exclusion
strips the raw trajectory rather than applying that agent's stripper.
statsFromAtif summarises it.
