Stackmark › Prompts

Auto-load git context at session start

A `SessionStart` hook can dump `git status` to a known file so Claude always knows your branch and uncommitted changes without you typing it.

  • Type: Prompt
  • Tags: Coding Agent Hacks, Intermediate, Claude Code
  • Updated: 2026-10-01

Prompt

A `SessionStart` hook can dump `git status` to a known file so Claude always knows your branch and uncommitted changes without you typing it. Claude Code loads CLAUDE.md but doesn't know what branch you're on or what's changed since the last session. You end up typing 'check git status' every time. A `SessionStart` hook fixes this once: it captures git state on session start and on `/clear`, so you can dive straight into work. Implementation example: // .claude/settings.json { "hooks": { "SessionStart": [{ "hooks": [{ "type": "command", "command": "git status > /tmp/claude-git-context.txt && echo 'Development context loaded'" }] }] } }

More prompts

Privacy · Terms · llms.txt