This commit is contained in:
Shayan Rais
2026-04-26 17:13:50 +05:00
parent eabba864a9
commit 9437efe323
2 changed files with 14 additions and 3 deletions
+13 -1
View File
@@ -419,7 +419,7 @@ Claude Code provides these environment variables to hook scripts:
| Variable | Availability | Description |
|----------|-------------|-------------|
| `$CLAUDE_PROJECT_DIR` | All hooks | Project root directory. Wrap in quotes for paths with spaces |
| `$CLAUDE_ENV_FILE` | SessionStart, CwdChanged, FileChanged | File path for persisting environment variables for subsequent Bash commands. Use append (`>>`) to preserve variables from other hooks |
| `$CLAUDE_ENV_FILE` | SessionStart, CwdChanged, FileChanged | File path for persisting environment variables for subsequent Bash commands. Use append (`>>`) to preserve variables from other hooks. **Windows fix (v2.1.111):** `CLAUDE_ENV_FILE` and SessionStart hook environment files now apply on Windows (prior to v2.1.111, this was a silent no-op on Windows) |
| `${CLAUDE_PLUGIN_ROOT}` | Plugin hooks | Plugin's root directory, for scripts bundled with a plugin |
| `$CLAUDE_CODE_REMOTE` | All hooks | Set to `"true"` in remote web environments, not set in local CLI |
| `${CLAUDE_SKILL_DIR}` | Skill hooks | Skill's own directory, for scripts bundled with a skill (since v2.1.69) |
@@ -534,6 +534,18 @@ When a `PreToolUse` hook matches `AskUserQuestion`, it can return `updatedInput`
This is useful for CI/CD pipelines, automated testing, or any context where Claude Code runs without a human at the terminal. Not yet in official docs pages — sourced from GitHub changelog v2.1.85.
### PreToolUse `additionalContext` Now Preserved on Tool Failure (v2.1.110)
Prior to v2.1.110, any `additionalContext` returned by a `PreToolUse` hook was **silently dropped** if the tool itself subsequently failed. As of v2.1.110, `additionalContext` from `PreToolUse` is preserved and surfaced to the model even when the matched tool call fails — so hook-provided context reaches the model consistently regardless of tool outcome.
This does not affect this project since `hooks.py` does not return `additionalContext`.
### PermissionRequest `updatedInput` Re-Checked Against Deny Rules (v2.1.102, v2.1.110)
When a `PermissionRequest` hook returns `hookSpecificOutput.updatedInput` to rewrite the tool input, that rewritten input is now re-evaluated against permission deny rules. Prior to v2.1.102 / v2.1.110 (two related fixes), a hook could return `updatedInput` that bypassed configured deny rules — a security-relevant edge case.
This does not affect this project since `hooks.py` does not use decision control or `updatedInput`.
### PreToolUse Decision Control Deprecation
The `PreToolUse` hook previously used top-level `decision` and `reason` fields for blocking tool calls. These are now **deprecated**. Use `hookSpecificOutput.permissionDecision` and `hookSpecificOutput.permissionDecisionReason` instead:
@@ -590,7 +590,7 @@
</div>
<div class="trigger-box" style="margin: 0;">
<h4>GPT-5.5 &mdash; OpenAI</h4>
<p style="margin: 0 0 4px;">Knowledge cut-off: <strong>August 2025*</strong></p>
<p style="margin: 0 0 4px;">Knowledge cut-off: <strong>December 1, 2025</strong></p>
<p style="font-size: 0.82rem; color: #666; margin: 0;">Released 2026-04-23 &mdash; brand-new, but still has a cut-off.</p>
</div>
<div class="trigger-box" style="margin: 0;">
@@ -599,7 +599,6 @@
<p style="font-size: 0.82rem; color: #666; margin: 0;">Released 2026-02-19</p>
</div>
</div>
<p style="font-size: 0.7rem; color: #aaa; font-style: italic; margin: 10px 0 0;">*OpenAI has not officially published GPT-5.5&rsquo;s cutoff; shown value is the published cutoff of GPT-5.4 (released 6 weeks earlier), used as best-available proxy.</p>
</div>
<!-- ============================================================ -->