What
ANTHROPIC_PROFILE is an environment variable naming the Anthropic sign-in profile Claude Code should use. When the named profile cannot be used, Claude Code now handles it more clearly.
- Errors: new messages explain why the profile is unusable (the name is invalid, there is no config folder, the profile is not found, its config is unusable, or it is signed out) and how to fix it. The session refuses to send your prompts until it is fixed. Cloud sessions and organization checks use the same messages.
- Status line: when you are not logged in and the profile is unusable, it shows "ANTHROPIC_PROFILE unusable" with a dimmed " · /status" hint, instead of "Not logged in · run /login".
- Transcript cleanup: if the profile gives no credential, Claude Code skips deleting old transcripts. In that case it cannot read the managed settings stored by
/login, and those may set a longercleanupPeriodDays. Fixing or unsetting the variable lets a later session run the cleanup.
Why
A mistake in your profile setup now points you to the real problem and to /status, instead of a misleading prompt to log in. Your transcripts are not deleted early under a retention period that might be wrong.
Names in the bundleANTHROPIC_PROFILEcleanupPeriodDays
Documented inapi/cli-sdks-libraries/cli/authentication
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Improved the claude.ai sign-in link shown by /login, claude auth login and claude setup-token: it is now much shorter