Cursor keeps deleting my comments during refactoring
Has anyone else experienced Cursor aggressively stripping out code comments when using the Composer feature for large-scale refactoring? I have a legacy Python service where the comments are actually more important than some of the code because they document complex business logic that isn't obvious from the function names. Every time I ask it to 'clean up this module' or 'optimize this function,' it doesn't just refactor the logic; it removes every single comment, including the ones explaining why certain edge cases are handled in a specific, seemingly odd way. I've tried adding 'preserve all comments' to my system prompt, but it feels like it still interprets that as a soft suggestion rather than a hard constraint. I'm worried that if I let it touch a critical payment processing module, I'll lose the context on why we use a specific third-party library for currency conversion instead of standard math operations. Is there a reliable way to force it to treat comments as immutable data? Or should I just stop using AI for anything that involves legacy code with heavy documentation? I’m currently reverting changes manually, which defeats the purpose of using an AI assistant in the first place. Looking for workarounds or configuration changes that might help here.