{"version":"2.1.287","anchor":"hook-runner-can-start-outside-the-project-directory","canonical_anchor":"hook-runner-can-start-outside-the-project-directory","heading":"Hooks can run from a folder outside the project, without picking up parent git repos","tier":"notice","area":"Hooks","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.287\/e\/hook-runner-can-start-outside-the-project-directory","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.287","markdown":"### Hooks can run from a folder outside the project, without picking up parent git repos\n\nHook commands can now start from a folder outside the project, with git kept from finding repositories above that folder\n\n**Unclear.** It is not clear what sets the different starting folder for a hook.\n\n**What**\n\nHooks are your own commands that Claude Code runs automatically at certain moments, such as before or after a tool runs. Hook commands always used to start in the project folder. They can now be given a different starting folder, and the hook is then marked as starting outside the project.\n\nWhen this happens, Claude Code sets `GIT_CEILING_DIRECTORIES` to that folder. This environment variable tells git where to stop looking upward. Git commands in the hook therefore do not find and use a repository in a parent folder.\n\n**Why**\n\nIt is a safety measure. A hook running outside your project will not act on an unrelated git repository that happens to sit above it.\n\n- Area: Hooks\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5"}