Is your Cursor agent losing track of your project?
The bigger your codebase, the more often the agent goes "out of context": it forgets where things are, mixes up modules, or suggests outdated solutions. Cursor doesn’t have a built-in mechanism to keep project architecture context up to date — so I added one.
cursor-docs-hook — a rule + hook in a single package.
-
Rule: tells the agent to create and use
docs/INDEX.mdand module-levelINDEX.mdfiles as a project map — read them to get an overview of structure, module purposes, and where to find things. One entry point instead of scattered files. -
Hook: tracks which files Cursor changed during a run. When Cursor finishes and changes were made, the hook runs
cursor-agentin the background and updatesdocs/INDEX.mdand module-levelINDEX.md. The context the agent reads and maintains stays in sync with the code, so it doesn’t lose orientation as the project grows.
One command installs both rule and hook together:
npx cursor-hook install beautyfree/cursor-docs-hook
If you use Cursor in growing projects — give it a try.
👉 https://github.com/beautyfree/cursor-docs-hook
P.S. Your GitHub stars and sharing among Cursor users is a great way to say thanks✨

Top comments (0)