Clarent
English | Español
Real output of clarent ach on the synthetic flaky-test example; only typing speed and pauses are staged (docs/demo/make_ach_gif.py regenerates it).
Classic decision, optimization and engineering methods — as tools that compute, not prompts that sound smart.
What is Clarent?
People and AI agents tend to anchor on the first plausible hypothesis. Proven methods exist (CIA, army, Toyota, NASA, Soviet TRIZ), but they live in manuals. Clarent turns them into commands that compute (a deterministic engine, no LLM involved), not prompts:
| Command | Origin | What it does |
|---|---|---|
clarent ach |
Analysis of Competing Hypotheses, CIA (Heuer) | Ranks rival causes by how much evidence contradicts them and suggests the next test to run. |
clarent redteam |
Red Teaming, US Army (UFMCS) | Attacks a design doc or PR and rejects every attack that is not quoted from the text. |
clarent triz-matrix |
TRIZ contradiction matrix, Altshuller (USSR) | Given "improve X without worsening Y", returns the inventive principles from the 1973 table. |
The difference: the AI proposes; the engine scores, validates and rejects whatever has no evidence.
Status: pre-release (v0.1). Three methods are implemented end-to-end (
ach, 24 tests;redteam, 82;triz-matrix, 38). Eight more are specified inresearch/product-spec.md; the rest of the plan is inresearch/roadmap.md. Nothing here claims to make your agent fix more bugs — see What we do not claim.
Install
pip install clarent-methods # the `clarent` CLI; Python >= 3.11, no dependencies
# or the development version: pip install git+https://github.com/Joaquincuevas/clarent
/plugin marketplace add Joaquincuevas/clarent # in Claude Code: add the marketplace...
/plugin install clarent-methods@clarent # ...and install the skills
Why another methods repo?
Military doctrine, Toyota's shop floor, Soviet inventors' algorithms, NASA safety engineering: decades of method for finding root causes, attacking plans and estimating honestly. Clarent turns them into small, auditable tools for developers and their coding agents: Claude Code skills, a CLI, and (soon) hooks, MCP tools and GitHub Actions.
Collections of "thinking frameworks as prompts" already exist (the biggest we found has ~1.7k stars; see research/novelty.md). They give an agent a checklist. Clarent's rule is stricter: every method must have a deterministic core — something the code computes or rejects with no LLM involved — plus evidence discipline:
- the agent proposes, the engine scores, validates and can say no;
- every observed fact needs a
ref(the command,file:lineor log that produced it); - reports say what they are: an ACH score is a ranking of inconsistencies, never a probability.
Demo
Everything below is the real output of the command shown, on the synthetic examples shipped in methods/. The files in docs/demo/ hold the complete outputs and are regenerated by python tools/gen_demo.py (CI fails if they drift).
ach — debugging with competing hypotheses
A test, test_checkout_total, fails about 1 run in 8 on CI. Five rival causes and a catch-all, five pieces of evidence, each rated against every hypothesis:
$ clarent ach score methods/ach/examples/flaky-test.json
Excerpt (the full report also has the evidence matrix, diagnosticity, sensitivity and warnings — docs/demo/ach-score.md):
## Conclusion
- Tie: several hypotheses share the lowest inconsistency score.
- Leader(s): H1, H5 (margin over the next: 21)
- This is a ranking of inconsistencies, **not a probability**.
## Hypothesis ranking (lower inconsistency = better)
| # | Hypothesis | Inconsistency | State | Contradicted by |
|---|-----------|---------------:|--------|-----------------|
| 1 | **H1** Race condition between xdist workers on a session-scoped fixture | 0 | alive | — |
| 1 | **H5** Leftover DB state from another test that ran earlier on the same worker | 0 | alive | — |
| 1 | **H6** Something else I am not considering | 0 | catch-all | — |
| 2 | **H2** Clock/timezone dependence (datetime.now near a day boundary) | 21 | refuted | E2, E1 |
| 3 | **H3** Real, unmocked network call that sometimes answers slowly or errors | 27 | refuted | E4, E1 |
| 4 | **H4** Non-deterministic set/dict ordering (PYTHONHASHSEED) changes a float sum | 33 | refuted | E3, E1, E5 |
Clock, network and hash-seed causes are refuted by cited evidence; two causes tie. Which single experiment separates them?
$ clarent ach next methods/ach/examples/flaky-test.json
T1 priority=36.0 for=H5 against=H1
Reproducing serially with the same random order as the failure (pytest-randomly --randomly-seed=<seed of run #8812>) also fails
T2 priority=9.0 for=H1 against=-
Changing the fixture from scope=session to scope=function removes the failures in 200 runs with '-n 4'
redteam — attack a design or a PR; the engine refuses what it cannot anchor
A synthetic design doc moves notifications from a cron job to a stream consumer (design.md). A model proposes assumptions and attacks as JSON, each quoting the passage it rests on; the engine checks them against the text:
$ clarent redteam check methods/redteam/examples/design-doc/findings.json
Excerpt (the full report also has the assumption matrix, what to verify next, class coverage and warnings — docs/demo/redteam-check.md):
## Top 3 attacks by impact
| # | Attack | Class | Assumption | Risk | Where | How to check |
|--:|---|---|---|---|---|---|
| 1 | **X3** After the rollout there is no way back: the flag cannot bring back the cron job or the sent_at column, so a bad release can only be fixed by shipping another one while notifications are being lost. | Reversibility | A5 (contradicted) | 25 (S1) | `design.md:26` | Apply the migration in staging, then try to revert to the previous release and send a notification. |
| 2 | **X1** If Redis is down when the API publishes, the row stays in the table but nothing reads it once the cron job is gone: those notifications are never sent and nobody is told. | Failure modes | A1 (contradicted) | 20 (S1) | `design.md:19` | Stop Redis in staging, create 20 notifications, restart Redis and count how many are sent. |
| 3 | **X2** A consumer that crashes after the read and before the provider answers loses the notification: acknowledging on read gives at-most-once delivery, and the row stays pending for ever. | Failure modes | A6 (unverified) | 16 (S2) | `design.md:14` | In staging, kill -9 a consumer between the read and the provider call; count the rows still pending after 10 minutes. |
Where is the line of the design the attack quotes; contradicted means the assumption was checked and the evidence says it is false (here, design.md:15 deletes the only reader of the table), which raises the plausibility of every attack that depends on it. X2 rests on an unverified assumption, so the report lists it first under "Verify next".
The same design with findings the engine must refuse (an invented quote, "verified" with no evidence, a ref to a line that does not exist, a duplicate, an attack with no way to check it) exits 1 and says why:
$ clarent redteam check methods/redteam/examples/design-doc/findings.rejected.json
## Rejected findings
| Kind | ID | Reason |
|---|---|---|
| assumption | A3 | the quote does not appear in the target (compared literally, ignoring only whitespace) |
| assumption | A4 | status 'verified' needs at least one evidence item with a ref and an observation |
| assumption | A5 | evidence ref 'design.md:99' is not valid: line out of range (the file has 27 lines) |
| attack | X3 | its assumption A3 was rejected |
| attack | X4 | the quote has 5 characters; at least 12 are required to anchor a finding |
| attack | X5 | duplicate of X2 (same class and assumption, near-identical text) |
| attack | X6 | no 'check': say how to verify this attack (a command or a concrete question) |
| attack | X7 | its assumption A4 was rejected |
| attack | X8 | its assumption A5 was rejected |
The engine proves a finding is anchored and backed, not that it is right. It also works on PRs (description plus gh pr diff): docs/demo/redteam-pr.md.
triz-matrix — a design trade-off, resolved against the 1973 table
"Make /search faster without making the system harder to run":
$ clarent triz-matrix lookup latency "Device complexity"
# TRIZ contradiction: improve «Speed» without worsening «Device complexity»
- **Improving:** 9. Speed — _software reading: latency, response time or throughput of an operation_
- **Worsening:** 36. Device complexity — _software reading: system complexity: number of components, dependencies, code paths_
- «latency» was interpreted as parameter 9 (Speed) by software-reading match
> Cell verified: the consensus of 4 independent transcriptions equals the Altshuller Foundation 1973 table.
## Principles (in the order the matrix lists them)
| # | Principle | What it means | Software example |
|--:|---|---|---|
| 10 | **Preliminary action** | Carry out the required change, fully or partly, before it is needed. | Precompute results; warm caches; ahead-of-time compilation; pre-pulled images and pre-provisioned environments. |
| 28 | **Mechanics substitution** | Replace the way the parts interact with a different kind of channel or field. | Replace polling with events or webhooks; replace manual review with automated static analysis. |
| 4 | **Asymmetry** | Replace a symmetrical form with an asymmetrical one, or increase existing asymmetry. | Separate read and write paths (CQRS); one writer with many read replicas; asymmetric roles in a protocol. |
| 34 | **Discarding and recovering** | Let parts that have done their job go away or change during operation, and restore used-up parts straight away. | Garbage collection; cache eviction and TTLs; log rotation; automatic cleanup of ephemeral environments; compaction. |
The report goes on with a reminder that principles are prompts for ideas, not solutions, and the reverse cell. triz-matrix analyze methods/triz-matrix/examples/search-api.json does the same for several contradictions at once and ranks the principles that recur (docs/demo/triz-analyze.md). Ambiguous names are rejected with the candidates listed, never guessed.
In Claude Code
/clarent-methods:ach test_checkout_total fails ~1 in 8 CI runs
/clarent-methods:redteam docs/adr-014-event-sourcing.md
/clarent-methods:triz-matrix make /search faster without making it harder to run
The skills are manual-only (disable-model-invocation), so they cost no context until you call them. ach makes the agent list rival causes first, gather evidence by running commands, rate each item against all hypotheses, and re-score until one explanation survives or the diagnosis is declared unresolved.
Methods
| Method | Tool | Status |
|---|---|---|
| Analysis of Competing Hypotheses (Heuer, CIA) | ach |
implemented (reference) |
| Red Teaming (UFMCS) | redteam |
implemented (beta) |
| TRIZ contradiction matrix (Altshuller) | triz-matrix |
implemented (beta); additional method, outside the top-10 ranking |
| Statistical Process Control (Shewhart) on CI | spc |
spec |
| Commander's Intent / Mission Command | intent |
spec |
| Reference Class Forecasting | rcf |
spec |
| Kepner-Tregoe IS / IS-NOT | kt |
spec |
| Heilmeier Catechism | gate |
spec |
| Fault Tree Analysis | fta |
spec |
| HAZOP (guide words on APIs and data flows) | hazop |
spec |
| After Action Review (US Army TC 25-20) | aar |
spec |
| FMEA, STAMP / STPA | fmea, stpa |
deferred to v2 |
The ranking is the author's judgment, not a measurement; scores, criteria and the corrections made along the way are in research/ranking.md. 63 methods were catalogued, each source marked read / exists / blocked / unverified: research/.
What we do not claim
- That a skill makes an agent solve more tasks. gstack (one of the biggest repos in this space) publishes a null result on its own bug-fixing benchmark in its README; we will publish ours, null or not.
- That the numbers are Heuer's, Shewhart's or Goldratt's. Where a constant is ours (weights, thresholds) the method card says so.
- That the catalog's sources are all verified. Each one carries its verification level.
- That the TRIZ matrix data has a clean chain of title. Its licenses and gaps are written down in
DATA_LICENSE.md; 29 of its 1 248 cells are contested between transcriptions, and you can supply your own matrix with--data. - That the demos are real incidents. The examples are synthetic and labelled so.
- That the specified methods exist.
spc,intent,rcf,kt,gate,fta,hazopandaarare specifications; nothing is promised about when they ship. - That the red team's findings are correct. The engine rejects findings that are not quoted from the text or not backed by evidence; whether an attack is right is still a judgment. Three of its six attack classes (
scale,dependency,reversibility) are Clarent's own and are not in the UFMCS handbook it draws on. - That it works in agents other than Claude Code. The plugin is validated with
claude plugin validate; Cursor, Codex and others have not been tested. - That the ranking of methods is a measurement, or that its "no existing repo" findings are proof of absence: they are lower bounds from GitHub search.
Contributing
A new method is one folder, one card, one engine, tests and an example. Start with CONTRIBUTING.md; clarent doctor tells you what is missing.
License
Apache-2.0. See LICENSE.
Metadata
Release files for clarent-methods 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clarent_methods-0.1.1.tar.gz | 461.0 kB | With provenance | Details for clarent_methods-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clarent_methods-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for clarent_methods-0.1.1-py3-none-any.whl |
Total release size: 605.7 kB
Release files / clarent_methods-0.1.1.tar.gz
| Download URL | clarent_methods-0.1.1.tar.gz |
|---|---|
| Size | 461.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f22c722f44eb73a18a7b526cd78a9d77e0fb9661560f7e51a296f2c99430c8e3
|
|
BLAKE2b-256 checksum How to use checksums |
51f378ed5e2a5f532f240ea755ad3fc6154cfdba4945944d6de361cfb99d570f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / clarent_methods-0.1.1-py3-none-any.whl
| Download URL | clarent_methods-0.1.1-py3-none-any.whl |
|---|---|
| Size | 144.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b700c1ac456af5f3e06d4da62ff60fd81c8286c32215484df60a2c338d833688
|
|
BLAKE2b-256 checksum How to use checksums |
2ebabd7695bbe609d9113eb07fbaba609f1cf9b6f5d035a45429a90bdc9edf46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for clarent-methods 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for clarent_methods-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.