The model for background tasks in Claude Code: ANTHROPIC_DEFAULT_HAIKU_MODEL

Coding with AIClaude Code·· 12 views· 3 min read

Besides the main model, Claude Code uses a second model for background work, which does not need a strong model. ANTHROPIC_DEFAULT_HAIKU_MODEL says which one. With All in One AI, it pays to point it at a fast, cheap model.

What this variable chooses

According to the Claude Code documentation, ANTHROPIC_DEFAULT_HAIKU_MODEL is the model for the haiku short name and for background functions. It also applies to subagents set up with model: haiku.

The value we recommend

export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-ai/deepseek-v4-flash"

Model Context What for
deepseek-ai/deepseek-v4-flash 1,048,576 tokens Fast and cheap, for background tasks and short questions.
zai-org/glm-5.3-flash 1,048,576 tokens Light and cheap, good for simple edits.

In settings.json, the same variable goes under the env key: "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-ai/deepseek-v4-flash".

If you do not set it

For background tasks, Claude Code asks for the model name it ships with. That name is not in the catalogue, because catalogue ids always have a slash. In that case, we use moonshotai/kimi-k2.7-code and charge its price. You end up paying for a coding model to do work a light model can do.

With the Coding Plan, stronger models spend more points per token. A light model for background tasks also saves points.

Older Claude Code versions

Older versions use ANTHROPIC_SMALL_FAST_MODEL, which the Claude Code documentation marks as deprecated. Check your version with claude --version. If you are not sure, set both to the same id:

export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-ai/deepseek-v4-flash"
export ANTHROPIC_SMALL_FAST_MODEL="deepseek-ai/deepseek-v4-flash"

The other short names have similar variables: ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL. See what happens when Claude Code asks for a claude-sonnet model.

Want to code with AI in Claude Code? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

Using Claude Code with All in One AI: the variables, the model and common errors

Claude Code asks for a claude-sonnet model: which model answers and what you pay

Saving the Claude Code setup in settings.json so you do not set the variables every time

Coding Plan: which plan to choose, what it costs and how to subscribe

Coding with AI in All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.