A small, global Git hook installer that runs the project-context skill after meaningful commits. It generates/updates:
docs/project_notes/operating_brief.mddocs/project_notes/key_facts.mddocs/project_notes/adrs.mddocs/project_notes/bugs.mddocs/project_notes/worklog.mdAGENTS.md(andCLAUDE.mdif present)
Notes are maintained automatically by a post-commit maintainer and auto-committed with a docs: message.
context-hook.ps1— main entry point (install/uninstall/run/test)context-hook.cmd— convenience wrapper for WindowsREADME.md— this file
gitpwsh(PowerShell 7+) or Windows PowerShellcodexCLI available on PATH (or setCODEX_BIN)project-contextskill installed atC:\Users\Jordan\.codex\skills\project-context
From any repo root:
context-hook installThis will:
- create
.githooks/ - generate
.githooks/post-commit+.githooks/post-commit.ps1 - set
core.hooksPathto.githooks
context-hook install
context-hook uninstall
context-hook run
context-hook testinstallgenerates the hook in the current repouninstallremoves the hook and unsetscore.hooksPath(if it was.githooks)runruns the maintainer manually for the current repotestinstalls and validates the generated hook
CODEX_BIN— explicit path tocodex.cmdCODE_HOME— Codex home directory (for skills/config)MAINTAINER_SKIP=1— skip maintainer on this commitMAINTAINER_ASYNC=0— force synchronous mode (default is async)MAINTAINER_HOOK_ECHO=1— echo hook logs to stdout
The hook skips when:
- commit subject contains
[skip maintainer] - subject is
... - subject starts with
docs:ornotes: - subject starts with
chore:,ci:,style:,refactor:,test:(including scoped variants) - subject indicates a release or version bump
- subject indicates dependabot/renovate
- merge commits
- changes only touch
.githooks/ - changes only touch
docs/project_notes/and/orAGENTS.md/CLAUDE.md - changes only touch lockfiles
- changes are only
.mdfiles outsidedocs/project_notes/
After the maintainer runs, it will stage only the seven note files and commit them with:
docs: update project notes
That commit is auto-skipped by the rules above.
- Logs are written to
.git/maintainer-hook.login the target repo. - If Codex is not found, ensure
codex.cmdis on PATH or setCODEX_BIN. - If the hook appears stuck, delete
.git/maintainer-hook.lockin the repo.
- This tool is Windows-first (PowerShell). The generated
post-commitshim usespwshwhen available. - The maintainer is conservative by default; it may choose to leave notes unchanged if changes are not significant.