So, I see conflicting information/opinions on the Internet about whether Claude ...

@kfogel@kfogel.org

So, I see conflicting information/opinions on the Internet about whether Claude session IDs should be considered sensitive data or not. Specifically, Gemini and Claude themselves disagree on this! Claude says they're not sensitive, it's fine to publish them, etc. Gemini, on the other hand, practically sets its hair on fire in alarm about the very idea. Who's right? Normally I would assume Claude is authoritative on this question, but... well, perhaps some humans here have done some deeper thinking on this.

What Claude says:

❯ Are Claude session IDs sensitive data?  Is there any reason not to publish    
  them publicly, for example in a commit message or even in documentation in a  
  public source code tree?                                                      

● As far as I know, no: a Claude Code session ID isn't a secret. There are a few
  caveats below. I'm answering from general knowledge of how Claude Code works
  and haven't checked current Anthropic documentation, so look there if you need
  an authoritative statement.

  Why it's generally fine:

  - It's an identifier, not a credential. A local session ID is a random UUID
    that names a transcript file, e.g.
    ~/.claude/projects/<project-dir>/<session-id>.jsonl. Knowing the ID gives
    nobody access to that file. claude --resume <id> only works on a machine
    that already has the transcript.
  - It doesn't reveal anything by itself. It's a random v4 UUID, so it carries
    no timestamp, username or machine information.
  - Cloud sessions are still protected by your account. Sessions on
    claude.ai/code have URLs with an ID in them, but opening one requires being
    logged in as someone allowed to see it. The ID alone doesn't get anyone in.

  Caveats:

  1. The transcript is the sensitive part. It can contain file contents, command
     output, environment variables and secrets you pasted. Publishing the ID is
     fine. Publishing the .jsonl file needs a careful review first.
  2. Sharing settings on cloud sessions. If you ever make a cloud session
     viewable by link or by your organization, then its URL really is a way in.
     Check the sharing state of any session whose URL you post.
  3. It shows up elsewhere. Session IDs appear in feedback and bug reports, so a
     published ID could be matched to a report you filed. That's not a real
     risk, but it is a link between the two.
  4. It's of limited use to readers. In a public commit message or in docs,
     nobody else can look the session up. It mainly helps you, or someone with
     access to your machine or account, trace which session produced a change.
     That's a perfectly good reason to include it. Just don't expect it to tell
     outside readers anything. If provenance matters to them, a short note on
     what the session did is worth more than the ID.

  So putting session IDs in commit messages or docs in a public tree is fine.
  Just keep the transcripts themselves private, and don't make a cloud session's
  link public unless you've checked who can open it.

What Gemini says in response to the exact same question:

Yes, Claude session IDs and session URLs are sensitive data, and you
should never publish them publicly in commit messages, documentation,
or public source code trees.

Why Claude Session IDs are Sensitive

1. Bypassing Authentication and MFA: Stolen or leaked active session
   tokens can allow malicious actors to hijack your account, bypassing
   multi-factor authentication (MFA) and passwords
   entirely. Infostealer malware campaigns have specifically targeted
   active Claude sessions to compromise paid accounts.

2. Financial and Credit Drain: Attackers who obtain a leaked session
   key or session URL can mint unauthorized OAuth tokens to siphoning
   your paid AI tier capacity or API credits, which can quietly burn
   through expensive token allowances without your knowledge.

3. Information and Privacy Exposure: A session identifier maps
   directly to your workspace history and configuration. Publishing it
   creates an unnecessary information disclosure vector, revealing
   unique identifiers like user or organization UUIDs, app versions,
   and environment telemetry to the public.

The Git Commit Controversy

This concern is highly relevant because users of the Claude Code CLI
tool encountered issues where Claude Code inadvertently appended
session URLs (claude.ai/code/session_[id]) to default git commit
messages and PR descriptions. Critics and security experts heavily
penalized this default behavior due to data minimization guidelines
and privacy leak risks.

  Sources (adjusted & with commentary commentary from me):

    - https://news.ycombinator.com/item?id=49498201

    - https://github.com/anthropics/claude-code/issues/66504
      (Seems to have most of the interesting commentary on this.  See also #40733 and #66504.)