# agent: Add commit message project rules toggle \(\#56867\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/38562721884c73fd8c60af3d1cf00550d72a6a6c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 38562721884c73fd8c60af3d1cf00550d72a6a6c

Requested commit: 38562721884c73fd8c60af3d1cf00550d72a6a6c

Commit: 38562721884c73fd8c60af3d1cf00550d72a6a6c

Tree: 16cfa25dc5db2360bfd3da7bde684e7b61906b2f

Author: Lavi Sharma

Committer: GitHub

## Message

````
agent: Add commit message project rules toggle (#56867)

This follows up on discussion #56551.

Right now, when Zed generates a commit message, it includes project
rules files like `AGENTS.md`, `CLAUDE.md`, and `.rules` in the prompt
alongside the git diff. That can add a lot of extra context for a task
that is really just summarizing the changes in a commit.

This PR adds an `include_project_rules` option to
`agent.commit_message_model`. When it is set to `false`, Zed skips
loading project rules when generating commit messages. If the option is
omitted, the current behavior stays the same.

Example:

```json
   {
     "agent": {
       "commit_message_model": {
         "provider": "anthropic",
         "model": "claude-3-5-haiku",
         "include_project_rules": false
       }
     }
   }
 ```

I also updated the settings plumbing so this option is only used for commit message generation and defaults to true when not specified.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

 Release Notes:

 - agent: Added setting to exclude project rules files from commit message generation prompts (`agent.commit_message_include_project_rules`)

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
````

## Parents

- [45015f89d73679df431c5c761b9711b56852fd23](https://git.cafe/gitcafe/zed/commit/45015f89d73679df431c5c761b9711b56852fd23?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/38562721884c73fd8c60af3d1cf00550d72a6a6c?format=markdown)
