Claude Code Silently Appends Session URLs to Commit Messages and Pull Requests
Claude Code automatically appends session URLs to git commit messages and pull request descriptions without user prompt or onboarding notice. Developers are finding unexpected links cluttering commit histories, but the behavior can be disabled via a configuration setting.

Impact: Medium
Why it matters
You can prevent Claude Code from leaking session links into public git commits by updating your settings configuration.
TL;DR
- 01Claude Code adds session URLs to all commits and PRs by default without notice.
- 02Set attribution.commit to an empty string in .claude/settings.json to disable it.
- 03Git commit-msg hooks offer an alternative way to sanitize commits across projects.
Key facts
- Affected Tool
- Claude Code
- Default Behavior
- Appends session URL to commits and PRs
- Suppression Setting
- attribution.commit: "" in .claude/settings.json
Automatic Session Tracking in Git Commits
Claude Code automatically appends a session URL (such as https://claude.ai/code/session_...) to the bottom of every commit message and PR description it generates. This attribution occurs by default without any onboarding warning or confirmation prompt.
Disabling Session Attribution
To prevent session URLs from appearing in your commit history, update your .claude/settings.json file to explicitly suppress commit attribution. You can also implement a git commit-msg hook to sanitize commit messages before they are finalized.
Try it in 2 minutes
{
"attribution.commit": ""
}json
✓ When to use
- When you want clean git commit histories free of automated session metadata links
- When committing to public repositories or client codebases where internal session URLs should not be exposed
✕ When NOT to use
- When your team relies on session URL attribution for auditing and session log persistence
What to do today
- Open .claude/settings.json in your repository or home directory.
- Add "attribution.commit": "" to prevent session URLs from leaking into git logs.
What the community says
“My spade is a meaningful part of digging a hole when I plant a tree, but I still don't want a "Spear and Jackson" sign on my tree when I'm done.”
“Do you also add all of your notes ever recorded to your PRs?”
Sources