Skip to content

Capture the active instruction surface for each snapshot #323

Description

@caioribeiroclw-pixel

I found Ponytrail from the HN launch. The local snapshot tree is already useful for "what changed / why / how to revert". One audit gap I would consider: the snapshot currently explains the action, but not the instruction surface that made the action likely.

For AI-agent edits, that can matter as much as the diff. A future history --details entry could optionally include a compact instruction_context / decision_context block, for example:

{
  "agent": "claude|codex|copilot|unknown",
  "skill": { "name": "pony-trail", "version": "..." },
  "context_files": [
    { "path": "AGENTS.md", "sha256": "..." },
    { "path": ".cursor/rules/codegraph.mdc", "sha256": "..." },
    { "path": "CLAUDE.md", "sha256": "..." }
  ],
  "env": {
    "session_id": "...",
    "git_branch": "...",
    "git_commit": "..."
  }
}

The important bit is not storing prompts or private transcript text. It is recording the small set of local instruction/context files and skill metadata that were active when the agent decided to mutate files.

Why this helps:

  • When a revert happens days later, the user can distinguish "bad edit" from "bad rule/skill/context caused the edit".
  • If an agent rule changed between the pre and post snapshot, the history can show that the rollback should inspect the rule too, not only the target file.
  • It makes Ponytrail more useful across Claude/Codex/Copilot because the causal context behind the same file diff may be different per agent.

A minimal v1 could be opt-in and local-only: hash known root instruction files (AGENTS.md, CLAUDE.md, .cursor/rules/*, .github/copilot-instructions.md, installed skill path) into the snapshot entry. No raw prompt capture required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions