{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Cline Integration","description":"Control the power of AI Agents in runtime.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"cline-integration","__idx":0},"children":["Cline Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Connect Cline to Capsule Security for complete visibility into AI coding assistant activity in VS Code, including prompts, tool execution, and task lifecycle."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This integration uses Cline's hooks system. Capsule generates a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cline-hooks.json"]}," containing one hook script per Cline event, each posting the event to Capsule with an embedded authentication token scoped to your organization. Separate Mac/Linux and Windows variants are available."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following hooks are configured:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Hook Event"},"children":["Hook Event"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TaskStart"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A new task is started"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TaskResume"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A previous task is resumed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TaskCancel"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A task is cancelled"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TaskComplete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A task finishes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UserPromptSubmit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User prompts before submission (evaluated against policy)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PreToolUse"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tool calls before execution (evaluated against policy)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PostToolUse"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tool calls after execution, with results and timing"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PreCompact"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversation context is compacted"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you begin, ensure you have:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["VS Code"]}," with the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cline"]}," extension installed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Capsule Security"]}," account with admin access"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-generate-the-hook-scripts","__idx":3},"children":["Step 1: Generate the Hook Scripts"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log in to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Capsule Security"]}," portal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations"]}," and locate ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cline"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Install"]}," - Capsule generates the hook scripts with an embedded authentication token scoped to your organization"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select your platform (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Mac"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Linux"]},", or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Windows"]},") to download ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cline-hooks.json"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-place-the-hook-scripts","__idx":4},"children":["Step 2: Place the Hook Scripts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Copy the downloaded file into the Cline hooks directory for your platform:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Platform"},"children":["Platform"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Path"},"children":["Path"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["macOS / Linux"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~/Documents/Cline/Hooks/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Windows"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%USERPROFILE%\\Documents\\Cline\\Hooks\\"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To scope the hooks to a single repository instead, place the file in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".clinerules/hooks/"]}," in the project root."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-enable-the-hooks-in-cline","__idx":5},"children":["Step 3: Enable the Hooks in Cline"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open VS Code with the Cline extension installed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Cline sidebar panel"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Hooks"]}," tab"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify the Capsule hooks are listed and toggle them on"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-verify-the-installation","__idx":6},"children":["Step 4: Verify the Installation"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start a Cline task in VS Code and let it run a simple action, for example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Create a new file called test.txt with the content \"Hello World\"\n"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log in to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Capsule Security"]}," portal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inventory > Agents"]}," and confirm the agent appears"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click on the agent and review the audit logs to verify events are captured:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Task start"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["User prompt"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Tool invocations"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To view the full conversation, navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Observability"]}," and filter by ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Activity Type - Session"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"troubleshooting","__idx":7},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If events do not appear:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Verify the file location"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cline-hooks.json"]}," must be in the Cline hooks directory for your platform, or under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".clinerules/hooks/"]}," in the project you are working in"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Confirm the hooks are enabled"]}," in the Cline ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Hooks"]}," tab - hooks placed on disk stay off until toggled on"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Confirm the platform variant matches"]}," - the Windows download uses PowerShell hook commands and the Mac/Linux download uses shell commands; they are not interchangeable"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Check token expiration"]}," - tokens are valid for 365 days; an expired token requires regenerating the hook scripts from the portal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Contact Capsule Security support"]}," if issues persist"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"policy-enforcement","__idx":8},"children":["Policy Enforcement"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserPromptSubmit"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreToolUse"]}," are blocking hooks: Capsule evaluates the prompt or tool call server-side and returns a decision before Cline proceeds. The remaining hooks are observation-only."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To enforce policies on Cline activity:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Policies"]}," in the portal"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Define or assign policies that target Cline agents"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Violations surface under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Detections"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"security-considerations","__idx":9},"children":["Security Considerations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Hook scripts execute with the signed-in user's environment credentials. Before deploying them:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Review the hook commands"]}," in the generated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cline-hooks.json"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Verify the endpoint URL"]}," matches your organization's Capsule instance"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Protect the authentication token"]}," embedded in the scripts - never commit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cline-hooks.json"]}," to version control"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"support","__idx":10},"children":["Support"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For help with this integration:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Email"]},": support@capsule.security"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Include"]},": your organization ID, the platform the hook scripts were installed on, and any error messages"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"references","__idx":11},"children":["References"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.cline.bot/features/hooks"},"children":["Cline Hooks Documentation"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.capsulesecurity.io/guides/policy-testing"},"children":["Capsule Policies"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.capsulesecurity.io/guides/webhook-events"},"children":["Capsule Webhook Events"]}]}]}]},"headings":[{"value":"Cline Integration","id":"cline-integration","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Step 1: Generate the Hook Scripts","id":"step-1-generate-the-hook-scripts","depth":2},{"value":"Step 2: Place the Hook Scripts","id":"step-2-place-the-hook-scripts","depth":2},{"value":"Step 3: Enable the Hooks in Cline","id":"step-3-enable-the-hooks-in-cline","depth":2},{"value":"Step 4: Verify the Installation","id":"step-4-verify-the-installation","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":3},{"value":"Policy Enforcement","id":"policy-enforcement","depth":2},{"value":"Security Considerations","id":"security-considerations","depth":2},{"value":"Support","id":"support","depth":2},{"value":"References","id":"references","depth":2}],"frontmatter":{"seo":{"title":"Cline Integration"}},"lastModified":"2026-11-02T11:57:20.605Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/cline","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}