{"version":"2.1.299","anchor":"hook-if-condition-with-a-file-path-gives-a-message-when-th","canonical_anchor":"hook-if-condition-with-a-file-path-gives-a-message-when-th","heading":"Clear message when a hook condition names a file but there is no folder","tier":"notice","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299\/e\/hook-if-condition-with-a-file-path-gives-a-message-when-th","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299","markdown":"### Clear message when a hook condition names a file but there is no folder\n\nA hook \"if\" condition that names a file path now gives a message instead of an error when the session has no working directory\n\n**What**\n\nA hook is a command you set up to run automatically at certain moments, and its \"if\" condition limits when it applies. If that condition names a file path but the session has no working directory, the folder Claude Code is working in, Claude Code now gives this message instead of failing with an error: \"A hook's \"if\" condition names a file path, which can't be checked because this session has no working directory.\"\n\n**Why**\n\nSessions with no working folder, such as ones run without a screen or remotely, now fail gently and explain why.\n\n- Area: Hooks\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}