Safeguard
Developer Tools•

Continue Safeguard CLI Sessions on Your Desktop and Phone

A Safeguard CLI session is live: it shows in the desktop and phone apps, where you read it, follow up and approve work on your computer. Here is how.

Safeguard Security Team
19 min read

Every Safeguard CLI session is live. Start it in your terminal and the same conversation shows in the Safeguard desktop app, the phone app and the web app. From any of them you can read what happened, ask a follow-up, and send new work back to the computer running the CLI, approving each command and file edit.

Switching to this way of working does not mean giving up the AI you pay for. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. If you also use the Claude or ChatGPT apps, connect them to the Safeguard MCP server and ask about your findings there too.

Facts here come from the Safeguard download page and docs as checked on 21 October 2026, the CLI's own help text, and three sessions we recorded that day on a Mac and an Android phone with CLI 11.11.0, desktop app 3.2.2 and Android app 2.0.3. The sample project, payments-api, holds test data only.

What you will have at the end

  1. A CLI session started in your terminal that fixes a real dependency finding, with every command approved by you.
  2. The same session open in the desktop app, with a follow-up task sent back to your computer.
  3. The phone app showing both conversations, and a task started and approved from the phone.
  4. The commands to pick a session back up in the terminal, name it, branch it or keep a run off the record.
  5. A way to pass links and text between your devices from the command line.

How a live session works

When you run safeguard in a folder and sign in, the session belongs to your Safeguard account rather than to that one terminal window. The CLI demo we recorded says it in one line: the session is live, so it also shows in the web, desktop and phone apps.

The work itself stays put. Files are read and edited by the CLI on the computer where it runs, in the folder you chose. The other apps are windows onto the conversation, and a way to send more work to that computer.

Where you areWhat you can do with the sessionHow you approve
Terminal (CLI)Start it, ask, scan, fix, resume it later in the same folderPress y or n at each prompt
Desktop app 3.2.2Read the whole run, follow up, send work to a computer running the CLIApprove or Deny
Phone appRead results, start "Work on my computer", follow upAllow once, Allow for turn or Deny
Web appThe same conversations in a browser, nothing to installIn the browser

Two conditions make it work. Every device must be signed in to the same Safeguard account. And for any new work on the computer, the CLI must be running there, either as an open terminal session or as a headless runner. The runner docs say all its traffic is outbound HTTPS that it opens itself, and nothing connects to it, so there is no port to open on your network.

Step 1: start the session in your terminal

Install and sign in

# macOS and Linux
curl -fsSL https://cli.safeguard.sh/install | bash
safeguard --version
# Windows (PowerShell)
irm https://cli.safeguard.sh/install.ps1 | iex

The installer checks the release's published checksum before putting anything on your PATH. Our Linux install guide covers distribution specific details.

Then open the interactive terminal in your project and sign in once:

cd ~/code/payments-api
safeguard

Type /login. Your browser opens, you approve the session, and the terminal picks it up. /whoami confirms the account. Use the same account you will sign in with on the desktop and phone.

Ask for real work

Type the request in plain words. In our recording it was:

fix the lodash CVE in this repo

Here is what happened, in order:

  1. It read first. The assistant looked up the finding in our Safeguard data, read package.json and the code, and checked the advisory. Reading needs no approval in the default mode.
  2. It edited the manifest. lodash went to 4.17.21 in package.json.
  3. It asked before installing. npm install waited for a y or n. npm's docs say npm install installs the dependencies listed in package.json and updates package-lock.json as well.
  4. It asked before testing. npm test waited again. Per npm's docs, it runs the command in the test property of the project's scripts object, so you are approving that project's own test script.
  5. It summarised. The test passed, a re-check found nothing, and the CLI suggested a commit message. It pushed nothing; pushing or a pull request only happens if you ask.

Click through the recorded terminal session below. After the fix it shows /permissions, /model and /scan . as well.

Click through it at your own pace, or open it full screen.

Give the session a name

If you will look for this session later on another device, name it when you start the CLI. The root help lists -n or --name for exactly that:

safeguard -n "payments-api lodash upgrade"

A name beats scrolling through a list of sessions that all start with "fix".

Step 2: pick it up on the desktop

Install the desktop app (version 3.2.2) from https://safeguard.sh/download. Windows 10 and 11 get one installer for x64 and ARM that installs per user with no admin rights; it is not yet code-signed, so check the SHA-256 before choosing More info, then Run anyway at the SmartScreen warning. macOS 12 and later get a signed and notarized Apple Silicon build, with an Intel build linked. Linux gets an x86_64 AppImage that needs the CLI on your PATH. Our desktop app guide walks through each one.

Then:

  1. Sign in with the same account as the CLI.
  2. Open the CLI session from the conversation list. In our recording it sat in the list alongside the other conversations, with no import step.
  3. Read the run. The whole terminal run is there: the request, what changed and how it was checked. The result card is the same summary the CLI printed.
  4. Check what this chat can use. The recording shows "2 connected": the computer running the CLI, the browser under Safeguard control with its Ask, Auto or Yolo setting, and Safeguard cloud.
  5. Send a follow-up to your computer. Type the next job in plain words. Before touching anything, the app asks which computer and folder to use: your computer, a recent folder, or Browse. Pick the project and click Open here.
  6. Approve each step. Each command shows exactly what will run, and Approve runs it once while Deny stops it. File edits wait too, and the card names the file, such as package.json in the chosen folder. A File changes list shows what has changed so far.
  7. Read the outcome. In the recording the desktop task ended with lodash upgraded, the lockfile matching and the test passing, and it pointed out other dependencies worth a look.

That last line is the natural follow-up. "Show me the other dependencies you flagged and what upgrading each would change" is a good next request, and you can send it from wherever you are.

Click through it at your own pace, or open it full screen.

Step 3: check and continue from your phone

Android phones and tablets install the app from Google Play. A direct APK with a published SHA-256 is offered for phones without Google Play or for company managed rollout. iPhone and iPad install from the App Store. Our Android guide covers installing and checking the APK.

In the Android session we recorded:

  1. The same conversations were already there. Both the chat started in the desktop app and the CLI session from the Mac were in the list after signing in.
  2. The result was readable on the go. Opening the desktop chat showed what changed on the computer and that the tests passed.
  3. Work on my computer started a new task. The app listed computers running the Safeguard CLI with their status; ours showed as online.
  4. A folder was picked. Browse to the project and tap Open here.
  5. The task was typed and sent. The work runs on the computer, not the phone.
  6. The command waited on the phone. The choices were Allow once, Allow for turn or Deny.
  7. The answer arrived. The tests passed, with the output and the steps taken.

Allow once runs that one command. Allow for turn says yes for the rest of that turn, so save it for a plan you have already read. Deny stops the step, and you can say what you want instead.

The phone suits short, checkable jobs: rerun the tests, scan this folder, show me what changed. Long refactors are easier to judge on a bigger screen.

Step 4: back at the terminal

When you sit down at the computer again, you have several ways to carry on.

Resume in the same folder

Inside the interactive terminal, /resume resumes your last session in this folder. The interactive docs put it as continuing your session the next time you open the terminal in the same folder.

cd ~/code/payments-api
safeguard
# then type /resume

Resume from the command line

The root help offers the same from flags, which is handy in scripts and shell aliases:

safeguard --continue              # continue the most recent session in this workspace
safeguard --resume                # resume the most recent session
safeguard --resume=<id>           # resume a specific session
safeguard --resume --fork-session # copy the session into a new one instead of extending it

--fork-session is worth knowing. It lets you try a different approach from the same starting point without adding to the original thread, which keeps the version your teammates saw on their phones intact.

Keep a run off the record

Sometimes you do not want a run saved at all. The help lists two flags for that: --private does not record the run in the session store, and --no-session-persistence does not write it to the session store. Use them for one-off questions you have no reason to revisit.

Keep long sessions readable

A session that has travelled across three devices can get long. /compact summarises the conversation to free context. /clear is different: it clears the conversation and forgets the context the assistant was carrying, so do not reach for it when you only wanted things tidier. /copy puts the last response on your clipboard, and Esc interrupts a running task without leaving the terminal.

Pass links and text between devices

Sessions are not the only thing that moves. The CLI has three small commands for handing things between your signed-in devices.

# which of your devices can send and receive
safeguard devices

# send a link or a note to one of them
safeguard send --to <device> --link https://docs.safeguard.sh/docs/cli
safeguard send --to <device> --text "Upgrade done, review the diff before lunch"
git diff HEAD | safeguard send --to <device> --stdin

# see what your other devices sent to this CLI
safeguard inbox
safeguard inbox open <id> --copy
safeguard inbox dismiss <id>

--to takes a device name, a unique prefix of one, or its id as listed by safeguard devices. --text takes up to 8,000 characters. The inbox can hold links, text, files and conversations; inbox open prints a link or text, copies text with --copy, opens a link in your browser with --browser, or shows where a file or conversation opens.

Sending git diff HEAD is a practical trick. Git's docs describe it as the changes in your working tree since your last commit, which is exactly what you want to glance at on another screen.

Keep the computer reachable while you are away

A phone can only send work to a computer whose CLI is running. If you close the terminal, use the runner instead:

# run headless in this folder until you stop it
safeguard runner start --workspace ~/code/payments-api

# or register it to start at login
safeguard login
safeguard runner install --workspace ~/code/payments-api

safeguard runner status
safeguard runner stop --workspace ~/code/payments-api
safeguard runner uninstall

The help says runner install registers a per user login service, a LaunchAgent on macOS, a systemd user unit on Linux and a logon scheduled task on Windows, so your phone or browser can send work to the machine from any network for as long as it is on. Apple's launchd docs note that a user agent runs only while that user is logged in. On Linux, systemd's loginctl enable-linger keeps a user manager running after logout if you need that.

Approvals follow you, and so does the mode

Every device shows the approval for the computer where the work runs. The mode on that computer decides what needs one. In the interactive CLI, /permissions offers these modes:

ModeRuns without askingAsks first
supervised (default)ReadsEdits and commands
editsEdits in this folder, read only commandsOther commands
planReading and planning onlyNothing changes
strictPre-approved actions only, for CIEverything else is denied
autonomousEverythingNothing

guarded is also available; run safeguard --help for what it approves. The --yolo flag selects autonomous when no mode is given, which approves everything. It is for throwaway sandboxes only, and never for a computer your phone can send work to. The headless runner takes its own --permission-mode flag.

If an edit turns out wrong, /rewind and safeguard checkpoints restore the files the assistant wrote or edited:

safeguard checkpoints list --session <id>
safeguard checkpoints restore <checkpoint> --session <id> --dry-run

The help is clear that anything a shell command writes is not snapshotted, so the lockfile changes from npm install need git, not checkpoints.

Do the work properly with the Safeguard CLI

The desktop and phone apps are where you follow along. The CLI is where the work happens. It scans code, container images and SBOMs on your own machine, sends only the results to the platform, and includes an assistant that can fix what it finds. It writes code, not only scans.

Install

curl -fsSL https://cli.safeguard.sh/install | bash on macOS and Linux, or irm https://cli.safeguard.sh/install.ps1 | iex on Windows. It is a single static binary with no Node, Python or JVM, for macOS, Linux and Windows on x86_64 or arm64; Windows is x86_64 only. safeguard self-update --check reports whether a newer version exists without installing it, and safeguard doctor diagnoses sign in, tools and policy without changing anything.

First session

Run safeguard, type /login, then /scan . to scan the current folder. Ask in plain language: "how many critical vulns do we have" or "fix the lodash CVE in this repo." Type @ to attach a file from the folder you started in, and /resume to pick up your last session there. /permissions sets how much the assistant may do without asking, and Esc stops a running task if you change your mind halfway through.

Writing and fixing code

The assistant has tools for your local files and for your Safeguard data and picks whichever the question needs. With your approval it writes files, edits code and runs commands, so it works as a general terminal assistant too; "what's the latest file in ~/Downloads" is one of the docs' own examples. Because it knows your vulnerabilities, a fix request is grounded in what is flagged for that project. Before merging anything another agent wrote, safeguard review reviews working tree changes for correctness and security, and safeguard review --base main diffs against a branch instead.

Your Claude, ChatGPT or Codex plan

The plan you already pay for works inside the CLI, with no extra Safeguard charge for that usage; its own limits and terms still apply. /model shows or switches the model and lists those available to your account. To connect a model, see the CLI docs or /model. To use Safeguard from the Claude app instead, see connecting Claude to the Safeguard MCP server.

Approvals

Tools that change things ask before they act, under the /permissions mode: supervised (the default), edits, plan, guarded, strict or autonomous. The same requests appear on the desktop and phone when work is sent from there.

CI with safeguard exec

safeguard scan --dir .
safeguard exec "summarise the critical findings in this repository"

safeguard scan writes JSON results such as vuln.json and license.json under ./output, and takes --repo, --image or --sbom too. safeguard exec runs one non-interactive turn; its default mode is strict, so anything the policy file has not pre-approved is denied, and it refuses to run outside a git repository. safeguard exec -c continues the most recent session in that workspace. See the safeguard exec CI guide. Policies and gates are evaluated in the platform, not by the CLI, and when the local runner runs platform scan jobs, only SBOMs and findings are uploaded, never source.

Troubleshooting

The CLI session is missing on the desktop or phone. Check that every device is signed in to the same account; in the terminal, /whoami shows which one. Different accounts never see each other's sessions.

The phone lists the computer, but not as online. The CLI is not running there. Open a safeguard session or start the runner, then check with safeguard runner status.

Requests from the phone take a long time to start on an office network. The runner long polls by default, with the server holding each poll up to 25 seconds. On networks that forbid held connections, start it with --poll-wait 0 to poll every SAFEGUARD_POLL_INTERVAL seconds, 10 by default.

/resume picks up the wrong session. It resumes the last session in the current folder. cd to the right project first, or use safeguard --resume=<id>.

Something else is off. Run safeguard doctor. It checks the environment, sign in, profile, policy and tools, and lists problems in the order that matters. Its exit code is 0 whenever the checks ran, so read the output.

Common mistakes

  • Starting the CLI in the parent folder. /resume and file attachments with @ work from the folder you started in. Start in the project.
  • Approving Allow for turn on a plan you have not read. It covers the rest of that turn.
  • Using /clear to tidy up. It forgets the context too. /compact is the gentle option.
  • Expecting checkpoints to undo npm install. Shell command writes are not snapshotted. Use git.
  • Leaving --yolo on. Never on a machine other devices can send work to.
  • Assuming the CLI pushed. It suggests a commit message and pushes nothing unless you ask.

FAQ

Does a CLI session really show on my phone?

Yes. A CLI session is live and shows in the web app, the desktop app and the phone app when they are signed in to the same account. In our Android recording, the CLI session from the Mac was already in the list.

Does my code move to the phone or desktop?

No. The CLI reads and edits files on the computer where it runs. The other apps show the conversation and send new work to that computer. What the assistant reads to answer you is part of the conversation with the model you chose.

Can I send new work from my phone?

Yes. "Work on my computer" lists computers running the CLI, you pick one and a folder, and each command waits for Allow once, Allow for turn or Deny.

Can I keep using my Claude, ChatGPT or Codex plan?

Yes. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. You can also connect Claude or ChatGPT to the Safeguard MCP server.

How do I continue a session in the terminal?

Type /resume in the same folder, or start with safeguard --continue. --resume=<id> picks a specific session, and --fork-session branches it.

Can I stop a run from being saved?

Yes. --private and --no-session-persistence keep that run out of the session store.

Is there an iPhone app?

Yes, for iPhone and iPad from the App Store. Our recording used the Android app.

Try it yourself

This is the phone side of the same flow, recorded on Android: see your desktop and CLI work, send a task to your computer and approve it from the phone.

Click through it at your own pace, or open it full screen.

Get the CLI, the desktop app and the phone apps from https://safeguard.sh/download, and keep https://docs.safeguard.sh/docs/cli open for the commands.

Quick check

What two conditions let your phone send work to your computer?

Both are signed in to the same Safeguard account, and the CLI is running on the computer, either as an open session or as a runner.

What is the difference between /compact and /clear?

/compact summarises the conversation to free context. /clear clears the conversation and forgets the context the assistant was carrying.

Which flag branches a resumed session instead of extending it?

--fork-session, used with --resume or --continue.

Sources

Last reviewed: 21 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.