pub fn capture()Expand description
Capture forwardable variables from the current (agent) environment into the
data dir so the MCP server can forward them to ctx_shell children.
No-op when the current environment carries no forwardable variables — this prevents a process with a stripped environment (e.g. the MCP server itself) from clobbering a good capture. The file is only rewritten when the variable set actually changes, keeping the cost of capturing on every shell command low.