# Session Importer

> Recover Cline conversations stranded outside the desktop sidebar and import them so they can be searched and resumed. Works out of the box on macOS; ask your agent to adapt it to your preferred client, and share sessions between clients.

Session Importer is a free AI agent skill on Agensi by rADICor RNA, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [rADICor RNA](https://www.agensi.io/creators/radicor-rna)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/session-importer
- Tags: ai-agents, python, sqlite, macos, cline

## About this skill

### session-importer

Recover Cline conversations stranded outside the desktop sidebar and import them so they can be searched and resumed.

#### The problem

Cline stores sessions in more than one place on macOS, and only one of them reaches the desktop sidebar:

- Native — ~/.cline/data/sessions/<id>/ — already indexed, visible in the sidebar.
- Legacy — ~/.cline/data/tasks/<id>/ — the pre-sidebar flat task store (ui_messages.json, api_conversation_history.json). Never reaches the sidebar.
- Editor — ~/Library/Application Support/{Code, VSCodium, Cursor, Windsurf}/User/globalStorage/saoudrizwan.claude-dev/tasks/<id>/ — sessions from the Cline extension inside VS Code and its forks. Never reaches the sidebar.

If you used Cline in an editor and later moved to the desktop app, or switched editors, your old conversations are still on disk — but invisible. This skill finds them, normalizes them into one format, and imports them into the desktop store so the sidebar can search and resume them.

#### When to use it

- You switched from the Cline editor extension to the Cline desktop app and your old sessions are gone from the sidebar.
- You switched editors (VS Code to Cursor, Cursor to Windsurf, etc.) and want the sessions from the old editor back.
- You want a read-only report of what is indexed versus what is importable, before changing anything.
- You are setting up a new machine and want to carry your Cline history with you.
- You want to share sessions from one client to another — for example, move a conversation you had in VS Code's Cline extension into Cursor, or the other way round. Because every session is first normalized into one common format, the same record can be written into any client's store.

#### How to use it

Requires macOS, Python 3.12, and Cline installed. No dependencies beyond the Python standard library.

Read-only report: python -m session_importer scan (add -v to list every importable session)
Show what an import would do, without writing anything: python -m session_importer import --dry-run
Convert and register the pending sessions: python -m session_importer import

What the import does, per session:
1. Writes <id>.json (metadata) and <id>.messages.json (messages) into ~/.cline/data/sessions/<id>/.
2. Inserts a row into sessions.db.
3. Populates the FTS5 search index in session-search.db (one metadata document plus one document per message), so the session is searchable in the sidebar.

Safety guarantees:
- Scan is read-only. It opens the databases read-only and never writes.
- Dry-run writes nothing. import --dry-run reports exactly what would happen.
- Backups first. Before any write, both databases are copied to ~/.cline/backups/import-<timestamp>/.
- Atomic writes. JSON files are written via a temp file plus rename, so a crash never leaves a torn file.
- Idempotent. Re-running the import skips sessions that are already indexed and directories that already exist. Safe to run twice.

#### What it normalizes

Every source format is converted into one SessionRecord: session id, source, provider, model, working directory, start time, prompt, title (first meaningful line of the prompt), messages, and usage totals (input, output, cache read, cache write tokens). Transport chatter in the UI stream (api_req_started, api_req_finished, completion_result, etc.) is filtered out — only real conversational text is kept. The original path and format are recorded in the metadata, so an imported session always says where it came from.

#### Adapting this skill to your preferred client

This skill ships with the Cline-on-macOS importer working out of the box. If your client is not Cline on macOS, ask your agent to adapt this skill to your preferred client. The adaptation keeps the same shape and the same safety guarantees — only the storage locations and formats change.

To adapt it, your agent should:
1. Find where the client stores sessions. Look for its session/history directories and any index database. Start with the client's application-support folder and its extension storage.
2. Map the client's format onto SessionRecord. Write a loader in scanner.py that reads the client's session files and returns a SessionRecord with the same fields: session id, model, working directory, start time, prompt, title, and messages. Reuse text_of, truncate_title, and strip_mode_wrapper from model.py for the text handling.
3. Point paths.py at the new locations. Replace the Cline store roots with the client's. Keep the environment-variable overrides (CLINE_IMPORTER_HOME, CLINE_IMPORTER_EDITOR_ROOTS) so the adapted version stays testable.
4. Keep the importer unchanged. importer.py writes the normalized record into the desktop store — it does not care which client the record came from. The safety guarantees (read-only scan, dry-run, backups, atomic writes, idempotence) must survive the adaptation unchanged.
5. Verify with scan first. Run the read-only scan against the new client and confirm the importable count looks right before running import --dry-run, and the dry-run before the real import.

The pattern is: one normalized record, many loaders. A new client is a new loader, not a new tool. The same normalization is what makes sharing work: a session read from one client is already in the common format, so writing it into another client's store is the same write step with a different target — the importer does not care which client the record came from, or which client it is going to.

## Requires

- Python

## Known limitations

Requires macOS and Python 3.12. Only supports Cline-style session structures out of the box. Requires manual path configuration for non-standard editor installations.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Session Importer skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Why can't I see my old Cline conversations when I switch from VS Code to the desktop app?

This skill recovers fragmented conversation logs from VS Code, Cursor, and Windsurf, merging them into your Cline desktop sidebar so they are searchable and resumable in one place.

### Which operating systems and code editors are supported?

The skill is currently optimized for macOS and requires Python 3.12, supporting Cline and its popular forks like those found in Cursor and Windsurf.

### Is there a risk of corrupting my current session history during the import process?

Yes, the tool includes a safety-first workflow featuring a 'scan' mode for reporting, a 'dry-run' mode for verification, and automatic database backups before any writes occur.

### What exactly is included in the purchase of this skill?

You receive the complete Python-based migration tool, detailed documentation for execution, and a lifetime license for personal use across your local machines.

### Do I need to manually edit SQLite databases or JSON files to make the history appear?

No, the tool automatically handles data normalization and FTS5 search indexing, meaning your imported sessions will appear in the sidebar and search results just like native sessions.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
