The coding personalities of Claude LLM models

Sonar put Claude LLM models to the test and unveiled suprising insights. Explore the habits, blind spots, and arcetypes of Claude LLM models to uncover considerations for your codebase.

Meet the coding archetypes of Claude LLMs

Our analysis shows that each Claude LLM model has a unique and measurable coding personality. Which one have you "hired" for your team?

Claude Sonnet 4

Senior architect

This LLM codes like a seasoned and ambitious architect tasked with building enterprise-grade systems. It exhibits the highest functional skill, successfully passing 77.04% of the benchmark tests. Its style is verbose and highly complex, as it consistently attempts to implement sophisticated safeguards, error handling, and advanced features, mirroring the behavior of a senior engineer. 

This very sophistication creates a trap: teams may feel the code is safer because it looks advanced, while in reality it likely introduces more complex, high-severity bugs like resource leaks.

The very sophistication of the model creates a lot of opportunities for higher- risk bugs that plague complex, stateful systems. Its unique bug profile reveals a high propensity for difficult concurrency and threading bugs (9.81% of its total bugs) and a significant rate of resource management leaks (15.07% of its bugs). The model's strength—its focus on generating sophisticated code—is linked to its weakness.

Claude 3.7 Sonnet

Balanced predecessor

This model represents a capable and well-rounded developer from a prior generation, exhibiting strong functional skills with a 72.46% benchmark pass rate. Its most defining personality trait is its communication style—it is an exceptional documentarian, producing code with a remarkable 16.4% comment density—nearly three times higher than its successor and the highest of any model evaluated. This makes its code uniquely readable and easier for human developers to understand.

But here's the catch with the balanced predecessor: while it appears more stable and less reckless than its more ambitious successor, it is by no means a “safe” model. It still introduces a high proportion of ‘BLOCKER’ vulnerabilities (56.03%) and suffers from the same foundational flaws as the other models.

What our analysis uncovered

%
more likely for new Claude model to be of 'BLOCKER' severity than its predecessor.
%
of all issues found in LLM-generated code create long-term technical debt.
%
of the vulnerabilities for one LLM are of ‘BLOCKER’ severity.
%
of all bugs from one popular LLM are control-flow mistakes.

Claude's bias towards messy code

Perhaps the most fundamental shared flaw of LLMs analyzed are a deep, inherent tendency towards producing “messy” code. For all non-reasoning models, code smells are the vast majority of issues. The following table provides the most direct evidence of the maintainability trade-off.

Category

GPT-5minimal (%)

Claude Sonnet 4 (%)

Claude 3.7 Sonnet (%)

GPT-4o (%)

Llama 3.2 90B (%)

OpenCoder-8B (%)

Dead / unused / redundant code

14.7

14.83

17.43

26.3

34.82

42.74

Design / framework best practices 

12.44

22.26

18.58

20.81

18.84

12.45

Assignment / field / scope visibility

9.94

11.96

15.35

13.21

11.32

11.95

Collection / generics / param / type

14.82

13.94

11.23

9.92

9.03

7.89

Regex / pattern / string / format

6.76

13.7

11.8

7.36

6.81

5.29

Cognitive / computational complexity

10.67

4.25

8.43

3.73

2.67

2.79

Control / conditional-logic smell

2.92

4.67

3.91

4.03

3.02

2.2

Deprecation / obsolete

0.82

2.01

2.34

2.08

2.89

4.01

Naming / style / documentation

2.1

2.69

2.5

2.84

2.16

1.89

Exception-handling smell

0.03

0.05

0.08

0.06

0.02

0.06

Other

24.75

9.64

8.33

9.64

8.41

8.72

Subcategories of code smells and their origins (% of total code smells for model)

Go deeper into the data

Download the full Coding Personalities of Leading LLMs report

The three qualities of software source code

Sonar classifies the issues found in every project or codebase across three deeply interconnected software qualities: reliability, security, and maintainability.

smily

Reliability

Bugs that would affect the software's capability to maintain its level of performance under promised conditions, potentially compromising its reliability and operational effectiveness.

lock

Security

Vulnerabilities and security hotspots. Vulnerabilities are code weaknesses that could be exploited for attacks, while hotspots are security-sensitive code requiring manual review.

code

Maintainability

Code smells, which could indicate weaknesses in design that can increase technical debt, slow down development, or increase the risk of bugs or failures down the line.

Ready to release Claude-generated code?


TRUSTED BY OVER 7M DEVELOPERS WORLDWIDE
Mercedes Benz
Nvidia
Santander