Claude Skill

copy-transcript-path

Copy the active Claude Code or Codex CLI chat transcript path to the macOS clipboard.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download paulrberg-agent-skills-skills_copy-transcript-path-913232a.zip · 1 KB
Part of paulrberg/agent-skills — 42 skills

Install

skills CLI npx skills add https://github.com/PaulRBerg/agent-skills/tree/main/skills/copy-transcript-path
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install paulrberg-agent-skills@llmmart
Git git clone https://github.com/PaulRBerg/agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole paulrberg/agent-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Copy Transcript Path

Copy the active chat's transcript path to the clipboard.

This skill is coordination-exempt: skip the ai-coord gate for its declared work.

Supported Chat Hosts

Before doing any work, identify the current chat host. If it is not Claude Code or Codex CLI, stop with this error: This skill only works in Claude Code or Codex CLI.

Workflow

Resolve scripts/copy-transcript-path.sh relative to this SKILL.md and run it with no arguments:

bash <skill-dir>/scripts/copy-transcript-path.sh

Return the helper's successful stdout verbatim and stop. Do not infer a transcript from the current project, select a recent session, or add explanation.

Successful completion requires the helper to exit 0 and its stdout to be returned verbatim. Report a helper failure as the outcome; it does not count as completion.

Files (agent-skills)
  • agents
    • openai.yaml 43 B
      policy:
        allow_implicit_invocation: false
      
  • scripts
    • copy-transcript-path.sh 2.1 KB
      #!/bin/bash
      
      set -euo pipefail
      
      unsupported_host_error='This skill only works in Claude Code or Codex CLI.'
      
      die() {
        printf 'copy-transcript-path: %s\n' "$*" >&2
        exit 1
      }
      
      is_uuid() {
        [[ "$1" =~ ^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$ ]]
      }
      
      resolve_single_transcript() {
        local search_root=$1
        local file_name=$2
        local candidate
      
        [ -d "$search_root" ] || die "transcript storage is unavailable: $search_root"
      
        transcript_paths=()
        while IFS= read -r -d '' candidate; do
          transcript_paths+=("$candidate")
        done < <(find "$search_root" -type f -name "$file_name" -print0)
      
        case ${#transcript_paths[@]} in
          0) die 'current transcript was not found' ;;
          1) ;;
          *) die "found ${#transcript_paths[@]} current transcript files" ;;
        esac
      }
      
      codex_session_id=${CODEX_THREAD_ID:-}
      claude_session_id=${CLAUDE_CODE_SESSION_ID:-}
      
      if [ -n "$codex_session_id" ] && [ -n "$claude_session_id" ]; then
        die 'current chat host is ambiguous'
      fi
      
      if [ -n "$codex_session_id" ]; then
        is_uuid "$codex_session_id" || die 'invalid Codex session identifier'
        codex_home=${CODEX_HOME:-"$HOME/.codex"}
        resolve_single_transcript "$codex_home/sessions" "rollout-*-$codex_session_id.jsonl"
      elif [ -n "$claude_session_id" ]; then
        is_uuid "$claude_session_id" || die 'invalid Claude Code session identifier'
        claude_home=${CLAUDE_CONFIG_DIR:-${CLAUDE_HOME:-"$HOME/.claude"}}
        resolve_single_transcript "$claude_home/projects" "$claude_session_id.jsonl"
      else
        die "$unsupported_host_error"
      fi
      
      transcript_dir=$(cd "$(dirname "${transcript_paths[0]}")" && pwd -P) || die 'cannot resolve transcript directory'
      transcript_path=$transcript_dir/$(basename "${transcript_paths[0]}")
      home_dir=$(cd "$HOME" && pwd -P) || die 'cannot resolve home directory'
      
      case $transcript_path in
        "$home_dir"/*) display_path="~${transcript_path#"$home_dir"}" ;;
        *) display_path=$transcript_path ;;
      esac
      
      pbcopy_bin=${COPY_TRANSCRIPT_PATH_PBCOPY:-/usr/bin/pbcopy}
      [ -x "$pbcopy_bin" ] || die "required executable is unavailable: $pbcopy_bin"
      printf '%s' "$display_path" | "$pbcopy_bin" || die 'clipboard copy failed'
      printf 'Copied: %s\n' "$display_path"
      
  • SKILL.md 1.2 KB
    ---
    compatibility: Requires macOS /usr/bin/pbcopy and local Claude Code or Codex CLI transcript storage.
    coordination: exempt
    disable-model-invocation: true
    metadata:
      install-targets: claude-code codex
    name: copy-transcript-path
    description: Copy the active Claude Code or Codex CLI chat transcript path to the macOS clipboard.
    ---
    
    # Copy Transcript Path
    
    Copy the active chat's transcript path to the clipboard.
    
    This skill is coordination-exempt: skip the ai-coord gate for its declared work.
    
    ## Supported Chat Hosts
    
    Before doing any work, identify the current chat host. If it is not Claude Code or Codex CLI, stop with this error:
    `This skill only works in Claude Code or Codex CLI.`
    
    ## Workflow
    
    Resolve `scripts/copy-transcript-path.sh` relative to this `SKILL.md` and run it with no arguments:
    
    ```sh
    bash <skill-dir>/scripts/copy-transcript-path.sh
    ```
    
    Return the helper's successful stdout verbatim and stop. Do not infer a transcript from the current project, select a
    recent session, or add explanation.
    
    Successful completion requires the helper to exit 0 and its stdout to be returned verbatim. Report a helper failure as
    the outcome; it does not count as completion.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related