DEV Community

Cover image for How to Use Claude Fable 5 with Claude Code
Hassann
Hassann

Posted on • Originally published at apidog.com

How to Use Claude Fable 5 with Claude Code

Anthropic shipped Claude Fable 5 on June 9, 2026. For developers using Claude Code, the main reason to care is long autonomous coding work: repo-wide changes, migrations, large refactors, and multi-step implementation tasks that need to stay coherent across a large codebase. This guide shows how to run Claude Fable 5 in Claude Code, verify the active model, choose the right configuration method, and avoid accidentally spending Fable-level pricing on routine edits.

Try Apidog today

If you want a deeper primer on the model itself before configuring anything, see what is Claude Fable 5. This article focuses on the Claude Code workflow.

TL;DR

Install and authenticate Claude Code v2.1.170 or later, then select Fable 5 with one of these methods:

/model fable
Enter fullscreen mode Exit fullscreen mode

or:

/model claude-fable-5
Enter fullscreen mode Exit fullscreen mode

You can also launch Claude Code with:

claude --model fable
Enter fullscreen mode Exit fullscreen mode

or set:

export ANTHROPIC_MODEL=claude-fable-5
Enter fullscreen mode Exit fullscreen mode

Confirm the active model with:

/status
Enter fullscreen mode Exit fullscreen mode

Fable 5 costs $10 per million input tokens and $50 per million output tokens, which is 2x Opus 4.8. Use it for long-horizon work, not every small edit.

Claude Fable 5 with Claude Code

Why run Claude Code on Fable 5

Claude Code is Anthropic’s command-line coding agent. It can inspect your repository, edit files, run shell commands, and complete multi-step tasks from the terminal.

The model you choose determines how well Claude Code can keep context during a long task. Fable 5 is designed for long-horizon autonomous coding sessions, where the agent needs to maintain direction across many files and many steps.

Claude Code and Fable 5

Anthropic describes Fable 5 as a model that “stays focused across millions of tokens in long-running tasks and improves its outputs using its own notes.” Anthropic also published a Stripe migration example where Fable 5 completed a codebase-wide change across 50 million lines of Ruby in a single day. You can read the full announcement here: Claude Fable 5 announcement.

The tradeoff is cost:

Model Input price Output price
Claude Fable 5 $10 / million tokens $50 / million tokens
Claude Opus 4.8 $5 / million tokens $25 / million tokens

So the practical rule is:

  • Use Fable 5 for repo-wide migrations, large refactors, test generation across many modules, and long implementation sessions.
  • Use Opus 4.8 or Sonnet for normal edits, short debugging tasks, and isolated changes.

If you are comparing the two directly, see Claude Fable 5 vs Opus 4.8.

The mechanics are similar to other Claude Code model swaps, such as running GLM-5.1 with Claude Code. Only the model id changes.

Prerequisites

Before selecting Fable 5, check these requirements.

1. Update Claude Code

Fable 5 requires Claude Code v2.1.170 or later.

Update Claude Code:

claude update
Enter fullscreen mode Exit fullscreen mode

Check your installed version:

claude --version
Enter fullscreen mode Exit fullscreen mode

If you are on an older version, Fable 5 may not appear in the model picker.

2. Confirm account access

You need an Anthropic account or plan with Fable 5 access. Fable 5 is available on the Anthropic API and on supported plans such as Max, Team Premium, Enterprise pay-as-you-go, and similar plans.

Fable 5 is not the default model on any account type. You must explicitly select it.

Check Anthropic’s current model availability here: Anthropic models overview.

3. Confirm billing

Fable 5 is a paid model at:

$10 / million input tokens
$50 / million output tokens
Enter fullscreen mode Exit fullscreen mode

Make sure your account has active API billing or a qualifying subscription before starting a long run.

4. Open a repository

Claude Code runs inside a project directory. Start from the repo you want it to modify:

cd path/to/your-repo
claude
Enter fullscreen mode Exit fullscreen mode

5. Check zero data retention policy

Fable 5 is not available under zero data retention. If your organization runs Claude Code with ZDR enabled, Fable 5 may be omitted from the picker or shown as disabled.

That is a policy constraint, not a Claude Code bug.

Set Claude Code to use Claude Fable 5

Claude Code supports four main ways to select a model.

At session startup, model selection follows this priority order:

  1. In-session /model choice
  2. --model launch flag
  3. ANTHROPIC_MODEL environment variable
  4. model field in settings

You can use either:

fable
Enter fullscreen mode Exit fullscreen mode

or:

claude-fable-5
Enter fullscreen mode Exit fullscreen mode

The alias fable resolves to the recommended Fable version for your provider. The full id claude-fable-5 pins the exact model.

See the official reference here: Claude Code model configuration docs.

Option 1: switch in-session with /model

Inside a running Claude Code session, run:

/model fable
Enter fullscreen mode Exit fullscreen mode

To pin the exact model id:

/model claude-fable-5
Enter fullscreen mode Exit fullscreen mode

You can also open the picker:

/model
Enter fullscreen mode Exit fullscreen mode

Then select Fable 5 from the list.

In recent Claude Code versions, selecting a model through /model saves it as your default by writing the model field to user settings.

In the picker:

  • Press Enter to switch and save as default.
  • Press s to switch for the current session only.

Typing this directly behaves like the saved default path:

/model fable
Enter fullscreen mode Exit fullscreen mode

If the conversation already has output, Claude Code may ask for confirmation before switching models. That is expected. The next response re-reads the full conversation history without cached context, so switching mid-session can add a one-time token cost.

Option 2: launch with the --model flag

Use --model when you want one session on Fable 5 without changing your saved default:

claude --model fable
Enter fullscreen mode Exit fullscreen mode

Or:

claude --model claude-fable-5
Enter fullscreen mode Exit fullscreen mode

This is useful when running multiple Claude Code sessions side by side.

For example:

# Terminal 1: long migration
claude --model fable

# Terminal 2: small fix
claude --model opus
Enter fullscreen mode Exit fullscreen mode

The flag applies only to the session you launch with it.

Option 3: set ANTHROPIC_MODEL

Set the model from your shell:

export ANTHROPIC_MODEL=claude-fable-5
claude
Enter fullscreen mode Exit fullscreen mode

Or for a single command:

ANTHROPIC_MODEL=claude-fable-5 claude
Enter fullscreen mode Exit fullscreen mode

This applies to sessions launched under that environment variable.

One precedence detail matters: if ANTHROPIC_MODEL is set both in your shell and in the env block of settings.json, the shell export wins. The settings env object applies at startup but does not overwrite an existing shell variable.

Option 4: pin Fable 5 in settings

To make Fable 5 your persistent default, set the model field in your Claude Code settings file.

User settings:

~/.claude/settings.json
Enter fullscreen mode Exit fullscreen mode

Project settings:

.claude/settings.json
Enter fullscreen mode Exit fullscreen mode

Local project settings:

.claude/settings.local.json
Enter fullscreen mode Exit fullscreen mode

Minimal settings file:

{
  "model": "claude-fable-5"
}
Enter fullscreen mode Exit fullscreen mode

You can also use the alias:

{
  "model": "fable"
}
Enter fullscreen mode Exit fullscreen mode

Project and managed settings can take precedence on launch. If your team pins a project model, a teammate can temporarily override it with /model, but the project setting applies again when Claude Code restarts.

Verify you’re on Fable 5

Do not start an expensive long run until you verify the active model.

Inside Claude Code, run:

/status
Enter fullscreen mode Exit fullscreen mode

/status shows the active model alongside account information.

If you have a status line configured, the active model can also appear continuously in your terminal UI.

If /status shows Opus 4.8 instead of Fable 5 after you selected Fable, check for project or managed settings overriding your choice. Claude Code’s startup header tells you which settings file set the active model.

To override for the current session:

/model fable
Enter fullscreen mode Exit fullscreen mode

The project setting may apply again on the next launch.

Watch for fallback behavior

Fable 5 runs safety classifiers for cybersecurity and biology content. If a request is flagged, Claude Code can automatically rerun that request on the default Opus model, which is Opus 4.8 on the Anthropic API.

When this happens, Claude Code shows a notice in the transcript.

Anthropic reports that more than 95% of Fable sessions involve no fallback, so this should be rare for normal application code. But if you see a “switched to Opus” notice, that explains why a specific request did not run on Fable 5.

To return to Fable 5:

/model fable
Enter fullscreen mode Exit fullscreen mode

Practical workflow for long Fable 5 sessions

For long autonomous coding tasks, give Claude Code a scoped, verifiable assignment.

Instead of:

Refactor the API.
Enter fullscreen mode Exit fullscreen mode

Use:

Refactor the user billing API to separate request validation, business logic, and persistence.

Constraints:
- Keep public endpoint behavior unchanged.
- Update or add tests for changed modules.
- Do not modify unrelated routes.
- Run the test suite before finishing.
- Summarize changed files and any follow-up risks.
Enter fullscreen mode Exit fullscreen mode

For large migrations, add checkpoints:

Migrate the legacy payment service to the new repository structure.

Work in phases:
1. Inspect the current payment modules and list the migration plan.
2. Move files without changing behavior.
3. Update imports.
4. Run tests and fix failures.
5. Only then make cleanup changes.

Ask before deleting files or changing public API behavior.
Enter fullscreen mode Exit fullscreen mode

This keeps the run bounded and gives you review points before the model spends heavily on output.

Pairing Claude Code with Apidog

When Claude Code changes API code, the next step is validating that the endpoints actually work. A long autonomous run can touch many routes, and reading a diff is not enough to confirm runtime behavior.

This is where Apidog fits into the workflow: Claude Code writes or edits the code, and Apidog validates the live API behavior.

Pairing Claude Code with Apidog

A practical workflow looks like this:

  1. Ask Claude Code to update or generate an OpenAPI spec

If your repo already has an OpenAPI document, ask Claude Code to update it with the implementation.

Example prompt:

   Update the OpenAPI spec for every route changed in this branch.
   Keep schemas consistent with the actual response bodies.
Enter fullscreen mode Exit fullscreen mode

If the project does not have a spec, ask Claude Code to generate one for the changed routes.

  1. Import the spec into Apidog

Open Apidog, create or open a project, and import the OpenAPI file.

Apidog reads the paths, methods, parameters, and schemas and turns them into runnable requests.

  1. Run the changed endpoints

Start your local or staging server, then send requests from Apidog.

Check:

  • Status codes
  • Headers
  • Response body shape
  • Error responses
  • Auth behavior
  • Required and optional parameters
  1. Validate responses against the schema

Use Apidog to confirm that responses match the OpenAPI schema.

This catches drift between:

  • What the implementation returns
  • What the API contract promises
  • What clients expect
  1. Save passing requests as test cases

Once the changed endpoints pass, save the requests as regression tests.

The next time Claude Code or a developer changes those routes, rerun the suite and catch regressions quickly.

This pairing matters more with long-horizon models. The larger the autonomous change, the more runtime behavior you need to verify. A runnable suite in Apidog turns “Claude says it is done” into “the endpoints are confirmed working.”

You can download Apidog and import an existing spec in a few minutes.

Top comments (0)