Instances

One fx process can run several instances side by side. Each instance is a complete fx conversation with its own session, and each keeps working while another one is on screen.

Start fx with three instances:

$fx --instances 3

While more than one instance runs, the right side of the footer shows which one is on screen, such as fx 2/3 ↓. Press down with nothing typed to open the agent list and switch to another instance. With a draft, the footer shows fx 2/3 · ctrl+x, and ctrl+x opens the same list.

Start and close instances

CommandWhat it does
fx --instances <n>Start fx with n instances.
/launchStart another instance with a fresh session and show it.
/launch <profile>Start another instance in an agent profile and show it.
/closeClose the instance on screen and its subagents.
/agentsList the open agents and switch to one.

A new instance starts from the settings fx started with, including launch options such as --model. An instance you start in a profile takes the profile's model and effort, unless you chose a model with --model or FX_MODEL, or an effort with --effort. fx doesn't reread your settings for it, so a setting you change after fx starts reaches new instances the next time you start fx.

When you close the first instance, the next one becomes fx 1/n with its conversation intact. Closing the only open instance exits fx and prints its resume command.

/close works on an instance's screen. On a subagent's screen, switch back to its instance first.

Switch between instances

To switch, open the agent list in place of the footer:

  • Press down with nothing typed.
  • Press ctrl+x at any time, even with a draft. Each agent keeps its own draft, so yours stays on the agent you typed it on.
  • Run /agents.

Moving through the list with up and down shows each agent as you reach it. Press enter to stay on the agent shown, or esc to go back to the one you opened the list from. ctrl+x and ctrl+c also go back. While the list is open, other keys do nothing, so no key edits the shown agent's draft or answers its prompts. If the agent shown is waiting for an approval or an answer, the list takes the prompt's place, and the prompt comes back when the list closes.

Switching clears the screen and prints the chosen conversation in place. An instance that is off screen keeps working, so switching to it shows its output so far.

While an instance that isn't on screen waits for an approval, an answer, or a request only you can continue, such as one out of credits, the footer names it before the instance on screen, such as fx 3 needs approval · fx 1/3 ↓ or fx 2 needs you · fx 1/2 ↓. When one finishes a turn, the footer says so, such as fx 2 finished · fx 1/2 ↓, until you show it.

option+left, option+right, and option+up only move the cursor, as they do with one instance.

See every instance

The agent list shows every open agent, one per line. Each instance comes in the order it started, followed by its own subagents:

fx 1 (on screen) · Fix the login bug · main · working
  reviewer · Review the parser · reviewer · idle
fx 2 · Review the auth changes · main · needs approval
fx 3 · new session · main · finished

Each line shows the instance's number or the subagent's name, its session's title, its agent profile, and what it is doing: working, needs approval, has a question, needs you for a request only you can continue, finished for a turn that ended since you last looked at it, or idle. (on screen) marks the agent you opened the list from, which esc goes back to.

What each instance keeps

Each instance has its own:

  • Session and conversation
  • Draft and attached images
  • Model and reasoning effort
  • Permission mode and "don't ask again" approvals

Changing the permission mode with shift+tab or /permissions changes it only for the instance on screen. Permission rules in your settings apply to every instance.

A subagent started in an instance, or by one of that instance's subagents, starts from that instance's tools and permissions, and its prompts show on that instance's screen. See Subagents.

/new starts a fresh session in the instance on screen and leaves the others as they are.

Quit and resume

/exit ends every instance, and each one that has taken a turn keeps its own saved session. fx then prints the resume command for the instance you quit from, or, if that one hasn't taken a turn, for one that has:

Continue session with: fx --resume <session-id>

Resuming any session from a group of instances, with fx --resume <session-id>, fx -c, or fx -r, brings back the whole group. The session you resume becomes fx 1/n and is on screen, and the others follow in their saved order. An instance joins its group when its first turn is saved, so one you never used doesn't come back. A session you've deleted since stays out, and if another can't be loaded, fx says so and brings back the rest.

Each instance comes back in the agent profile it ran in. To resume the session in another profile, put --profile first, as in fx --profile main --resume <session-id>. The other instances keep their own.

/resume inside fx replaces only the session on screen, and the instance keeps its profile.