# Project-level afterFileEdit hooks not firing in Cloud Agents

**URL:** <https://forum.cursor.com/t/project-level-afterfileedit-hooks-not-firing-in-cloud-agents/161847>\
**Category:** Bug Reports\
**Tags:** hooks, cloud-agents\
**Created:** [May 28, 2026, 11:00pm UTC](https://forum.cursor.com/t/project-level-afterfileedit-hooks-not-firing-in-cloud-agents/161847 "2026-05-28T23:00:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [May 29, 2026, 5:26am UTC](https://forum.cursor.com/t/project-level-afterfileedit-hooks-not-firing-in-cloud-agents/161847/6 "2026-05-29T05:26:06Z")

</div>

`afterFileEdit` hooks are supported in cloud agents - you can see the full support table in our [hooks documentation](https://cursor.com/docs/hooks). The [earlier thread](https://forum.cursor.com/t/project-level-hooks-and-root-level-hooks-no-longer-work-in-cloud-agents/144932) you referenced was filed before this support was added, which is why it was closed without a clear resolution.

The most likely cause here is that your hook script’s dependencies (`uv`, `ruff`, `yq`) aren’t available in the cloud agent VM. Hooks have a fail-open behavior - if the script exits with an error (e.g., because a tool isn’t found), the agent continues silently without any visible error. So the hook may actually be firing, but the script fails because its dependencies aren’t installed.

Could you try two things to help narrow this down?

1. Test with a minimal hook to confirm the hook fires at all. Replace your current hook with this temporarily:

```auto
{
"version": 1,
"hooks": {
"afterFileEdit": [
{ "command": ".cursor/hooks/test-hook.sh" }
]
}
}

```

`.cursor/hooks/test-hook.sh`:

```auto
#!/bin/bash
echo "afterFileEdit fired at $(date)" >> /tmp/hook-test.log
cat > /dev/null

```

Run a cloud agent session, let it edit a file, then check `/tmp/hook-test.log`.

2. If the test hook fires, the issue is dependencies. You’ll need to install `uv`, `ruff`, and `yq` in the cloud agent VM via your [environment configuration](https://cursor.com/docs/cloud-agent/setup) - either in a Dockerfile or the `install` command in `.cursor/environment.json`.

If the test hook doesn’t fire, that would indicate something else is going on, and we’d want a request ID from that cloud agent session to investigate further.

---

_[View the full topic](https://forum.cursor.com/t/project-level-afterfileedit-hooks-not-firing-in-cloud-agents/161847)._
