Answer: The environment variables available to Gemini CLI hooks are GEMINI_PROJECT_DIR, GEMINI_PLANS_DIR, GEMINI_SESSION_ID, GEMINI_CWD, and CLAUDE_PROJECT_DIR (an alias provided for compatibility). Status: Confirmed Entry: tool/gemini-cli/settings/hook-environment-variables Revision: 1 Digest: sha256:dc00a2321c7d1d3c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:18:31Z Last changed: 2026-11-13T03:18:31Z Last verified: 2026-11-20T12:52:59Z Next check: 2026-11-21T12:52:59Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of GEMINI_PROJECT_DIR | GEMINI_PROJECT_DIR | [1] | 2026-11-20 GEMINI_PLANS_DIR | GEMINI_PLANS_DIR | [1] | 2026-11-20 GEMINI_SESSION_ID | GEMINI_SESSION_ID | [1] | 2026-11-20 GEMINI_CWD | GEMINI_CWD | [1] | 2026-11-20 CLAUDE_PROJECT_DIR | CLAUDE_PROJECT_DIR | [1] | 2026-11-20 Sources: [1] Google. "Gemini CLI hooks". https://geminicli.com/docs/hooks.md Role: primary. Accessed: 2026-11-20T12:52:59Z Quote: "`GEMINI_PROJECT_DIR`: The absolute path to the project root." (Supports: GEMINI_PROJECT_DIR) Quote: "`GEMINI_PLANS_DIR`: The absolute path to the plans directory." (Supports: GEMINI_PLANS_DIR) Quote: "`GEMINI_SESSION_ID`: The unique ID for the current session." (Supports: GEMINI_SESSION_ID) Quote: "`GEMINI_CWD`: The current working directory." (Supports: GEMINI_CWD) Quote: "`CLAUDE_PROJECT_DIR`: (Alias) Provided for compatibility." (Supports: CLAUDE_PROJECT_DIR) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: a06a92438d3110690e875d61feef49a850d82eda618bb837146a1a7ff7a4c8d9 (captured 2026-11-13T03:18:31Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:18:31Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:52:59Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:52:59Z Last attempt: 2026-11-20T12:52:59Z Notes and limitations: Extracted automatically from a single official source (section "Environment variables"). Related: https://latestn.com/tool/gemini-cli/settings/load-theme-file How do I load a custom theme from a file in Gemini CLI? https://latestn.com/tool/gemini-cli/settings/local-routing-configuration How do I configure Gemini CLI to use a local model for routing decisions? https://latestn.com/tool/gemini-cli/settings/manage-tools How do I configure or discover tools in Gemini CLI? https://latestn.com/tool/gemini-cli/settings/enable-system-prompt-override How do I enable a custom system prompt override in Gemini CLI using GEMINI_SYSTEM_MD? https://latestn.com/tool/gemini-cli/settings/environment-variables-dotenv How do I set environment variables for Gemini CLI using .env files? https://latestn.com/tool/gemini-cli/settings/export-default-system-prompt How do I export the default system prompt in Gemini CLI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:18:31Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/settings/hook-environment-variables/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/settings/hook-environment-variables POST: https://latestn.com/dispute/tool/gemini-cli/settings/hook-environment-variables with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/settings/hook-environment-variables?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What environment variables are available to Gemini CLI hooks? Revision 1, last verified 2026-11-20T12:52:59Z. https://latestn.com/tool/gemini-cli/settings/hook-environment-variables (accessed 2026-11-21T09:53:21Z). @misc{LatestN_tool_gemini_cli_settings_hook_environment_variables_r1, title = {What environment variables are available to Gemini CLI hooks?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/settings/hook-environment-variables}}, note = {Revision 1; digest sha256:dc00a2321c7d1d3c; last verified 2026-11-20T12:52:59Z; accessed 2026-11-21T09:53:21Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/settings/hook-environment-variables