Skip to content

reconstruct: rebuild past sessions from the agents' own on-disk logs #231

Open

Description

@blitzcrieg1

Why

The stated limit Agentmetry repeats everywhere is that hooks are cooperative: a session that ran before the sensor was installed, or while hooks were off, is invisible. Several agents keep their own session logs on disk, and reading them closes part of that gap after the fact. Perplexity's Numbat ships this as forensic reconstruction from on-disk session artifacts, and it is the most useful capability on its list that Agentmetry does not have.

Shape

agentmetry reconstruct --agent claude [--since DATE] [--path DIR]
  • One parser per agent, starting with Claude Code's session transcripts, then Codex, then Cursor. Each parser produces canonical events through the same enrichment as the hooks: argument hash, traits, MITRE and ATLAS.
  • Every reconstructed event is labelled as such, for example source.adapter: claude_transcript and an inferred:reconstructed marker. It must never be presentable as live capture.
  • Reconstructed events go into the trail as new chained records at import time. The chain proves they have not changed since the import. It cannot prove anything about the transcript before that, and the docs must say so.
  • Skip a session already captured by hooks. Match on session id, so the same tool call is not recorded twice.
  • Run the sequence rules over reconstructed sessions, so a credential read followed by egress in an old session is found.

Constraints

  • No frozen file changes. This is an adapter (core/audit/adapters/), like the AGT importer.
  • Transcript formats are not a stable API. Each parser keeps a fixture taken from a real session, and fails loudly on a shape it does not recognise rather than guessing.
  • Transcripts can hold prompt text and file contents. Only what the hooks would record is kept; arguments are hashed, and prompts are not stored.

Done when

  • Claude Code transcripts reconstruct into labelled, chained events, and credential-exfil fires on a fixture session.
  • The README "What it does not do" section is updated to say what reconstruction does and does not cover.
  • Codex and Cursor parsers follow, each in its own PR.

Activity

  1. added
    enhancement
    on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions