Newbie question ? chat window keeps suggesting incorrect code

Hi everyone, I am pretty new to Cursor, and is amazed by how cursor can help me code faster. However there is a problem that I cannot find any solution, maybe anyone can help me out here.

Many times the chat window often suggest code that does not “fit” my current code base.

For example, I ask it to generate an app.py based on flask, and it does so correctly, and the default listening port is 5000.

However on Mac I cannot listen to 5000, so I changed it to 5555.

But later when I ask for other features from chat window, the suggested code will always be 5000.

It seems like it does not keep track of the local changes that I made. Also I noticed, if I asked for a change from chat window, and I ignore his suggestion, the next suggestion will also include previous suggestion.

This is really annoying, and I hope someone can help me.

I have tried to reindex the codebase, and also make sure the context in chat window indeed include app.py, none of these helps.

Hi @Derek

Sometimes starting a new chat fixes the issue, as the old context often remains in the conversation. Also, could you let me know which model you’re using?

claude-3.5 sonnet.

Is this considered as a bug ?

I would say: this is how these models work.
they don’t think, they aren’t smart. they just generate code based on your prompt.
it can fail and many times.
when Claude gets stuck, I move to GPT and , that seems to work. but don’t ask for pears to the apple tree. lol

1 Like