# FAQ

Short answers about credentials, models, packaging, storage, and resuming sessions.

## Which Credentials?

Native hosts discover logins on their own. `/login codex` and `/login claude` in [`nc`](/docs/guides/cli) store them in `~/.nanocode`, or in `$NANOCODE_HOME` when it is set.

| Harness | Discovery order                                                                                                                                                                                                 |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Codex   | The ChatGPT login in `~/.nanocode/auth.json`                                                                                                                                                                    |
| Claude  | The login in `~/.nanocode/claude.json`, then an existing Claude Code login: the `Claude Code-credentials` keychain item on macOS, or `~/.claude/.credentials.json` (`$CLAUDE_CONFIG_DIR` overrides `~/.claude`) |

To use API keys, pass `OpenAi::builder(key)` or `ClaudeClient::with_api_key(endpoint, key)`. WebAssembly hosts send no credentials from the module: the host adds them in `dispatch`.

```rust
// Sign Claude requests with an API key instead of a login
let claude = ClaudeClient::with_api_key(
    "https://api.anthropic.com/v1/messages",
    key,
);
```

## Which Models?

`nc models` lists every model with its thinking levels and service tiers. Model IDs and their short aliases are accepted wherever a model is named.

| Harness | Models                                                                                                                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Codex   | `gpt-6.1-sol` (`sol`), `gpt-6-luna` (`luna`), `gpt-6-astra` (`astra`)                                                                                                                                              |
| Claude  | `claude-opus-5-5` (`opus`), `claude-sonnet-5-5` (`sonnet`), `claude-haiku-5-5` (`haiku`), `claude-fable-5-1` (`fable`), `claude-mythos-5-1` (`mythos`), `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4-5` |

```bash
# Run one prompt on Luna at low thinking
nc exec -m luna -t low "List the TODO comments."
```

## An npm Package?

No. `nanocode-wasm` is not published to npm. Depend on it from git or with a `file:` link, then build `dist/nanocode_wasm.wasm` with `npm run build`, which needs Rust 1.97 and the `wasm32-unknown-unknown` target. The package exports the TypeScript source as `nanocode-wasm` and the module as `nanocode-wasm/nanocode_wasm.wasm`.

```json
{ "dependencies": { "nanocode-wasm": "file:../nanocode-wasm" } }
```

## Which Cargo Features?

None. The project adds no Cargo features by policy. Native-only code sits behind crate boundaries and `target_family = "wasm"` gates, so the same `nanocode` dependency builds for native and `wasm32-unknown-unknown` targets.

```bash
# Check every library target for both targets
cargo check --workspace --lib
cargo check --workspace --lib --target wasm32-unknown-unknown
```

## WASM Module Size

On 2026-10-20, the optimized module measured 8,314,227 bytes, or 2,529,519 bytes with `gzip -9`. It builds with `opt-level = "s"`. Sizes vary by a few kilobytes with the checkout's directory layout: on 2026-10-19, one commit built in two directories measured 8,344,975 and 8,353,723 bytes.

```bash
# Measure the module by crate (needs twiggy)
node scripts/measure-size.mjs
```

## Where Are Sessions?

Native hosts journal sessions to `~/.nanocode/sessions.jsonl`, with a rebuildable SQLite index beside it. `--home` or `NANOCODE_HOME` moves the directory. A `.durability(store)` call selects another `StateStore`, such as SQLite, Postgres, or `MemoryStore`. WebAssembly hosts store sessions through their `SqlHost`.

```bash
# List this workspace's saved sessions
nc sessions
```

## Resuming a Session

In `nc`, `-c` resumes the latest session in the workspace, and `nc resume` opens a picker. From Rust, `runtime.open_session(id)` reopens a session. Interrupted turns stay pending. Sending one again with its request ID finishes it, and committed tool calls replay their receipts instead of running again.

```bash
# Continue the latest session in this directory
nc -c
```

## Local Telemetry

`nc` records OpenTelemetry traces and metrics to files under `~/.nanocode/log/otel/` by default. Telemetry leaves the machine only when `--otel-endpoint` names a collector. `--telemetry off` records nothing.

```bash
# Run without recording traces or metrics
nc --telemetry off
```

## More

- [Getting Started](/docs/introduction/getting-started): Install nanocode and run a first turn.

- [Terminal UI](/docs/guides/cli): Sign in, pick models, and resume sessions with nc.

- [Durability](/docs/guides/durability): Journal turns and reopen sessions by ID.

- [CLI](/docs/api/cli): Every nc subcommand, flag, and environment variable.
