Skip to main content

Background Agents

Infinity Code runs a daemon process that manages your agent sessions. When you run infinity, it auto-launches the daemon if one isn't already running. This means you can have multiple agents working simultaneously — and keep them running even after you close the terminal.

Multiple Sessions

Each time you start a conversation with the agent, it creates a session. You can run several sessions at once:

  • /new (or Ctrl+N) — start a fresh session
  • /load (or Ctrl+L) — switch to an existing session

Each session has its own conversation history and thread tree. The session picker shows all your sessions sorted by last activity, so you can quickly jump back to whatever you were working on.

Backgrounding a Busy Agent

When you try to quit (/quit or Ctrl+C) while the agent is busy — running tools, waiting for results, etc. — a picker appears with two options:

  Shut down agent
▸ Continue running agent in background
  • Shut down agent — kills the session immediately
  • Continue running agent in background — detaches from the session. The agent keeps running in the daemon, finishing whatever it was doing. Reconnect later with /load.

If the agent is idle when you quit, it detaches automatically — no picker needed.

The same picker appears when you switch sessions (/new or /load) while the current agent is busy. You can background the current session and switch to another without losing any work.

Daemon Management

The daemon starts automatically on your first infinity run. To stop it manually:

infinity daemon stop

It will auto-start again the next time you run infinity.

Persistence

Conversation history is persisted to disk under ~/.infinity/. You can shut down the CLI entirely, boot it back up later, and continue right where you left off with all your existing context intact.