# Kiro CLI: error: Already logged in, please logout with kiro-cli logout first

> `kiro-cli login` refuses to start because it thinks a session already exists. The exact message, why Kiro prints it, and the fix.

_Updated November 23, 2026 · Checked against kiro-cli 2.24 to 2.34 (issue #11661, September 2026; also seen on 2.5.1 in #9103)., reproduced in EnvHaven 1.9.0_

## The message

```text
error: Already logged in, please logout with kiro-cli logout first
```

## What it means

`kiro-cli login` refuses to start because it thinks a session already exists. When KIRO_API_KEY is set in the environment, that key counts as being logged in, and `kiro-cli logout` can't clear it, so login and logout loop.

## Fix

1. Run `kiro-cli whoami` to see which method is active.
2. If KIRO_API_KEY is set (shell profile, CI secret, container environment), `unset KIRO_API_KEY` before running `kiro-cli login`.
3. Otherwise run `kiro-cli logout`, then `kiro-cli login`.

## In an EnvHaven workspace

Yes, until Kiro CLI is signed in once. Sign in once from the workspace's Launch menu (Sign in, or Set key for an API key); the sign-in stays on the workspace, across restarts and on every device.

## Where this comes from

This message was produced by Kiro (kiro-cli 2.24 to 2.34 (issue #11661, September 2026; also seen on 2.5.1 in #9103).) itself, in a throwaway EnvHaven 1.9.0 container, on 2026-11-23; the text above is copied from that output.

## Keep reading

- [Kiro](https://envhaven.com/agents/kiro)
- [Is Kiro down?](https://envhaven.com/status/kiro)
- [Every agent error](https://envhaven.com/errors)

Source: https://envhaven.com/errors/kiro/already-logged-in
