<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9" -->

---
title: Deep Dive into the new Cursor Hooks | daily.dev
description: Cursor 1.7 introduces a beta lifecycle hooks system with 6 hook types: beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, beforeReadFile,...
canonical: https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Deep Dive into the new Cursor Hooks | daily.dev
og:description: Cursor 1.7 introduces a beta lifecycle hooks system with 6 hook types: beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, beforeReadFile,...
og:url: https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9
og:image: https://api.daily.dev/og/posts/22iKBGRe9.png
og:image:alt: Deep Dive into the new Cursor Hooks
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep Dive into the new Cursor Hooks

**[GitButler Blog](https://daily.dev/sources/gitbutler)** · 9 min read · 0 upvotes · 0 comments

## Summary

Cursor 1.7 introduces a beta lifecycle hooks system with 6 hook types: beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, beforeReadFile, afterFileEdit, and stop. Hooks are defined in hooks.json files at project, enterprise, or user-global level. Each hook receives context via stdin as JSON and some hooks (beforeShellExecution, beforeMCPExecution, beforeReadFile) can return JSON to allow, deny, or modify agent behavior. Unlike rules or MCP calls, hooks are deterministic and run outside the LLM, making them faster and more reliable. Use cases include auto-formatting, blocking dangerous shell commands, secret redaction before file contents are sent to the LLM, and triggering version control actions. GitButler uses hooks to create branches per conversation and commits per generation.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.gitbutler.com/cursor-hooks-deep-dive>

## Similar posts on daily.dev

- [Hooks for security and platform teams](https://daily.dev/posts/hooks-for-security-and-platform-teams-tzbe2g3vh) · Cursor · 1 upvotes · 0 comments
- [AI coding agent audit: Cursor hooks and Elastic Agent — Elastic Security Labs](https://daily.dev/posts/ai-coding-agent-audit-cursor-hooks-and-elastic-agent-elastic-security-labs-o2kav0nbd) · Elastic Security Labs · 0 upvotes · 0 comments
- [GitHub Copilot CLI Tips & Tricks — Part 4: Automating and enforcing policies with hooks](https://daily.dev/posts/github-copilot-cli-tips-tricks-part-4-automating-and-enforcing-policies-with-hooks-ucqhydtbd) · The Art of Simplicity · 0 upvotes · 0 comments
- [Claude Code power user customization: How to configure hooks](https://daily.dev/posts/claude-code-power-user-customization-how-to-configure-hooks-i0akqx7ke) · Claude · 1 upvotes · 0 comments
- [Cursor Agent Hooks: Lint and Build Checks After Each Turn](https://daily.dev/posts/cursor-agent-hooks-lint-and-build-checks-after-each-turn-aegcnriet) · Liran Tal · 1 upvotes · 0 comments

---

Tags: [#git](https://daily.dev/tags/git), [#ai-coding](https://daily.dev/tags/ai-coding), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Deep Dive into the new Cursor Hooks","url":"https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9"},"datePublished":"2026-07-26T07:48:16.472Z","dateModified":"2026-07-26T07:49:11.419Z","description":"Cursor 1.7 introduces a beta lifecycle hooks system with 6 hook types: beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, beforeReadFile,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/646e3790b127bd5e2fffbe405acbd790?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/646e3790b127bd5e2fffbe405acbd790?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"GitButler Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"GitButler Blog","logo":"https://media.daily.dev/image/upload/s--LrHsyt2T--/f_auto/v1692632054/squad_placeholder_sfwkmj","url":"https://daily.dev/sources/gitbutler"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/deep-dive-into-the-new-cursor-hooks-22ikbgre9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"git,ai-coding,mcp","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"GitButler Blog","item":"https://daily.dev/sources/gitbutler"},{"@type":"ListItem","position":3,"name":"Deep Dive into the new Cursor Hooks"}]}
```

