[Feature Request] Make transcript path more globally available to bash commands

Resolved 💬 7 comments Opened Aug 11, 2025 by openclosure Closed Feb 5, 2026

Driving use case here is that slash commands would be more useful if downstream commands they executed could more easily learn about the session they were called from. This is easily done with hooks since they receive transcript_path, but slash commands have nothing similar, resulting in the need for an awkward hack like this:

    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.transcript_path' > \"/Users/<user>/.claude/tmp_transcript_path\"
          }
        ]
      }
    ],

This generically allows bash commands to read the session, since they can refer to tmp_transcript_path. But it's annoying to have to set this up.

I would propose a simple CLAUDE_TRANSCRIPT_PATH environment variable that is set for the session that bash commands can read from.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗