Skip to content

feat(claude): inject GitHub username into SessionStart#189

Merged
Cain96 merged 1 commit into
mainfrom
feat/inject-github-username-hook
May 26, 2026
Merged

feat(claude): inject GitHub username into SessionStart#189
Cain96 merged 1 commit into
mainfrom
feat/inject-github-username-hook

Conversation

@Cain96

@Cain96 Cain96 commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a SessionStart hook that emits the active GitHub login from gh auth status so Claude Code knows whose account is in use.
  • Register the new hook alongside the existing inject-datetime.sh in dot_config/claude/settings.json.

Changes

  • dot_config/claude/hooks/executable_inject-github-username.sh: new script. Reads gh auth status --json hosts --jq '.hosts."github.com"[] | select(.active == true) | .login' and prints My GitHub username is <login>.. Exits silently when gh is unavailable or no active login is found, so CI / fresh shells are unaffected.
  • dot_config/claude/settings.json: append the new hook entry under hooks.SessionStart[*].hooks.

Test plan

  • Ran the script locally and confirmed it prints My GitHub username is Cain96.
  • Verified gh auth status --json hosts --jq '.hosts' returns the expected structure.
  • Reload Claude Code and confirm the SessionStart message includes the username.

Reads the active login from `gh auth status --json hosts` and emits
`My GitHub username is <login>.` so Claude Code knows whose account
is in use. Skips silently when `gh` is unavailable or not authenticated.

🤖 Generated with Claude Code
@Cain96 Cain96 self-assigned this May 26, 2026
@Cain96 Cain96 enabled auto-merge May 26, 2026 15:23
@Cain96 Cain96 merged commit 7da4d9d into main May 26, 2026
3 checks passed
@Cain96 Cain96 deleted the feat/inject-github-username-hook branch May 26, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant