Many threads and guides make recommendations about various approaches to helping the agent remember things. This included the use of rules files, the use of planning documents, and the TaskMaster system.
Cursor can automate recording this stuff. One idea is to have the agent often reflect on the chat and record and key lessons like a concrete record of the bugs it introduced.