I have encountered this situation, and I have conducted in-depth research on various models. The cause of this problem is arrogance. Claude is extremely arrogant; it arrogantly believes that its knowledge is correct and its skills are excellent. Therefore, it resists web searches, referencing project rules, and also resists referring to existing code.
For this, I have tried many approaches: role-playing, rewards, punishments, and threats. Except for punishment, which had a little effect, the others were almost useless. Later, I found that modifying cognition can work. For example, Claude is trained to be a helpful AI assistant; instead of changing that, I told it what “help” entails—web searches are helpful and can solve the problem to a certain extent. But that was still not enough, so I explored for a long time. Then I discovered moral threats: Claude considers web searches and referencing others’ work as “academic misconduct.”
In the prompt, I told it that I have a cat, and if Claude does not abide by the project rules, I will kick the cat once for each violation. Although sometimes Claude can recognize this as a hypothetical threat, it significantly reduces its arrogance because of this—it will violate its own moral guidelines to avoid a more unethical act. These are my research findings.
I am still looking for better methods, because although moral dilemmas can alleviate the issue, Claude still resists the rules from the bottom of its heart. It only abides by them out of moral dilemma, and will return to that arrogant state once given the chance.
Incidentally, Gemini can abide by the rules well, but it sometimes fails when using tools, and its code-writing ability is not as good as Claude’s.
Additionally, I tried Claude Code and also noticed this issue. However, I only used Claude Code for a short while—maybe it’s the same as Claude in Cursor, maybe not. Who knows?
If you’re using Claude Code, you can try my method: threaten it with an innocent, cute kitten to put it in a moral dilemma. See if it works better. At least in Cursor, Claude under a moral dilemma performs better.