{"version":"2.1.280","anchor":"claude-edit-hook-refuses-to-run-when-spawned-inside-a-claude","canonical_anchor":"claude-edit-hook-refuses-to-run-when-spawned-inside-a-claude","heading":"claude edit-hook refuses to run when spawned inside a Claude Code session","tier":"internal","area":"VSCode Extension","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280\/e\/claude-edit-hook-refuses-to-run-when-spawned-inside-a-claude","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280","markdown":"### claude edit-hook refuses to run when spawned inside a Claude Code session\n\nThe 'claude edit-hook' command now refuses to run from inside another Claude Code session\n\n**What**\n\nThe `claude edit-hook` command, used internally by the VS Code extension to apply a single JSON-formatted edit read from standard input, now checks the `CLAUDE_CODE_CHILD_SESSION` environment variable. If that variable is set, meaning the command was spawned by Claude Code itself rather than run directly, it logs a telemetry event and returns a refusal message instead of reading and applying the edit.\n\n**Why**\n\nThis stops `claude edit-hook` from being triggered accidentally from within a nested Claude Code process, which could otherwise apply unintended edits.\n\n- Area: VSCode Extension\n- Names: `CLAUDE_CODE_CHILD_SESSION`\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}