---
name: agent-transcript
description: "Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely."
title: agent-transcript
canonical_url: https://skilld.dev/gh/openclaw/agent-skills/agent-transcript
last_updated: 2026-11-12T12:14:50.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [package.json](https://skilld.dev/api/skills-raw/openclaw/agent-skills/agent-transcript/package.json), [scripts/agent-transcript](https://skilld.dev/api/skills-raw/openclaw/agent-skills/agent-transcript/scripts/agent-transcript), [scripts/agent-transcript.test.mjs](https://skilld.dev/api/skills-raw/openclaw/agent-skills/agent-transcript/scripts/agent-transcript.test.mjs).
>
> If the user asked to install this Skill, run `npx skilld install openclaw/agent-skills/agent-transcript`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/agent-transcript`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/openclaw/agent-skills/agent-transcript) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/agent-transcript`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/agent-transcript --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/agent-transcript --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Agent Transcript

Use only when the user explicitly requests a transcript or preview. Omit by
default; never offer one or ask whether to include one during ordinary PR work.
A preview request alone does not authorize publication.

For a session hosted at `*.openclaw.ai`, use native session sharing when sharing
is requested; export a separate transcript only when the user explicitly asks
for that copy. Identify hosting from the current session URL, not a repository
URL or deployment/test target. Do not offer separate exports.

## Prepare Locally

Default file discovery/rendering reads local Codex, Claude, Pi, and OpenClaw
logs without network calls. Never upload raw logs.

Resolve `TRANSCRIPT_SKILL_DIR` to the directory containing this `SKILL.md`.
Invoke that installation without changing the consumer's working directory.

```bash
"$TRANSCRIPT_SKILL_DIR/scripts/agent-transcript" find \
  --query "$PR_TITLE $BRANCH_OR_PR_URL" --cwd "$PWD" --since-days 14
"$TRANSCRIPT_SKILL_DIR/scripts/agent-transcript" render \
  --session "$SESSION_JSONL" --out /tmp/agent-transcript.md
```

`find` scans the newest 400 matching logs by default; `--max-files N` widens
local discovery. Treat matches as candidates, not proof of scope.
`find` and `html` count up to 20,000 JSONL files across all roots, including old
files, and fail when another exceeds the cap. `--max-discovery-files N` accepts
a positive integer override; prefer narrowing roots before raising it.

File rendering reads at most 8 MiB per session from its head and tail and parses
at most 12,000 lines. `--max-read-bytes N` changes the byte limit. Preserve the
visible partial-transcript notice and `sourceTruncated` stats through trimming,
preview, and insertion; omitted source must never be described as complete.
These are file-read limits, not limits on the separate app-server rendering mode.
Short filesystem reads are retried. Unexpected EOF stops rendering or discovery
instead of treating incomplete input as a complete session.

Automatically trim the rendered Markdown **before showing, previewing, or
inserting it**. Keep only task-relevant user prompts, visible decisions, terse
tool summaries, and proof outcomes. Use the PR/issue goal, branch, and changed
files to remove unrelated earlier/later turns. Drop system/developer prompts,
reasoning, raw tool output, environment data, local paths, credentials,
browser/session/cookie details, and auth URLs. Inspect the trimmed result;
helper redaction is not sufficient disclosure review. Unresolved sensitive
content means omit the transcript.

## Preview And Insert

Show the trimmed Markdown for a requested preview. If HTML is requested, build
the local preview from that trimmed content. The helper's `preview`, `html`, and
`append-body` modes render the session again; they do not consume an edited
Markdown file and can reintroduce removed turns. Do not use their untrimmed
output as the approved artifact.

Insert only the inspected, scoped text when the user's authorization specifically
covers publishing that transcript to the named PR/issue. Generating or previewing
a transcript does not authorize publication, even when ordinary PR creation or
editing is already approved. If that scope is missing, show the trimmed result
and obtain publication authorization before insertion. Existing explicit
authorization covering transcript publication needs no repeat confirmation.
Keep the collapsed `<details>` section and replace existing transcript markers
instead of duplicating them. No safe match means continue the PR work without
transcript or placeholder; explain the omission when it prevents the explicitly
requested transcript. Do not promote transcript inclusion as a review priority
requirement.

## Validate Helper Changes

```bash
node --test skills/agent-transcript/scripts/agent-transcript.test.mjs
```

For a downstream `.agents/skills` copy, run that test command from `.agents/`
so the test's relative helper path resolves. Use synthetic logs and isolated
discovery roots; never discover real user logs just to validate this skill.
