# Import chat history with the sky CLI

> Move a local Claude Code or Codex session to your AgentSky workspace from the command line.

canonical: https://agentsky.dev/help/import-sessions-cli
source: https://agentsky.dev/help/import-sessions-cli.md
updated: 2026-10-22

---

**Move a local Claude Code or Codex session to your AgentSky workspace from the command line.**

`sky import` reads a local agent session and uploads it as a chat in your workspace. The imported chat is free — it does not cost compute. You can continue it in the cloud after import.

**How to import:**

1. In your terminal, run:
   ```
   sky import --current
   ```
   This imports the session the agent is running in, or the most recent Claude Code or Codex session in the current folder.

2. Review what will be sent and confirm (`-y` skips the question).

3. The session appears in your workspace as an imported chat.

**What gets imported by default:**

- The full conversation
- Skills and tool-server (MCP) setup
- Repository state
- The whole working folder, so the cloud agent starts with the same files

**Options:**

```
sky import --all                # import every session found, up to --limit
sky import --session <id>       # import one specific session
sky import --no-environment     # keep the folder on this computer; send only the files the chat touched
sky import --no-files           # send the conversation only
sky import --json               # print one JSON result per import
```

Where: terminal (any OS)

**Good to know:** the working folder is uploaded as it is on disk, so check it holds nothing you would not share with the workspace, or use `--no-environment`. The web equivalent is Settings › Advanced › Import. Related: [Import chats and setup from a local agent](https://agentsky.dev/help/import-from-local-agent), [Use the sky CLI](https://agentsky.dev/help/sky-cli-overview), [Use the trace library](https://agentsky.dev/help/trace-library).
