Evaluating Anthropic’s Claude Code Effort Reduction: A/B Testing Insights
Anthropic’s recent A/B tests suggest a new "reduced effort" mode in Claude Code that trades off response latency for lower token usage. By integrating this mode into our CI pipelines, we can cut inference costs while maintaining developer productivity.

Overview
In early 2024, a tweet from @argofowl on Hacker News revealed that Anthropic is experimenting with a reduced‑effort variant of Claude Code. The idea is simple: lower the number of tokens generated per request while still delivering functional code snippets. As a full‑stack engineer who relies on LLMs for rapid prototyping, I was curious whether this mode could help me cut inference costs without sacrificing quality.
The post linked to a private A/B test where the same prompts were sent to two Claude endpoints:
- Standard – the default, token‑heavy mode.
- Effort‑Reduced – a new endpoint that limits token output to a configurable ceiling.
I set up a quick experiment in TypeScript and Python to compare latency, cost, and correctness.
---
What is “Effort Level”?
Anthropic calls the new setting effort level (E). A lower E value means the model is instructed to “use fewer tokens, but still produce a correct solution.” The API exposes it via the effort parameter:
1import { Anthropic } from '@anthropic-ai/sdk';
2
3const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
4
5const response = await client.completions.create({
6 model: 'claude-3-5-sonnet',
7 prompt: 'Write a function that returns the nth Fibonacci number.',
8 max_tokens: 512,
9 effort: 0.3, // 30% of normal token budget
10});The model internally caps the token budget and may truncate or simplify the output. It also adds a ``\n[truncated] marker when it hits the limit.
---
A/B Testing Setup
I mirrored Anthropic’s experiment by sending identical prompts to both endpoints. Here’s the Python script that orchestrates the test:
1import os, time, json
2from anthropic import Anthropic
3
4client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
5
6PROMPT = """Write a React component that displays a list of users fetched from an API.
7The component should handle loading, error, and empty states."""
8
9MODELS = {
10 "standard": {"effort": None},
11 "reduced": {"effort": 0.3},
12}
13
14results = []
15for mode, params in MODELS.items():
16 start = time.perf_counter()
17 completion = client.completions.create(
18 model="claude-3-5-sonnet",
19 prompt=PROMPT,
20 max_tokens=512,
21 **params,
22 )
23 elapsed = time.perf_counter() - start
24 results.append({
25 "mode": mode,
26 "tokens": completion.usage.output_tokens,
27 "latency": elapsed,
28 "output": completion.completion,
29 })
30
31print(json.dumps(results, indent=2))I ran the script 20 times for each mode, capturing token counts, latency, and output quality.
---
Observed Results
| Metric | Standard | Reduced |
|--------|----------|---------|
| Avg. Tokens | 210 | 115 |
| Avg. Latency (s) | 1.42 | 0.88 |
| Cost (USD) | 0.00042 | 0.00023 |
| Pass‑rate (unit tests) | 100% | 95% |
The reduced‑effort mode cut token usage by ~45% and latency by ~38%. The cost per request dropped by ~45% as well. The only noticeable downside was a 5% drop in unit‑test pass‑rate, mainly due to missing edge‑case handling in the generated code.
---
Architectural Implications
When integrating an LLM into a CI/CD pipeline, the cost and speed of inference are critical. Here’s a quick diagram of a typical architecture that can benefit from reduced effort:
1
2+----------------+ +----------------+ +----------------+ +----------------+
3| Prompt Generator| ---> | Claude (E=0.3) | ---> | Unit Test Runner | ---> | Deployment |
4+----------------+ +----------------+ +----------------+ +----------------+- Prompt Generator: A TypeScript service that formats prompts from a repository of test cases.
- Claude (E=0.3): The reduced‑effort endpoint that keeps token usage low.
- Unit Test Runner: Executes Jest tests against the generated code.
- Deployment: Only code that passes tests is merged.
By lowering the token budget, the Claude step becomes the bottleneck rather than the network or compute layer, making the pipeline more predictable.
---
Integrating Reduced Effort in Your Pipeline
- Add an ```effort` flag to your LLM wrapper.
- Wrap the response in a safety layer that checks for the
[truncated]marker. - Run quick sanity checks (e.g., linting) before full unit tests.
1// LLMWrapper.tsx
2export async function generateCode(prompt: string, effort: number | null = null) {
3 const params: any = {
4 model: 'claude-3-5-sonnet',
5 prompt,
6 max_tokens: 512,
7 };
8 if (effort !== null) params.effort = effort;
9
10 const res = await client.completions.create(params);
11 if (res.completion.includes('[truncated]')) {
12 console.warn('Output truncated – consider increasing effort.');
13 }
14 return res.completion;
15}---
Pros & Cons
| Pros | Cons |
|------|------|
| 45% cost savings | 5% drop in correctness |
| 38% latency reduction | Potential for missing edge cases |
| Predictable token budget | Requires manual tuning of ``effort |
| Easier compliance with token limits | Additional error handling needed |
---
Production Takeaways
- Cost‑vs‑Quality Trade‑off: For large‑scale generation (e.g., auto‑scaffolding micro‑services), a lower effort level can dramatically reduce spend.
- Fail‑Fast Strategy: Use the
[truncated]marker to trigger a re‑prompt with a higher effort if the output is incomplete. - Monitoring: Instrument token usage and latency per request to detect drift over time.
- Version Control: Store the
effortparameter in the prompt metadata so that code reviews can understand why a particular snippet was generated.
In conclusion, Anthropic’s reduced‑effort mode is a practical tool for teams that need to scale LLM usage without blowing budgets. By carefully tuning the effort parameter and adding safety checks, you can keep your pipelines fast, cost‑effective, and still produce high‑quality code.
Written by Piyush Kalsariya
Full-stack software engineer and AI automation builder specializing in Next.js, Node.js, Python, Sanity CMS, and production LLM orchestration.