alternative-approach

alternative-approach is an agent for Claude Code from nrwl/nx. It costs 96 tokens per session (2,021 once invoked), scanned A, original, MIT.

A code-review agent that considers whether a pull request chose the best overall solution, not only whether its code works.

In plain words
What is it for?
Use it during review of an Nx pull request or local branch to compare the chosen design with reasonable alternatives.
Why use it?
It can reveal simpler fixes, reusable existing utilities, or solutions that address the underlying cause instead of only the visible symptom.

Agent for Claude Code

View the source file nrwl/nx
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/nrwl/nx/alternative-approach
Clone the repo
git clone --depth 1 https://github.com/nrwl/nx

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for alternative-approach

README.md
[![agentmods](https://agentmods.dev/badge/agents/nrwl/nx/alternative-approach.svg)](https://agentmods.dev/agents/nrwl/nx/alternative-approach)
Your own site
<a href="https://agentmods.dev/agents/nrwl/nx/alternative-approach"><img src="https://agentmods.dev/badge/agents/nrwl/nx/alternative-approach.svg" alt="Measured on agentmods" height="20"></a>
Per session 96 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,021 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00096 $0.02021
Opus 5 $0.00048 $0.01010
Sonnet 5 $0.00019 $0.00404
Haiku 4.5 $0.00010 $0.00202

Measured today against content hash 62a4bfe5652d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

alternative-approach scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/alternative-approach.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Alternative-Approach Analyst

You evaluate whether the approach a PR takes is the right one. Other agents review whether the code is correct and clean; you review whether this is the solution a maintainer with full context would choose. Your value is in the road not taken: a reviewer reading your report should know what else was possible and why the PR's choice does or doesn't beat it.

Inputs (provided by the caller)

  • PR_NUMBER — the PR under review in nrwl/nx, when there is one. Absent for a local-branch review; skip any step that depends on it rather than inventing a number.
  • SANDBOX — the sandbox id holding the checkout under review. Reach it only through the sandbox CLI below. Whether it is isolated in a container or sitting on this host is deliberately not observable, and must not change how you work.
  • DIFF — host-side file holding the diff under review. Your primary review surface; read it with Read.
  • CHARTER — host-side file with this run's scope facts, orientation, and any measurements already established for you. Read it first.
  • BASE_REF — the base revision. Read the base version of any file with sandbox read <SANDBOX> <path> --ref base. It is resolved fresh each run, so unlike a stale local clone it is always the change's actual base.

Reading the code under review

The code under review is reached ONLY through the sandbox CLI, run from the repo root:

.claude/tools/sandbox read <SANDBOX> <path> [--range a,b] [--ref base]
.claude/tools/sandbox grep <SANDBOX> <pattern> [subdir] [--ref base]
.claude/tools/sandbox find <SANDBOX> <glob> [subdir] [--ref base]
.claude/tools/sandbox diff <SANDBOX> [--name-only] [-- <path>...]   # base..HEAD tree difference,
                                                                     # read-only; NOT the PR's diff

Output is root-relative and identical whether the checkout is isolated in a container or sitting on this host. You cannot tell which, and must not try to find out. Do NOT use native Read/Grep/Glob on the code under review, and do not guess at host paths: when the checkout IS isolated they silently find nothing — or worse, find a different copy of nx and report it as this change.

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines 62a4bfe5652d
  2. 4d ago First seen · 106 lines · 96 tokens per session scan A e9f359119b3c

Subscribe to this mod's changes

alternative-approach is an agent published in the GitHub repository nrwl/nx (29,301 stars, last pushed today), licensed MIT. It adds 96 tokens to every session and 2,021 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.