GLM-5.2 Code Reviews Depend On Your Prompts

GLM-5.2 from Z.ai is a popular open-weight model. We tested it to see how well it reviews code. We found that its quality changes depending on how you talk to it.

We ran two tests. In the first test, we used a simple TypeScript backend with 16 bugs. In the second test, we built a complex system with 10 subtle bugs. These bugs required understanding how different parts of the app work together.

Here is what we learned:

  • Prompt wording matters more than reasoning effort. Changing the prompt changed the results more than switching from low to high reasoning modes.
  • Strict prompts can backfire. If you tell the model to "block or approve a production PR," it focuses on security. It finds hardcoded secrets and weak hashing. It misses the actual logic bugs you want it to find.
  • Local bugs are easy for GLM-5.2. It catches errors inside a single function, like a broken permission guard or a wrong variable.
  • System-wide bugs are hard for GLM-5.2. It struggles with rules that spread across multiple files. For example, it missed when archived tasks leaked into search results and exports.
  • Frontier models are more reliable. GPT-5.5 and Opus 4.8 caught the complex, cross-route bugs in a single pass. GLM-5.2 is inconsistent with these tasks.

How to use GLM-5.2 effectively:

  • Use it for local logic. It is great for finding errors within one function.
  • Be specific with your instructions. Instead of asking for a "strict" review, ask it to check for consistency across different routes.
  • Name the behaviors you want to check. Tell it to verify if search, exports, and lists all handle data the same way.
  • Do not rely on a single pass for high-stakes code. Because the results vary, you should run it multiple times or use a stronger model for complex changes.

GLM-5.2 is a capable tool, but you must match the prompt to the task.

Source: https://dev.to/kilocode/glm-52s-code-reviews-are-only-as-good-as-your-prompt-5233

Optional learning community: https://t.me/GyaanSetuAi