> For the complete documentation index, see [llms.txt](https://docs.loci-dev.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loci-dev.net/loci-plugin-for-ai-coding-assistants/loci-claude-plugin/authenticating-loci-claude-plugin.md).

# Authenticating LOCI  Claude Plugin

### Why sign-in is required

The `loci` CLI enforces sign-in on every command except five: `loci login`, `loci logout`, `loci auth status`, `loci doctor`, and an internal Stop-hook verb. Every other command — including ones that never touch the network, like `loci elf stack` — refuses to run if you're signed out.

In practice this means: **all 7 analysis skills require a signed-in session.**&#x20;

Only `/help`, `/loci:setup`, and `/bug-report` work signed out.

| Requires sign-in             | Doesn't require sign-in |
| ---------------------------- | ----------------------- |
| `loci-preflight` (automatic) | `/help`                 |
| `loci-post-edit` (automatic) | `/loci:setup`           |
| `/exec-trace`                | `/bug-report`           |
| `/stack-depth`               |                         |
| `/memory-report`             |                         |
| `/control-flow`              |                         |
| `/trends`                    |                         |

### Signing in

```
! loci login
```

(or `loci login` directly in a terminal). This opens your default browser to a one-time OAuth sign-in (PKCE flow). Free tier works on one repository, no credit card required.

Confirm it worked:

```
! loci auth status
```

Shows `signed_in` plus your session's expiry time.

### Where your session is stored

Your session token is stored in your OS's credential manager (keyring) when one is available. On hosts without a usable keyring (headless/SSH/WSL/Docker/CI), it falls back to a `0600`-permission file at `~/.loci/credentials.json`. `loci doctor` reports which backend is in use.

### Session expiry and re-authentication

Sessions expire after a period of inactivity. When that happens, the next analysis skill reports `auth_required` — run `! loci login` again and retry.

### Signing out

```
! loci logout
```

Removes your stored credential from both the keyring and the file fallback.

### Headless environments (no browser)

If Claude Code can't open your browser automatically, `loci login` prints the sign-in URL to the terminal instead — copy it into any browser to complete sign-in.

### Common issues

**A skill reports `auth_required`:**

1. Run `! loci login`, then retry the skill.
2. Confirm with `! loci auth status` that it now shows `signed_in`.

**A skill reports `quota_exceeded`:** this is different from `auth_required` — you're signed in, but you've hit your plan's daily limit. The error message includes the reset time. See Account Plans (or your current pricing page) to raise the limit.

### Related pages

* [Installing the Plugin](/loci-plugin-for-ai-coding-assistants/loci-claude-plugin/installing-the-loci-claude-plugin.md)
* [Skills Reference](/loci-plugin-for-ai-coding-assistants/loci-claude-plugin/skills-reference-for-loci-claude-plugin.md)
* [Troubleshooting](/loci-plugin-for-ai-coding-assistants/loci-claude-plugin/troubleshooting.md)
