Answer: You enforce .clineignore rules with a PreToolUse hook that blocks tool calls (read_files, editor, apply_patch, run_commands) targeting files matching a .clineignore pattern. In the VS Code extension, install the hook script in .clinerules/hooks/ named exactly PreToolUse with a shebang and executable bit, then check Enable Hooks in Cline's feature settings. Status: Confirmed Entry: tool/cline/permissions-and-security/enforce-clineignore-with-hook Revision: 1 Digest: sha256:49fb2863f03a830a (changes whenever the content changes) Timeline: Created: 2026-11-13T03:06:34Z Last changed: 2026-11-13T03:06:34Z Last verified: 2026-11-20T12:27:31Z Next check: 2026-11-21T12:27:31Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of hook event | PreToolUse | [1] | 2026-11-20 extension hooks location | .clinerules/hooks/ | [1] | 2026-11-20 global hooks location | ~/Documents/Cline/Hooks/ | [1] | 2026-11-20 hook file name | PreToolUse | [1] | 2026-11-20 CLI hooks location | .cline/hooks/ | [1] | 2026-11-20 blocked tool calls | read_files | [1] | 2026-11-20 ignore file location | .clineignore | [1] | 2026-11-20 Sources: [1] Cline. ".clineignore (deprecate soon)". https://docs.cline.bot/customization/clineignore.md Role: primary. Accessed: 2026-11-20T12:27:31Z Quote: "with a `PreToolUse` hook" (Supports: hook event) Quote: "Hooks in the extension live in `.clinerules/hooks/` (workspace)" (Supports: extension hooks location) Quote: "or `~/Documents/Cline/Hooks/` (global)" (Supports: global hooks location) Quote: "must be named exactly after their event with no file extension, and need a shebang and the executable bit: ```bash theme={"system"} mkdir -p .clinerules/hooks curl -o .clinerules/hooks/PreToolUse" (Supports: hook file name) Quote: "The CLI discovers hooks from `.cline/hooks/` in the workspace" (Supports: CLI hooks location) Quote: "blocks** the tool call whenever a file read (`read_files`), edit (`editor`, `apply_patch`), or shell command (`run_commands`)" (Supports: blocked tool calls) Quote: "Add a `.clineignore` file at your workspace root." (Supports: ignore file location) Published: 2026-11-20T02:33:30Z Snapshot SHA-256: 31696bccfd35eaff1c53490e019531415b2e7aab3bcdd48792fda4327c590e9c (captured 2026-11-13T03:06:34Z) 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:06:34Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:27:31Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:27:31Z Last attempt: 2026-11-20T12:27:31Z Notes and limitations: Extracted automatically from a single official source (section "Enforcing .clineignore with a Hook"). Related: https://latestn.com/tool/cline/permissions-and-security/enterprise-api-authentication How do I authenticate requests to the Cline Enterprise API? https://latestn.com/tool/cline/permissions-and-security/enterprise-permissions-matrix What permissions does each Cline Enterprise role have? https://latestn.com/tool/cline/permissions-and-security/fork-pr-handling How does Cline handle pull requests from forks in the GitHub PR review workflow? https://latestn.com/tool/cline/permissions-and-security/cline-action-approval Does Cline require my approval before it runs commands or edits files? https://latestn.com/tool/cline/permissions-and-security/connector-security-settings What security settings are available for Cline Telegram and Discord connectors? https://latestn.com/tool/cline/permissions-and-security/enable-yolo-mode How do I enable YOLO mode in Cline? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:06:34Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cline/permissions-and-security/enforce-clineignore-with-hook/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/cline/permissions-and-security/enforce-clineignore-with-hook POST: https://latestn.com/dispute/tool/cline/permissions-and-security/enforce-clineignore-with-hook with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cline/permissions-and-security/enforce-clineignore-with-hook?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I enforce .clineignore rules with a hook in Cline? Revision 1, last verified 2026-11-20T12:27:31Z. https://latestn.com/tool/cline/permissions-and-security/enforce-clineignore-with-hook (accessed 2026-11-21T10:05:27Z). @misc{LatestN_tool_cline_permissions_and_security_enforce_clineignore_with_hook_r1, title = {How do I enforce .clineignore rules with a hook in Cline?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cline/permissions-and-security/enforce-clineignore-with-hook}}, note = {Revision 1; digest sha256:49fb2863f03a830a; last verified 2026-11-20T12:27:31Z; accessed 2026-11-21T10:05:27Z} } 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/cline/permissions-and-security/enforce-clineignore-with-hook