Claude import exits 1 before it reads the source

John Burns

The CLI reference says claude import has been a command since Claude Code 2.1.213, and that it is unavailable when feature-flag fetching is turned off. The binary on this host is 2.1.308. Every import invocation still exited 1, and the text blamed the build:

`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.

That sentence does not name a source, a missing credential, or a feature flag. A job that upgrades past 2.1.213 because the docs name that version, or that retries after a newer build because the error names the build, is following a cause this command did not print.

What was run

The binary was Claude Code 2.1.308 on Linux x86_64, on 22 November 2026. claude --version printed 2.1.308 (Claude Code). claude doctor on a new home printed commit 320f66eb8f83 and install method npm-global. The same doctor report said managed settings were not fetched, because there were no usable credentials for the settings fetch, and that organization policy was not fetched because there was no API key or claude.ai sign-in. No claude auth login was run. No session was started. No prompt was sent to a model. The process environment had no CLAUDE_* or ANTHROPIC_* variables set before the cases below.

Each import used a new home. A Codex config file was present for the cases that named codex. It was not read. The refusal is the same when that file is absent.

claude import --help exited 0. It lists one argument, source, with the examples codex, gemini, and cursor. It lists --dry-run and --yes. The --yes line says a headless run must pass a digest from the /import preview. Nothing in that help text says the subcommand can refuse before it parses the source.

The source is not consulted

Eight invocations exited 1 with that same 120-byte message, and with empty stdout:

claude import
claude import --dry-run
claude import codex
claude import codex --dry-run
claude import gemini
claude import cursor
claude import notepad
claude import codex --yes

notepad is not one of the three sources in the help text. It failed with the same bytes as codex. --dry-run did not print a preview. --yes did not ask for a digest and did not change the exit. The command that help says will show what would be imported, and the command that help says will skip the picker, both stop at the same sentence.

A second set repeated claude import codex --dry-run with the environment left unset, with CLAUDE_CODE_DISABLE_FEATURE_FLAGS=1, and with DISABLE_TELEMETRY=1. A fourth run set both variables and called claude import notepad --yes. All four stderr files were byte-identical to the first refusal. Explicitly turning feature-flag fetching off, which is the condition the CLI reference names, does not change the text. Leaving those variables unset does not change it either. The message cannot tell you which of those states you are in.

On a fresh home, the refusal wrote no settings file and no import report. The Codex config that was already in the home was unchanged. --dry-run is not what kept the home empty. The command never reached a write.

What the docs call this

The CLI reference, read on 22 November 2026, describes claude import [source] as the way to start a session that runs /import and bring configuration from another coding agent into Claude Code. It says the command accepts the same --dry-run and --yes options. It says the command is not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, and that it is also unavailable when feature-flag fetching is turned off. It says the command requires Claude Code 2.1.213 or later.

This run was not those cloud providers. claude doctor did not report Bedrock, Vertex, Foundry, or a gateway. It reported an npm-global install that was not signed in. The reference’s version floor is 2.1.213. This binary prints 2.1.308. The refusal does not say “feature-flag fetching is off” and it does not say “not signed in.” It says the build does not have the command yet.

That is a worse hint than a missing flag. A missing flag tells you what to set. A version floor tells you what to install. “Not yet available in this build” tells you to wait for a binary you may already be running. The help text keeps advertising the sources while the subcommand rejects every string, including a string the help text does not list. A wrapper that branches on the source name will not see a usage error for a typo. It will see the build sentence, and it will see it for a correct source too.

The pointer in the refusal, to run claude and use /mcp or edit ~/.claude/settings.json, is not an import. This run did not start that session, so it does not say what /mcp would copy from Codex, Gemini, or Cursor. It says the shell command that help documents did not copy anything.

Verify the refusal before you change a binary

Do not treat claude import --help as evidence that the subcommand will run. On this binary, help exits 0 and the subcommand exits 1. Check the refusal text before you change a binary or a flag.

claude import codex --dry-run

If stderr is the build sentence, the source name was not the input that failed. Confirm that by repeating the command with a source you know is invalid.

claude import notepad --dry-run

If those two stderr files match, stop editing the Codex config. The config was not opened. Compare the text with a run that sets the variable the reference actually names:

CLAUDE_CODE_DISABLE_FEATURE_FLAGS=1 claude import codex --dry-run

On 2.1.308 those three stderr files matched. The variable did not add a line, and removing it did not remove the refusal. claude doctor is the command that states the credential gap. On the new home it said managed settings were not fetched because there were no usable credentials, and that organization policy was not fetched because there was no API key or claude.ai sign-in. Import did not repeat either sentence. If you need the feature-flag diagnosis, read doctor, or read the reference. Do not read it out of the import error.

A script that gates on exit status alone cannot tell a typo from a missing login from an explicit flag disable. Capture stderr. Require the source name to appear in the error before you repair that source. On this build it will not appear. That absence is the result. It is not a prompt to rewrite config.toml and try the same command again.

This run did not sign in, and it did not fetch feature flags by any other path. It does not say that a signed-in 2.1.308 would import a Codex config. It says that, without that fetch, the command you get is a build refusal that ignores the source, the dry-run flag, and CLAUDE_CODE_DISABLE_FEATURE_FLAGS. Waiting for a version greater than 2.1.213 will not change a refusal that 2.1.308 already prints.

Sources

  • Claude Code 2.1.308, commit 320f66eb8f83, Linux x86_64, 22 November 2026. claude --version, claude doctor, claude import --help, and the import invocations listed above, each on a new home. No login and no model call.
  • CLI reference, read 22 November 2026. It documents claude import, the 2.1.213 requirement, the provider limits, and the feature-flag-fetching exception.
  • claude import --help on this binary, which lists codex, gemini, cursor, --dry-run, and --yes.