# Claude Code Put a Session Link in Git History. Taking It Out Rewrites History.

**Summary:** Claude Code adds session links by default to cloud and Remote Control commits and pull requests. I would keep the audit trail, but let each repository choose it before publication.

- Canonical: https://markhuang.ai/news/claude-session-link-rewrites-history
- Language: en
- Author: [Mark Huang](https://markhuang.ai/about)
- Published: 2026-08-30
- Section: News
- Tags: Claude Code, Git, AI Attribution, Developer Tools, Product Design
- Source: [GitHub Issue](https://github.com/anthropics/claude-code/issues/66504)
- License: https://creativecommons.org/licenses/by-nc/4.0/

---

![A glowing session link fused into a branching line of glass commit tiles and connected to a pull request card](https://cdn.markhuang.ai/news/claude-session-link-rewrites-history/hero.webp)

*A session link can be a useful trail. Once it lands in a pushed commit, though, removing it is a history change.*

A [Claude Code feature request opened on June 9, 2026](https://github.com/anthropics/claude-code/issues/66504) objects to session URLs appearing in commit messages and pull request descriptions without an opt-in prompt. An Anthropic collaborator later clarified that the behavior applies to web and Remote Control sessions, then closed the issue on August 17 because an off switch exists. The dispute is not whether a session link can help. It is over who decides that the link belongs in a repository.

My answer is the repository owner. Claude Code's current [settings reference](https://code.claude.com/docs/en/settings-reference#attribution-sessionurl) says `attribution.sessionUrl` defaults to `true` for cloud and Remote Control commits and pull requests. Setting it to `false` removes the session link, while commit and pull request attribution remain separately configurable. That gives control to anyone who knows where to look. It does not ask for consent when the agent writes the metadata.

A pull request description is easy to edit. A pushed commit message is not. I think Claude Code has paired a defensible provenance feature with the wrong default.

## The link has a real job

There is a practical case for the feature: session links can help explain how a change was produced. In the [Hacker News discussion](https://news.ycombinator.com/item?id=49498201), some developers said they value the link as an audit trail or as a way to recover the reasoning behind an old commit. Others liked attribution but still wanted the product to ask first. Reaction is split on the feature's value, even if the issue thread itself is mostly hostile to the default.

I see the appeal. A code diff records the result, not the abandoned approaches, constraints, or human corrections that led there. When a regression appears months later, that missing context can save time. A session URL can connect the artifact to a fuller record without stuffing the whole transcript into Git.

But that trail is vendor-specific. A team may prefer a ticket, an architecture decision record, a review note, or no conversational record at all. The repository may also have retention and access rules that do not match the session service. I cannot tell from the public issue who can open any particular session URL, and a URL by itself does not prove that a transcript is public. The project should choose because the reference lands in its history.

## The off switch came later

Anthropic's public [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) records the sequence. Version 2.1.9 added session URL attribution to commits and pull requests created from web sessions. Version 2.1.183 added `attribution.sessionUrl` so users could omit that link from web and Remote Control output.

The sequence explains some of the frustration. The link appeared first; the policy control followed. The issue reporter proposed an onboarding choice or a first-commit prompt. After the maintainer pointed to the setting, the reporter asked for an account-level option, a command, a prompt, or a different default. The issue remained closed as completed.

A JSON setting works once someone finds it. It does not warn a user before the first affected commit or settle which choice a team wants. I would rather see the first web or Remote Control commit pause once and offer three plain choices: keep the session link, keep only the ordinary attribution, or add neither. The repository should display the selected policy, and organizations should be able to manage it.

## Commit messages are an expensive place to surprise people

GitHub's documentation on [changing a commit message](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message) says the edit creates a new commit ID. If the commit has already been pushed, removing the line requires rewriting history and force pushing. GitHub warns that this can disrupt collaborators. It also says force pushing may not remove an old commit that contained sensitive information from GitHub.

That does not make every session URL sensitive. The placement is the problem. A default that touches a draft can be corrected cheaply. A default that becomes part of a commit should pass a higher bar because cleanup can change hashes, invalidate references, and interfere with work based on the old history.

> **Info:**
>
> My rule for agent-written Git metadata is simple: show the exact commit message and pull request description before publication, and ask once before adding a new class of attribution or external link.

This is also why I separate provenance from authorship. A `Co-Authored-By` trailer, a session link, and responsibility for the merged code answer different questions. I made a similar distinction when writing about [Claude's proposed text watermark](https://markhuang.ai/news/claude-watermark-can-flag-claude-not-settle-authorship): a provenance signal can show that a tool influenced an artifact without deciding who owns the ideas or accepts the result.

## I would keep the link and change who chooses it

I do not want Claude Code to remove session links as an option. For teams that use the transcript during review or debugging, the link may be worth keeping. I want the product to treat that preference as repository policy, not a surprise attached by the environment that happened to create the commit.

I would default the session URL off, ask at the first relevant publish action, and let organizations set a managed policy. Ordinary AI attribution should remain separate, so a team can disclose tool involvement without binding its Git history to a vendor-hosted conversation.

Claude Code issue #66504 was closed because users can turn the link off. I think that answers the configuration question but misses the product question. When an agent is about to write something that lasts, the project should choose the trail it agrees to keep.
