Connect Cline to Capsule Security for complete visibility into AI coding assistant activity in VS Code, including prompts, tool execution, and task lifecycle.
This integration uses Cline's hooks system. Capsule generates a 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.
The following hooks are configured:
| Hook Event | Description |
|---|---|
| TaskStart | A new task is started |
| TaskResume | A previous task is resumed |
| TaskCancel | A task is cancelled |
| TaskComplete | A task finishes |
| UserPromptSubmit | User prompts before submission (evaluated against policy) |
| PreToolUse | Tool calls before execution (evaluated against policy) |
| PostToolUse | Tool calls after execution, with results and timing |
| PreCompact | Conversation context is compacted |
Before you begin, ensure you have:
- VS Code with the Cline extension installed
- A Capsule Security account with admin access
Log in to the Capsule Security portal
Navigate to Integrations and locate Cline
Click Install - Capsule generates the hook scripts with an embedded authentication token scoped to your organization
Select your platform (Mac, Linux, or Windows) to download
cline-hooks.json
Copy the downloaded file into the Cline hooks directory for your platform:
| Platform | Path |
|---|---|
| macOS / Linux | ~/Documents/Cline/Hooks/ |
| Windows | %USERPROFILE%\Documents\Cline\Hooks\ |
To scope the hooks to a single repository instead, place the file in .clinerules/hooks/ in the project root.
- Open VS Code with the Cline extension installed
- Open the Cline sidebar panel
- Navigate to the Hooks tab
- Verify the Capsule hooks are listed and toggle them on
Start a Cline task in VS Code and let it run a simple action, for example:
Create a new file called test.txt with the content "Hello World"Log in to the Capsule Security portal
Navigate to Inventory > Agents and confirm the agent appears
Click on the agent and review the audit logs to verify events are captured:
- Task start
- User prompt
- Tool invocations
To view the full conversation, navigate to Observability and filter by Activity Type - Session
If events do not appear:
Verify the file location -
cline-hooks.jsonmust be in the Cline hooks directory for your platform, or under.clinerules/hooks/in the project you are working inConfirm the hooks are enabled in the Cline Hooks tab - hooks placed on disk stay off until toggled on
Confirm the platform variant matches - the Windows download uses PowerShell hook commands and the Mac/Linux download uses shell commands; they are not interchangeable
Check token expiration - tokens are valid for 365 days; an expired token requires regenerating the hook scripts from the portal
Contact Capsule Security support if issues persist
UserPromptSubmit and 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.
To enforce policies on Cline activity:
- Navigate to Policies in the portal
- Define or assign policies that target Cline agents
- Violations surface under Detections
Hook scripts execute with the signed-in user's environment credentials. Before deploying them:
- Review the hook commands in the generated
cline-hooks.json - Verify the endpoint URL matches your organization's Capsule instance
- Protect the authentication token embedded in the scripts - never commit
cline-hooks.jsonto version control
For help with this integration:
- Email: support@capsule.security
- Include: your organization ID, the platform the hook scripts were installed on, and any error messages