Cline Logo
EnterprisePricingBlogMCP
Account
Enterprise
PricingBlogMCPLearnDocsPromptsFAQCareersSupport
Account
Cline Logo
EnterprisePricingBlogMCP
Account
Enterprise
PricingBlogMCPLearnDocsPromptsFAQCareersSupport
Account
Cline v3.36: Hooks - Inject Custom Logic Into Cline's Workflow

Cline v3.36: Hooks - Inject Custom Logic Into Cline's Workflow

Hooks let you inject custom scripts at key workflow moments to validate operations, monitor usage, and shape AI decisions. Currently supported on macOS and Linux.

Nick Baumann
Nick Baumann • @nickbaumann_
November 6, 2025

Cline v3.36 ships with Hooks, a system for injecting custom logic into the AI workflow at critical decision points.

Hooks docs

How Hooks work

Hooks are executable scripts that trigger at specific workflow events. Place them in ~/Documents/Cline/Rules/Hooks/ for global use or .clinerules/hooks/ for project-specific logic. Name your script file exactly matching the hook type (no extension) and make it executable.

Each hook receives JSON via stdin containing operation context. Your script processes this data and returns JSON controlling whether to proceed:

#!/usr/bin/env bash
input=$(cat)
# Validate operation
if [[ conditions ]]; then
  echo '{"cancel": true, "errorMessage": "Invalid operation"}'
else
  echo '{"cancel": false, "contextModification": "WORKSPACE_RULES: Use TypeScript"}'
fi

The cancel field blocks or allows execution. The contextModification field injects text into the conversation, affecting future AI decisions. When PreToolUse runs, the AI has already decided its action; your hook validates it. Context modifications shape the next API request, not the current one.

Visual blocks appear in the UI for each hook execution, showing real-time output with expand/collapse functionality. Users can cancel mid-execution, turning the hook indicator red. Resume functionality maintains hook state across interruptions.

Six hook types

  1. PreToolUse validates operations before execution. Block problematic operations like creating .js files in TypeScript projects. Receives tool name and parameters.
  2. PostToolUse learns from completed actions. Track performance metrics from execution results. Receives tool name, parameters, execution results, and timing data.
  3. UserPromptSubmit processes user messages. Inject context based on prompts or validate inputs. Receives prompt text and attachments.
  4. TaskStart initializes tracking and detects project types. Inject initial context that shapes how Cline approaches work. Receives task metadata including task ID and initial task description.
  5. TaskResume restores state after interruptions. Refresh context and log resumption. Receives task metadata and previous state information.
  6. TaskCancel handles cleanup when work stops. Log cancellation details and notify external systems. Receives task metadata and completion status.

Each hook receives base fields (clineVersion, hookName, timestamp, taskId, workspaceRoots, userId) plus specific data for its type.

Get started

Enable hooks in Cline settings under Features. Hooks are currently supported on macOS and Linux only. Windows support is not available.

In v3.36, we also have:

  • Moonshot's latest model, kimi-k2-thinking
  • support for <think> tags for better compatibility with open-source models
  • refinements to the GLM-4.6 system prompt

Changelog

Hooks docs

Related Posts

Cline v3.35: Native Tool Calling, Auto-Approve Menu, and Free MiniMax M2

Cline v3.35: Native Tool Calling, Auto-Approve Menu, and Free MiniMax M2

October 31, 2025
Introducing Cline for Enterprise: Your Infrastructure, Your Inference, Same Cline

Introducing Cline for Enterprise: Your Infrastructure, Your Inference, Same Cline

October 20, 2025
Cline CLI & My Undying Love of Cline Core

Cline CLI & My Undying Love of Cline Core

October 16, 2025
Cline Logo

Transform your engineering team with a fully collaborative AI partner. Open source, fully extensible, and built to amplify developer impact.

Stay updated on Cline's evolution

Product

DocsBlogEnterpriseMCP MarketplaceChangelog

Community

DiscordRedditGitHub Discussions

Support

GitHub IssuesFeature RequestsContact

Company

CareersBrandTermsPrivacy

Stay updated on Cline's evolution

DiscordX/TwitterLinkedInReddit

© 2025 Cline Bot Inc. All rights reserved.