← Plugins

Switch provider

Continue an agent session on another provider and model, compacting large histories with links to a saved transcript.

$ paseo plugin add anh-chu/switch-provider
Report a bug
Switch provider screenshot 1Switch provider screenshot 2Switch provider screenshot 3

Adds a Switch provider… item to the Command Center (Ctrl+K or ⌘K) for an open agent. Paseo cannot change the provider of a running agent, so the item opens a picker that starts a new agent in the same workspace on the provider and model you pick. The picker then switches to the new agent. It lists the providers and models your daemon reports as ready.

Between Claude, Codex and pi, and between any of them and OpenCode, the plugin converts the old agent's saved session into the new provider's own session format with txcript, writes it into that provider's session folder, and imports it as a new agent. When the history fits the target model, the new agent has the full history, including tool calls and results. The chosen model is applied after the import. For any other provider, the plugin saves the full transcript as a Markdown file in the daemon's temporary folder and starts a new agent that reads it first.

The new provider receives the full conversation, including tool calls and their results, and handles it under that provider's own data policy. Switching to or from OpenCode needs the opencode command on the daemon's PATH, because the plugin uses it to export and import sessions. In the Markdown fallback, each tool call or result longer than 20,000 characters is cut at that length.

When the old session is larger than the new model can hold, the plugin compacts it first. It compares the session's size with the new model's context window, using 200,000 tokens when the daemon does not report one, and aims to use at most 60 percent of that window. The last ten turns stay word for word, or fewer if needed. Older history becomes a short list built without any model: your messages and the assistant's text, one line per tool call, and errors in full. It puts the session goal, detected edited files and commits, unfinished tasks, at the top. File and commit detection uses tool calls, so it can miss edits or mistake commands for changes. Reasoning text and images are dropped. Each line points to its place in a transcript file saved in the daemon's temporary folder, and the new agent is told to read that file when it needs exact details and to wait for your next message instead of resuming earlier work. The transcript can omit images, reasoning, and the ends of long tool results.

The old agent keeps running and is not archived. The plugin reads the old session file and writes new session files under ~/.claude, ~/.codex or ~/.pi, or the folders set by CLAUDE_CONFIG_DIR, CODEX_HOME and PI_CODING_AGENT_DIR. Conversion depends on txcript and on each provider's session format, which can change between releases; details that the target format cannot hold are lost. Needs Paseo 0.11 or later and the paseo command on the daemon's PATH.