How to scan AI coding session logs before sharing or committing

Keep transcripts outside the repository and scan any intended export. Session logs can include tool output and file contents.

Example

An engineer shares a work session to demonstrate a reproducible bug. The session export contains terminal output unrelated to the bug.

What to do

  1. Locate the actual logs and exports for the installed coding tools. Add paths to repository ignore rules where appropriate.
  2. Scan the exact file before attachment or commit. Create a minimal redacted reproduction when raw logs contain unnecessary context.
  3. Include transcripts and JSONL files in local and CI checks where the workflow can copy them into the repository.

How to verify

A fictional secret in a staged transcript is caught and the redacted reproduction still explains the bug.

Limits

Ignore rules do not remove files already tracked. Rotate live credentials found in prior commits or public attachments.

Spendplane for this workflow

Set up a Spendplane gateway key

Related reading