Three ways to start a Claude Code session with Infa CLI: interactive, automated local, and remote cloud runs.
Infa CLI supports three distinct ways to run Claude Code sessions. Each mode suits a different workflow.
Copy link
Comparison
Interactive
Automated local
Remote / cloud
Trigger
infa session start
POST /api/sessions/run
Web UI queues a run
HTTP server needed
No
Yes (infa preview)
Yes (infa preview)
Git branch created
No
Yes
Yes
Hooks written
No
Yes
Yes
Supabase run record
No
Best-effort
Full
Auth required
No
Optional
Yes
Board required
No
Optional
Yes
Copy link
1. Interactive session
The simplest mode. Spawns a single claude remote-control process and streams its output directly to your terminal. No HTTP server, no database, no branch management.
infa session start # uses current directory
infa session start ~/my-project # or a specific path
The target directory must contain a .claude/ folder (i.e. be a Claude Code project).
◆ Claude Session
Starting remote-control session for: /Users/you/my-project
◆ Press Ctrl+C to stop
Claude prints a session URL to stdout once ready. Press Ctrl+C to stop.
No run tracking
Interactive sessions are not recorded in Supabase. Use the HTTP server modes if you need run history on your board.
Copy link
2. Automated local run
Start the preview server first, then trigger a run via the HTTP API. Infa will create a git branch, write hooks to .claude/settings.local.json, and spawn Claude with the run's environment variables.
1
Start the preview server
infa preview
2
Trigger an automated run
curl -X POST http://localhost:7100/api/sessions/run \
-H "Content-Type: application/json" \
-d '{"repoPath": "/path/to/repo", "prompt": "Refactor the auth module"}'
3
Monitor the session
curl http://localhost:7100/api/sessions
Returns status, session URL, branch name, and run ID for each active session.
What happens internally:
A git branch is created: feat/run_{runId}
git checkout main && git pull is run first
Hooks are written to .claude/settings.local.json (see Hooks & Agents)
Claude is spawned with INFA_RUN_ID, INFA_RUN_TOKEN, and INFA_PAPER_ID set
Hooks are deleted when the session ends
Copy link
3. Remote / cloud run
The fully automated mode. A run is queued from the Infa web UI (or via the Supabase runs table), and the local CLI picks it up automatically via Supabase Realtime.
Infa web UI
│ INSERT into runs (status='queued')
▼
Supabase Realtime
│ fires postgres_changes event
▼
infa preview (local)
│ receives the run + its run_configuration
├─ git checkout {base_branch} + git pull
├─ git create branch feat/run_{runId}
├─ write .claude/settings.local.json (hooks)
└─ spawn claude remote-control
env: INFA_RUN_ID, INFA_RUN_TOKEN, INFA_PAPER_ID
The CLI subscribes as soon as infa preview starts, as long as Supabase credentials and a valid auth token are available. Each incoming run is filtered by user_id — you only receive runs belonging to your account.
Run status updates (running → completed / failed / cancelled) are written back to the runs table in real time.
Realtime subscription starts automatically
You do not need to do anything extra. Run infa preview and any run queued from the web UI will execute on your machine.
Copy link
Stopping a session
For sessions managed by the HTTP server (modes 2 and 3):
curl -X POST http://localhost:7100/api/sessions/stop \
-H "Content-Type: application/json" \
-d '{"repoPath": "/path/to/repo"}'
The server sends SIGINT first, then SIGKILL after 5 seconds if the process hasn't exited.
For interactive sessions (infa session start), press Ctrl+C.
Copy link
Next steps
Hooks & Agents — what gets written to .claude/settings.local.json during automated runs
Run Modes
Infa CLI supports three distinct ways to run Claude Code sessions. Each mode suits a different workflow.
infa session startPOST /api/sessions/runinfa preview)infa preview)The simplest mode. Spawns a single
claude remote-controlprocess and streams its output directly to your terminal. No HTTP server, no database, no branch management.The target directory must contain a
.claude/folder (i.e. be a Claude Code project).Claude prints a session URL to stdout once ready. Press
Ctrl+Cto stop.Start the preview server first, then trigger a run via the HTTP API. Infa will create a git branch, write hooks to
.claude/settings.local.json, and spawn Claude with the run's environment variables.Returns status, session URL, branch name, and run ID for each active session.
What happens internally:
feat/run_{runId}git checkout main && git pullis run first.claude/settings.local.json(see Hooks & Agents)INFA_RUN_ID,INFA_RUN_TOKEN, andINFA_PAPER_IDsetThe fully automated mode. A run is queued from the Infa web UI (or via the Supabase
runstable), and the local CLI picks it up automatically via Supabase Realtime.Requirements: authenticated + board connected +
infa previewrunning.Flow:
The CLI subscribes as soon as
infa previewstarts, as long as Supabase credentials and a valid auth token are available. Each incoming run is filtered byuser_id— you only receive runs belonging to your account.Run status updates (
running→completed/failed/cancelled) are written back to therunstable in real time.For sessions managed by the HTTP server (modes 2 and 3):
The server sends
SIGINTfirst, thenSIGKILLafter 5 seconds if the process hasn't exited.For interactive sessions (
infa session start), pressCtrl+C..claude/settings.local.jsonduring automated runs