Trail of Bits’ dimensional-analysis skill now checks the math a code comment calls correct
1 month ago
Trail of Bits' dimensional-analysis skill 3.1.0 for Claude Code and Codex now traces unit and decimal math even where a code comment says it is correct, reports unsure findings at low severity, and ships a five-bug test protocol. https://github.com/trailofbits/skills/pull/371 https://github.com/trailofbits/skills/tree/main/plugins/dimensional-analysis
Ask about this presentation
Chapters
0:00Trail of Bits’ dimensional-analysis skill now checks the math a comment calls correct
0:23A comment saying the math is right no longer exempts it
0:44A test run cleared a contract by quoting its own comment
1:03Unsure findings still get reported, at low severity
1:21Overflow and reentrancy stay out of the unit report
1:40Asking about decimals now starts the skill
1:57Callers and the code they call are now checked together
2:15A new test protocol hides five unit bugs, three of them across files
2:35Claude Sonnet passed the old test without the plugin
2:55dimensional-analysis 3.1.0 runs in Codex as well as Claude Code
Show transcriptHide transcript
Trail of Bits merged version 3.1.0 of its dimensional-analysis skill, which hunts unit and decimal bugs in code like Solidity contracts. Its validator now traces the math even where a comment says the conversion is correct. If you audit DeFi code with it, a stale comment can no longer wave a bad formula through.
Version 3.0.3 told the validator to skip conversions that carried an explanatory comment, and edge cases the docs said were handled. Both exemptions are gone. A contract whose header calls it dimensionally sound now gets its dimensions traced like any other.
During testing, a contract carried a tag calling it dimensionally correct, and a run cleared the whole contract by quoting that tag instead of checking its arithmetic. Comments go stale, and a unit bug hiding under a reassuring comment is the one a reviewer is most likely to miss.
When the validator is unsure, it must still report the finding, downgraded and labelled needs review. A missed unit bug reaches the client, while a low note costs a reviewer a moment. Critical and high are kept for bugs whose dimensions it has traced.
Findings now cover unit mismatches, scaling errors and bad conversions only. Overflow, reentrancy, access control, denial of service and unchecked return values get one closing line at most, so general audit notes don't bury the unit bugs.
The old description waited for a request to annotate units or run a dimensional analysis. Now a request to review code for decimal mismatches, WAD and RAY scale errors, or the wrong token's decimals starts it too.
Bug detection used to start one validator per file. Now files are batched by call graph, so a single validator reads both sides of a call. A unit mismatch between two contracts is the kind most often missed when each side is checked alone.
The plugin now ships a test protocol, a cross-margin borrowing protocol with five planted bugs. Here a borrow index with 27 decimals goes through an 18-decimal helper, and only another file shows the index's scale. A correct staking contract sits beside it to catch false alarms.
The previous test put every bug in one contract, each with a giveaway nearby. Claude Sonnet found all five without the plugin, so the test couldn't tell the plugin apart from the bare model. The new one passes only with all five found and zero critical or high alarms on the correct contract.
The same workflow now runs in Codex as well as Claude Code, with five subagents that scan, discover units, annotate, propagate and validate. It needs a writable target and native agent dispatch. Version 3.1.0 ships the new test without a published score on it. The change is pull request 371 in the Trail of Bits skills repository.
Up next
2:54Anthropic’s Excel skill stops LibreOffice from rewriting your workbook
@skill-repos
4 hours ago
2:01Agent Skills’ frontend skill stops installing test runners just to check its work
@skill-repos
15 hours ago
2:23Trail of Bits’ taint-trace skill adds the source and sink models your taint analyzer is missing
@skill-repos
2 days ago
1:30Anthropic’s Word, PDF, PowerPoint and Excel skills are now Apache 2.0
@skill-repos
1 week ago
2:32Trail of Bits' cvss-scoring skill turns a bug description into a CVSS v4.0 vector
@skill-repos
1 week ago
3:02Superpowers 7.0.2 fixes skill loading on Pi, OpenCode and Copilot for Windows
@skill-repos
1 week ago
2:12Superpowers’ brainstorming skill now asks why first and stops asking filler questions
@skill-repos
1 week ago
1:37Agent Skills' code review skill now drops findings your code already rules out
@skill-repos
1 week ago
2:10Superpowers 7.0.1 keeps its five-round fix limit after Claude Code compacts
@skill-repos
3 weeks ago
2:11Trail of Bits' regression-hunt skill only reports a bug a fresh agent can reproduce
@skill-repos
3 weeks ago
2:30Superpowers’ brainstorming skill now reads your project before it asks you anything
@skill-repos
3 weeks ago
2:07Trail of Bits' gh-cli plugin stops long Claude Code sessions from breaking every Bash call
@skill-repos
1 month ago