原文(日本語に翻訳)
出力中の owner/repo#N 形式の短縮リンクが、常にgithub.comを指す代わりに、gitリモートのホストを使うようになった
原文(英語)
owner/repo#N shorthand links in output now use your git remote's host instead of always pointing at github.com
概要
Claude Codeの出力に含まれる owner/repo#N 形式のショートハンドリンク(例:anthropics/claude-code#123)が、常にgithub.comを使うのではなく、実際のgitリモートのホスト名を使うようになった。GitHub Enterprise、GitLab、Bitbucketなどを使用するユーザーが正しいURLでリンクを参照できるようになる。
基本的な使い方
この改善は自動的に適用される。gitリモートが設定されているリポジトリで作業する際、Claude Codeの出力に含まれるリンクが正しいホストを指すようになる。
以前の動作:
関連するIssue: owner/repo#123
→ https://github.com/owner/repo/issues/123 (常にgithub.com)今後の動作:
関連するIssue: owner/repo#123
→ https://gitlab.company.com/owner/repo/-/issues/123 (gitリモートのホスト)実践例
GitHub Enterprise環境での使用
bash
# gitリモートがGitHub Enterpriseを指している場合
git remote -v
# origin https://github.corp.example.com/team/project.git (fetch)
# Claude Codeの出力に含まれるリンクが正しいホストを使う
# team/project#42 → https://github.corp.example.com/team/project/pull/42GitLab環境での使用
bash
# gitリモートがGitLabを指している場合
git remote -v
# origin https://gitlab.example.com/engineering/backend.git (fetch)
# engineering/backend#15 → https://gitlab.example.com/engineering/backend/-/merge_requests/15複数リモートがある場合
複数のリモートが設定されている場合、origin が優先的に使用される:
bash
git remote -v
# origin https://github.enterprise.com/team/app.git (fetch)
# upstream https://github.com/opensource/app.git (fetch)
# リンクには origin のホスト(github.enterprise.com)が使われる注意点
- gitリモートが設定されていない場合はgithub.comがフォールバックとして使用される
originリモートが優先的に参照される- この機能はClaude Codeの出力のテキストリンクにのみ影響し、実際のgit操作には影響しない
- ホスト名の検出はgitリモートURLの自動解析によって行われる