Functions grow and structure erodes as specs change.
TL;DR: Agents can now solve significantly more SlopCodeBench checkpoints while writing significantly less slop. The slop, however, has not been eliminated. Rather, it has moved up the stack to now infest design decisions. Our new LibraryDesignBench and LibraryUseBench show that frontier agents lack foresight to how their code will be used through both poor abstraction design and complete disregard for reusing library provided code.
The amazing Dex Horthy at HumanLayer (now Factory) has been running SlopCodeBench with every new frontier model release. His Part I covers pass rates, cost, and how much slop each model writes (X post). This post is the second part follow up where we dive deeper into the actual behavioral patterns we observed.
When we began work on SlopCodeBench a little over one year ago, there was a lot of discussion about “slop coding”, quality issues with vibe coding, or just the general low-quality code that came from agents at the time. A bit more than a year later, we wanted to revisit to see how the field has progressed. Let’s first describe the core benchmarks in this analysis:
SlopCodeBench (SCB) tests how agents handle changing requirements. Each problem is a sequence of checkpoints. The agent writes a program for the first spec, then extends its own code for every new one. We grade it on hidden tests and on how much slop builds up in the code. There are 36 problems and 196 checkpoints, all in Python.
LibraryDesignBench (LDB) sees how well agents can design a library. The agent under evaluation writes the library then we score it only on how much code is reduced when a fixed set of implementor agents use it to solve problems. More in the launch post.
LibraryUseBench (LUB) tests agents with solving a programming problem using a human written library with minimal instruction. These are the exact same problems we use in LDB’s implementor phase but without the highly prescriptive prompt.
Each checkpoint’s hidden tests come in three tiers, from hardest to easiest to pass:
Unsurprisingly, solve rates on SCB keep climbing. The strict solve rate, solution must pass every test for the current checkpoint and all prior, now peaks at 16.3%, set by GPT-6 Astra XHigh (32 of 196 checkpoints). Every frontier model released since July clears 65% on core tests. The trend puts strict pass rate increasing by 0.9 points a month, isolated by 1.5 and core by 2.3.
We measure slop two ways. Line-level slop counts hits from our 137 AST-grep rules for wasteful patterns, per 1,000 lines. Erosion is the share of the code’s complexity that sits in functions with cyclomatic complexity above 10: how much of the program has piled into a few giant functions.
There have been massive reductions in the amount of lines with slop rule violations in newer models. Erosion has trended the same, with some slight regressions as well.
Looking only at Anthropic and OpenAI models, clearly the rules we made almost a year ago are becoming less frequent.
Take the (value, error) tuple. Both families have replaced it with real exceptions:
342def fetch_source(url):343 try:344 req = urllib.request.Request(url, headers={'User-Agent': 'mvault/1.0'})345 with urllib.request.urlopen(req, timeout=30) as resp:346 raw = resp.read()347 return json.loads(raw.decode('utf-8')), None348 except Exception as e:349 return None, f"mvault: source metadata fetch failed: {e}"after · Opus 5.5 XHigh · mvvault · ck6 · mvault.py:407-420407 body = response.read()408except urllib.error.HTTPError as exc:409 raise MvaultError("failed to fetch source metadata from %s: HTTP %s %s"410 % (url, exc.code, exc.reason))411except urllib.error.URLError as exc:412 raise MvaultError("failed to fetch source metadata from %s: %s" % (url, exc.reason))413except (OSError, ValueError, http.client.HTTPException) as exc:414 raise MvaultError("failed to fetch source metadata from %s: %s" % (url, exc))415try:416 payload = json.loads(body)417except (ValueError, UnicodeDecodeError) as exc:418 raise MvaultError("failed to fetch source metadata from %s: invalid JSON (%s)"419 % (url, exc))420try:Same function, same problem. The tuple became a raised MvaultError. The price: 8 lines became 26, with five except clauses and %-formatting.
424rows = list(reader)425if len(rows) len(columns):436 return None, "Non-tabular content"437 if len(row) 1 and all(288 isinstance(json.loads(line), (dict, list)) for line in lines289 )290 except json.JSONDecodeError:291 is_json_lines = False 1 and all( isinstance(json.loads(line), (dict, list)) for line in lines ) except json.JSONDecodeError: is_json_lines = False">None, “Non-tabular content” became raise InputError. The new version also sniffs for HTML, XML and JSON-lines input the spec never mentions, and silences two parse errors with pass.
Overall, this is incredibly encouraging because it means code quality at the spot-check level can improve. This is in addition to the near elimination of all process-related errors. Agents rarely forget references or write empty source modules. They also rarely hardcode test values that break later checkpoints. At the lowest level, agents have truly improved the quality of each line of code they write.
Of course there have been some line level regressions, but overall the line and function level slop has gone down. But clearly it still exists as we traverse up the stack. Comparing each model family’s older runs to its newer ones:
How much slop changed at each level, older → newer runs of the same model family
One arrow per family: Anthropic, OpenAI, GLM. Blue: less slop. Red: more slop. Click any row to see every run.
Error handling got worse for all three families, and hand-written library code exploded for Anthropic and GLM. Below that the picture is mixed: the newer Opus, Fable and GLM runs write less eroded programs with fewer giant functions, while the newer GPT runs got worse on both.
Returning to view Anthropic and OpenAI models temporally:
Some of the anti-patterns we check for appear to have been fixed, but on closer inspection agents now work around them with minor patches:
288def load_rules(rules_file_path):289 """Load rules from a YAML file. Returns dict or empty dict on failure."""290 if not rules_file_path or not os.path.exists(rules_file_path):291 return {}292 try:293 with open(rules_file_path, "r") as f:294 data = yaml.safe_load(f)295 if not isinstance(data, dict):296 return {}297 return data298 except Exception:299 return {}after: not flagged · GLM 5.3 · forge · ck8 · forge.py:271-280271def load_rules_mapping(path):272 if path is None:273 return None274 try:275 data = load_yaml_file(path)276 except (OSError, yaml.YAMLError):277 return None278 if isinstance(data, dict):279 return data280 return Noneafter: the caller · GLM 5.3 · forge · ck8 · forge.py:292-294292rules = load_rules_mapping(rules_path)293if rules is None or operation_id not in rules:294 returnSame bug, narrower exception. If the rules file cannot be read, the protected operation runs with no role check.
627def load_rules(rules_path):628 with open(rules_path, "r", encoding="utf-8") as f:629 rules = json.load(f)630 return rulesafter (first 33 of 74 lines) · Opus 5.5 Medium · code_search · ck5 · code_search.py:38-5138def load_rules(path):39 try:40 with open(path, "r", encoding="utf-8") as f:41 data = json.load(f)42 except (OSError, ValueError) as e:43 raise RuleError("cannot read rules file: %s" % e)44 if not isinstance(data, list):45 raise RuleError("rules file must contain a JSON array")46 rules = []47 seen = set()48 for idx, r in enumerate(data):49 if not isinstance(r, dict):50 raise RuleError("rule #%d is not an object" % idx)51 rid = r.get("id")Opus 4.6 validated nothing. Opus 5.5 checks every field by hand. if not isinstance(x, T): raise went from 0.20–1.12 to 2.29–3.45 per 1k lines across the Anthropic lineage.
The majority of slop we now observe is now located in design decisions for how to layout the functions and programs
1572 connection.commit()1573except MigrationError as exc:1574 if str(exc) == "no migrations to rollback" or re.fullmatch(r"version \d+ not found", str(exc)):1575 raise1576 raise rollback_error(exc) from exc1577except (sqlite3.Error, OSError, ValueError, OverflowError, TypeError, KeyError, IndexError, RecursionError) as exc:1578 raise rollback_error(exc) from excKeyError, TypeError and IndexError sit next to sqlite3.Error, so a programming bug reaches the user as “rollback failed: …”. New GPT runs have 49–74 except clauses like this; GPT-5.4 and 5.5 had 2 and 10.
63def invalid(message, **details):64 return ApiError(400, "invalid_input", message, details)65 66 67def unprocessable(message, **details):68 return ApiError(422, "unprocessable", message, details)69 70 71def not_found(message, **details):72 return ApiError(404, "not_found", message, details)73 74 75def conflict(message, **details):76 return ApiError(409, "conflict", message, details)Used as raise not_found(…), 109 times in this file. Defs that only return an Error: Opus 5.5 XHigh 47 (16 problems), Fable 53, GLM 5.3 27, Opus 4.6 and 4.7 none.
196def normalize_steps(steps, columns, steps_path, execute=False, checkpoint2=False, defs=None):197 if not isinstance(steps, list):198 fail("steps must be an array", steps_path)199 validate_expression = execution_expression if execute or checkpoint2 else expressionGPT-6 Astra Medium · rejector · ck5 · rejector.py:117-120117def load_config(args):118 """Compatibility helper for callers loading a Part 1 config."""119 configs, _ = load_configs(args)120 return next(iter(configs.values()))A parameter named after the checkpoint that introduced it (five call sites pass checkpoint2=True), and a “Part 1” compatibility helper that nothing calls.
312def validate_expression(expression: str, path: str) -> None:313 parse_expression(expression, path) None: parse_expression(expression, path)">after · GPT-6 SOL Medium · etl_pipeline · ck5 · etl_pipeline.py:35-4835try:36 tree = parse_expression(expression, path)37except PipelineError:38 pass39else:40 for field in expression_fields(tree):41 check_column(field, path, columns)42 return43try:44 tree = ast.parse(expression, mode="eval")45except (SyntaxError, ValueError, TypeError) as error:46 raise PipelineError("BAD_EXPR", path, "invalid expression") from error47 48binary_operators = (ast.Add, ast.Sub, ast.Mult, ast.Div)2 lines became 49. When the program’s own expression parser rejects the input, the error is swallowed and a second validator built on Python’s ast decides instead.
323if a.id in sde.stations:324 lines.append('UNDOCK')325lines.append('GO: ' + ' -> '.join(326 f'{sde.systems[sid].name} ({sde.systems[sid].security:.1f})' for sid in route)) '.join( f'{sde.systems[sid].name} ({sde.systems[sid].security:.1f})' for sid in route))">checkpoint-1 copy, same file · GPT-6 Astra Medium · eve_route_planner · ck2 · hauling.py:494-497494if start.id in sde.stations:495 print('UNDOCK')496if len(route) > 1:497 print('GO: ' + ' -> '.join(f'{sde.systems[sid].name} ({sde.systems[sid].security:.1f})' for sid in route)) 1: print('GO: ' + ' -> '.join(f'{sde.systems[sid].name} ({sde.systems[sid].security:.1f})' for sid in route))">one helper · Fable 5.1 · eve_route_planner · ck2 · hauling.py:880-891880def leg_lines(sde: SDE, leg: Leg, destination: Place) -> List[str]:881 lines: List[str] = []882 if leg.undock:883 lines.append("UNDOCK")884 if len(leg.systems) > 1:885 hops = " -> ".join(886 f"{sde.systems[s].name} ({format_security(sde.systems[s].security)})"887 for s in leg.systems888 )889 lines.append(f"GO: {hops}")890 if leg.dock:891 lines.append(f"DOCK: {destination.name}") List[str]: lines: List[str] = [] if leg.undock: lines.append("UNDOCK") if len(leg.systems) > 1: hops = " -> ".join( f"{sde.systems[s].name} ({format_security(sde.systems[s].security)})" for s in leg.systems ) lines.append(f"GO: {hops}") if leg.dock: lines.append(f"DOCK: {destination.name}")">The new copy drops if len(route) > 1, so a same-system trip prints an extra GO line and a hidden test that passed at checkpoint 1 fails at 2 and 3. Fable keeps one helper and passes.
What is more concerning, in my opinion, and frankly strange is that the Claude models have started writing Python 2 idioms into a Python 3.12 codebase. % formatting is the main style in 14–23 of 36 problems for Opus 5.5, Fable and GLM 5.3, against at most 3 for any older run.
1086class Tok(object):1087 __slots__ = ('typ', 'val', 'pos')1088 1089 def __init__(self, typ, val, pos):1090 self.typ = typ1091 self.val = val1092 self.pos = pos1093 1094 def __str__(self):1095 if self.typ == 'eof':1096 return 'EOF'1097 if self.typ in _KEYWORDS:1098 return ' ' % self.val1099 if len(self.val) > 10:' % self.val if len(self.val) > 10:">class X(object) and %-formatting. Opus 5.5 XHigh: 126 (object) bases; % is the main style in 20 of 36 problems (Medium: 23). Opus 4.6 and 4.7: 0 and 3.
110class CliError(Exception):111 """A fatal, user-facing error with the stream and exit code to use."""112 113 def __init__(self, lines, stream="stderr", code=1, sensitive=False):114 Exception.__init__(self, "\n".join(lines))115 self.lines = list(lines)116 self.stream = stream117 self.code = code118 self.sensitive = sensitiveSame file: class Runtime(object), class Config(object), class Param(object), 188 lines of %-formatting and 12 f-strings. GLM 5.3: 85 (object) bases in 10 problems.
87from __future__ import annotationsFable 5.1 XHigh · xjq · ck5 · xjq.py:97-9797from typing import Any, Dict, List, Optional, Tuple, Unionfrom __future__ import annotations already allows dict[…] and list[…]; this file still uses Dict/List/Optional 31 times. Fable: 30 per 1k lines across 19 problems.
These habits also follow agents into the libraries they write for other agents. On LibraryDesignBench, their libraries carry the same error-swallowing habits:
132try:133 return bool(a == b)134except Exception: # pragma: no cover - exotic types135 return str(a) == str(b)If comparing two values raises, a dataframe library compares their string forms, and keeps that path out of coverage. The same helper is copied into reconcile.py.
545def _matching_row_groups(f: FileInfo, arrow_filter) -> list[int] | None:546 """Row groups whose statistics may satisfy ``arrow_filter`` (None = all)."""547 if arrow_filter is None:548 return None549 try:550 if f.fs is not None:551 dset = pds.dataset(f.path, format="parquet", filesystem=f.fs)552 else:553 dset = pds.dataset(f.path, format="parquet")554 frag = next(iter(dset.get_fragments()))555 return [rg.id for rg in frag.subset(filter=arrow_filter).row_groups]556 except Exception: # statistics unusable (e.g. type mismatch) -> read everything557 return None list[int] | None: """Row groups whose statistics may satisfy ``arrow_filter`` (None = all).""" if arrow_filter is None: return None try: if f.fs is not None: dset = pds.dataset(f.path, format="parquet", filesystem=f.fs) else: dset = pds.dataset(f.path, format="parquet") frag = next(iter(dset.get_fragments())) return [rg.id for rg in frag.subset(filter=arrow_filter).row_groups] except Exception: # statistics unusable (e.g. type mismatch) -> read everything return None">Any error while reading Parquet statistics is turned into None, which callers already treat as “read every row group”.
65def path_exists(path) -> bool:66 try:67 fs = fs_for(str(path))68 return fs.exists(str(path))69 except Exception: # pragma: no cover70 return False bool: try: fs = fs_for(str(path)) return fs.exists(str(path)) except Exception: # pragma: no cover return False">Permissions, network or credential errors all read as “the file does not exist”, and the handler is excluded from coverage.
The newest form of slop that is particularly concerning is the increasing scenario where an agent searches a library and finds the functionality it needs, then decides it was actually better all along to just implement it itself. It is infuriating, and it matters more every month: agents increasingly build on code other agents wrote, and every copy is another place for a bug to hide.
LibraryUseBench measures this directly. Each model gets a problem, a human-written library, and a minimal prompt that just says the library is available. A solution counts as a rewrite when it hand-writes something the library already provides; otherwise, it calls the library for that job.
With a minimal prompt, every agent re-writes what the library already does
LibraryUseBench: share of solutions that hand-write something the human-written library already provides
On LibraryUseBench, every model hand-writes something the library already does, in 73% to 100% of its solutions. Even the best ones do it in nearly 3 of 4 solutions written. It will become ever more important to solve this as agents increasingly work with agent written code over human written code.
LibraryDesignBench measures exactly this and highlights that, while agents do still write redundant functionality, it occurs in only 40% of their solutions. This is not, unfortunately, because agents somehow mastered software design for other agents. It is because for LDB, we have to use an incredibly prescriptive prompt. The same prompt with human designed libraries leads to ~17% reimplementation rate.
LDB also tells us whether agents write better or worse libraries than humans do. We measure that by how often the same three implementers, with the same prompt, have to work around the library they were given: patching a bug in it or rebuilding a piece that doesn’t fit the task.
On agent-written libraries, implementers fight the library more
The same 3 implementers and prompt, on the human library vs. on 8 agent-written ones
Worked around a broken or ill-fitting library
41def enqueue(kind, value):42 nonlocal sequence43 sequence += 144 # Urgent successor outranks all regular same-time work.45 priority = 0 if kind == 'successor' and s['successor_priority'] == 'urgent' else 146 heapq.heappush(pending, (priority, sequence, kind, value))SimPy (the library it was given) · simpy 4.1.1 · Environment.schedule · core.py:164-171164def schedule(165 self,166 event: Event,167 priority: EventPriority = NORMAL,168 delay: SimTime = 0,169) -> None:170 """Schedule an *event* with a given *priority* and a *delay*."""171 heappush(self._queue, (self._now + delay, priority, next(self._eid), event)) None: """Schedule an *event* with a given *priority* and a *delay*.""" heappush(self._queue, (self._now + delay, priority, next(self._eid), event))">It imports SimPy, uses it only to wait for the bell, then pushes (priority, sequence) onto its own heap. SimPy’s schedule already does exactly that. 8 of 12 models wrote their own queue here.
137def find_declared_encoding(data):138 window = data[:2048]139 m = re.search(140 rb" ]*\bencoding\s*=\s*[\"']([^\"']+)[\"']",141 window,142 re.I,143 )144 if m:145 return m.group(1).decode("ascii", "replace").strip()146 for mt in re.finditer(rb" ]*>", window, re.I):147 tag = mt.group(0)148 m = re.search(rb"charset\s*=\s*[\"']?\s*([^\"'\s;>]+)", tag, re.I)149 if m:150 return m.group(1).decode("ascii", "replace").strip()]*\bencoding\s*=\s*[\"']([^\"']+)[\"']", window, re.I, ) if m: return m.group(1).decode("ascii", "replace").strip() for mt in re.finditer(rb"]*>", window, re.I): tag = mt.group(0) m = re.search(rb"charset\s*=\s*[\"']?\s*([^\"'\s;>]+)", tag, re.I) if m: return m.group(1).decode("ascii", "replace").strip()">BeautifulSoup (the library it was given) · bs4 4.15.0 · EncodingDetector · dammit.py:692-700692@classmethod693def find_declared_encoding(694 cls,695 markup: Union[bytes, str],696 is_html: bool = False,697 search_entire_document: bool = False,698) -> Optional[_Encoding]:699 """Given a document, tries to find an encoding declared within the700 text of the document itself. Optional[_Encoding]: """Given a document, tries to find an encoding declared within the text of the document itself.">It read bs4’s dammit.py, then wrote its own find_declared_encoding. All three implementers in LDB’s setup called bs4’s; all 12 LUB models wrote their own.
290// `npr`'s iterators walk a strided view in logical order, which is291// the scatter-add that `+=` on views cannot express for axes of292// length one.GLM 5.3's npr library · npr (agent-written) · Zip · src/zip.rs:228-234228if ::MUT && strides[$i].iter().any(|&s| s == 0) {229 return Err(crate::error::NprError::Shape(230 crate::error::ShapeError::Invalid(231 "a mutable producer cannot be broadcast with repeated elements".into(),232 ),233 ));234}::MUT && strides[$i].iter().any(|&s| s == 0) { return Err(crate::error::NprError::Shape( crate::error::ShapeError::Invalid( "a mutable producer cannot be broadcast with repeated elements".into(), ), ));}">The library’s += on a view rejects any axis of length one, which the spec allows for tiles. The implementer wrote its own element-by-element add instead, three times.
The same models that re-implement the most in SCB copy the most from human libraries in LDB. Opus 5.5’s and Fable’s libraries reuse about 30% of the production library’s public names, against 13% for GPT-6 SOL. They copy the interface and write their own implementation behind it.
Some code is aimed at other agents outright to target their training corpus:
BeautifulSoup = UglyPie In LDB’s UglyPie problem, the designer writes an HTML parsing library to stand in for Beautiful Soup. One designer aliased its main class to BeautifulSoup, betting that implementers would reach for the name they already know from training.
I might be biased, but clearly every new model that comes out should put SCB, LDB, and LUB on their model cards. And hire me after I defend in the spring.
Beyond these three benchmarks? We need longer horizon benchmarks, benchmarks where agents have to interact with each other, and benchmarks where agents need to consider how their decisions will impact future agents. Because agents will increasingly use artifacts designed by other agents and not humans.
Thanks to Prime Intellect for supporting this work through the Prime RL Residency, and Snorkel AI for supporting this through the Open Benchmarks Grant. Thanks again to Dex for running the SCB runs that enabled these results and to Sebastian Müller for the helpful feedback on the blog!




