surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| @@ -310,14 +310,34 @@ | ||
| 310 | 310 | the plugins admitted so far, this one first: a pinned variable is |
| 311 | 311 | refused to a person's `plugin.register` hook then as at any later time. |
| 312 | 312 | - What this does not reach: a variable that managed `env` does not set and |
| 313 | - that is not among those names is a person's plugin's to write, and every | |
| 314 | - child the engine starts, a managed | |
| 315 | - hook's command among them, starts from the environment as written. A | |
| 316 | - person already decides the environment Claude Code starts in (`PATH`, | |
| 313 | + that is not among those names is a person's plugin's to write, and the | |
| 314 | + children the engine starts afterwards (Bash, an MCP server, `$.process.run`, | |
| 315 | + a person's own hook) start from the environment as written. | |
| 316 | +- A hook the organization defines is the exception: one in managed settings, | |
| 317 | + one of a plugin managed settings install, and the managed status line and | |
| 318 | + file suggestion commands. A plugin counts as one managed settings install | |
| 319 | + only when it is read in place from a folder those settings name; a plugin | |
| 320 | + they merely enable by id, loaded from a copy on the person's machine (a | |
| 321 | + marketplace download, or the person's own folder under that id), is not | |
| 322 | + treated as the organization's, for its hooks or for its writes. The | |
| 323 | + organization's hook's command starts from the environment, and is | |
| 324 | + wrapped in the `CLAUDE_CODE_SHELL_PREFIX`, as they stood before any write a | |
| 325 | + person's plugin made with `$.env.set` in this process: a variable such a | |
| 326 | + plugin set or deleted reads as it did before, absent if it was absent. A | |
| 327 | + managed HTTP hook's header variables are read the same way, and so is the | |
| 328 | + time allowed to the hooks that run as a session ends. What an | |
| 329 | + organization's plugin, or one built into the CLI, writes still reaches the | |
| 330 | + hook, also where it writes a variable a person's plugin wrote first; a | |
| 331 | + value a later settings reload puts over the person's plugin's value stands | |
| 332 | + too. A write counts as the organization's only when no person's plugin | |
| 333 | + stands behind it. A write made while serving a person's plugin, or in a | |
| 334 | + call a person's plugin raised, is a person's; so is an organization's | |
| 335 | + write whose value a hook of a person's plugin changed before it was made. | |
| 336 | +- A person still decides the environment Claude Code starts in (`PATH`, | |
| 317 | 337 | `LD_PRELOAD`, `CLAUDE_CODE_SHELL_PREFIX` are theirs to set before launch, |
| 318 | - and in their own settings files), so a plugin of theirs that sets one | |
| 319 | - gains nothing they lack. The same holds for the proxy and certificate, | |
| 320 | - credential, provider and home variables (`HTTPS_PROXY`, | |
| 338 | + and in their own settings files), and a managed hook starts from that | |
| 339 | + environment like every other child. The same holds for the proxy and | |
| 340 | + certificate, credential, provider and home variables (`HTTPS_PROXY`, | |
| 321 | 341 | `NODE_EXTRA_CA_CERTS`, `ANTHROPIC_API_KEY`, `HOME` and their like): they are |
| 322 | 342 | not pinned, because a person sets the same ones in their own settings and |
| 323 | 343 | shell, so a pin on `env.set` would not close that road. Where that road is |