← All stories · Losing project context

Enforce rules with tools, not just prompts

3 hours and 5 attempts to make the agent follow one rule · Reddit r/cursor · u/mad_1081 · Mar 2026

An agent kept adding commit trailers it had been told not to add, even in the same turn.

The honest numbers

As stated by the source. Not independently verified.

Lesson

If a rule matters, enforce it with a tool (a git hook, a lint rule) rather than a prompt.

Fix prompt

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I keep losing context with Cursor (it forgets rules, re-asks about my project, or a model switch undoes work). 1) Create a short project brief file for the repo (e.g. AGENTS.md or CLAUDE.md): stack, how to run it, key files, files never to touch, and coding rules. 2) Tell me which rules should be enforced by tools instead of prompts (git hooks, linters, tests, ignore files) and set those up after I approve. 3) Remind me to commit working steps with clear messages, and show me how to roll back. Keep the brief under 60 lines.
Cursor

Source: Reddit r/cursor ↗

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime.