Claude Session URL appended to commit messages and PR descriptions by default
TL;DR Highlight
Claude Code adds session URLs to commits and PRs by default, and users want it opt-in
Who Should Read
A developer surprised to find claude.ai session links in git commits and PRs created with Claude Code
Core Mechanics
- Session links land at the bottom of commits and PRs
- Claude Code automatically appends a https://claude.ai/code/session_... link to commit messages and PR descriptions.
- The issue author says there was no onboarding prompt or warning.
- The ask was to make it opt-in
- Proposals include a one-time onboarding prompt or a first-commit prompt with a "don't add this again" option.
- Another alternative was to drop the link and keep only the Co-Authored-By trailer.
- There is a setting to turn it off
- Put "sessionUrl": false under attribution in ~/.claude/settings.json to drop the link.
- This keeps the Co-Authored-By trailer intact.
- attribution.commit set to empty did not work
- The issue and one commenter reported that attribution.commit = "" alone did not remove the link.
- A commenter suggested the CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION=1 environment variable.
Community Reactions
- Some want the link on by default
- One commenter sees coworkers' PRs with session links and says they can still control who can view the session.
- Another wrote a script early on to append session IDs to commits, and says it helps when debugging old commits.
- Linkrot worries
- One commenter doubts these links will still work in 30 years.
- Another prefers linking to an open format stored in the repo, since git should be self-contained.
- The problem is the rollout, not the feature
- One commenter says it's a good default for new users but should not have been turned on for existing users without a prompt.
- Another says Anthropic often ships default-on features via auto-update, so they are considering switching harnesses.
- A concrete way to turn it off
- One commenter says the env variable was added in CC 2.1.202 on July 8, 2026.
- They also added a rule to ~/.claude/CLAUDE.md saying never to add Co-Authored-By or any reference to Claude in commits, and it works.
How to Apply
- Add sessionUrl false to settings.json
- Open ~/.claude/settings.json today and add "sessionUrl": false under attribution.
- Set commit and pr to empty strings too if you want those texts gone.
- If it still appears, set CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION to "1" under env.
- Commit the setting in repos used via web or Remote Control
- Web sessions don't keep your home settings, so commit the same attribution block in the repo's .claude/settings.json.
- Add this file to your new-repo template.
- Review the commit message before pushing
- Tell Claude to draft a commit message and not commit until you review it.
- Before pushing, run git log -1 --format=%B and check the last lines for a Claude-Session trailer.
- Write your attribution rules in CLAUDE.md
- Spell out in the project CLAUDE.md how AI involvement should be marked, such as whether links are allowed or an Assisted-by line.
- Include the exact format for anything you want recorded instead of the session link.
Try It
# Paste into the Claude Code terminal (settings check prompt)
Read ~/.claude/settings.json and this repo's .claude/settings.json.
Check whether attribution.sessionUrl is set to false in both.
If not, propose merging the block below without deleting existing settings. Do not modify any file until I approve.
{ "attribution": { "commit": "", "pr": "", "sessionUrl": false } }
Also use git log to check whether the last 5 commit messages end with a Claude-Session trailer or a claude.ai/code/session_ link, and tell me.
Next to try: after changing settings, make a test commit and verify the link is gone. If not, add CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION=1 under env and retry.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.