onpath is a local-first safety and progress monitor for AI coding agents. It watches a session as it runs, detects when the agent gets stuck, and tells you exactly what happened — and what to run next.
What is onpath
You run your coding agent through onpath. It records the session locally, runs a set of detectors over the event stream, and generates a report. When a session starts looping — rerunning the same failing test, editing the same file without progress, or burning past a time budget — onpath surfaces a finding with a recovery prompt.
terminalsh
$onpath run--codexexec"fix the failing test"
Everything after -- is passed to the child process unchanged. onpath observes and records the run; the selected policy can warn, pause, or block when a finding crosses its threshold.
Who it's for
Solo developers using Codex, Claude Code, Cursor Agent, or OpenCode who want to know the moment an agent goes off the rails.
Engineering teams running many AI coding sessions who need aggregate visibility into where agents stall — without collecting raw transcripts.
Tech leads who want evidence, not vibes, about where AI time is wasted.
How it works
onpath spawns your agent as a child process and watches its event stream.
Commands, exit codes, file edits, and timings are written to a local SQLite database.
Detectors hash failure signatures, track edit churn, and watch the clock against your thresholds.
When a pattern crosses a threshold, onpath writes a finding, a markdown report, and a recovery prompt.
What onpath is not
onpath is not a surveillance tool. It does not rank individual developers, it does not upload your sessions by default, and its IDE and MCP surfaces are strictly read-only. Hosted analytics use explicitly uploaded, redacted summary payloads and never include raw transcripts or individual developer rankings.
onpath is distributed as a versioned Node.js CLI archive. Install it with the official script installer, then verify the local runtime and agent discovery.
Requirements
macOS 13+ or a modern Linux distribution validated
Node.js 24 LTS (Node ABI 137)
One supported agent on your PATH: codex, claude, cursor-agent, or opencode
Disk for the CLI archive plus a local SQLite store that grows with recorded sessions and reports
Windows and WSL are not supported or validated in this release. Use a validated macOS or Linux host.
Install
terminalsh
$curl-fsSLhttps://agent.onpath.run/install.sh | sh
Verify your install
Check the version and run the built-in doctor, which confirms onpath can find a supported agent and write to its local store.
terminalsh
$onpath--version0.1.0-rc.5$onpath doctor--json
Updating
Update by rerunning the script installer after a new archive release is published. Homebrew and npm publication are not the official release path for this RC.
Run a monitored agent, inspect detector findings and reports, then optionally expose the local read-only MCP resources to the same workspace.
1
Wrap your agent
Prefix any agent invocation with onpath run --. onpath records the session locally and arms its detectors. Everything after -- runs unchanged.
terminalsh
$onpath run--codexexec"fix the failing test"
2
Watch for findings
When a detector fires, human mode writes the finding type, redacted evidence, policy decision, and recovery commands to stderr. Use --json when another process needs the structured finding and policy decision.
terminalsh
$onpath run--json --codexexec"fix the failing test"
3
Read the report
Run onpath report for the latest session, then inspect or copy the latest stored recovery prompt explicitly.
Detectors are deterministic checks over the local session event stream. Project config controls shared thresholds and time budgets; typed policy JSON can enable, disable, or tune individual detectors.
How detection works
onpath normalizes each event — a command, an exit code, a file edit — and feeds it to every armed detector. Detectors are stateful within a session: they count repeats, measure churn, and track elapsed time. When a detector's condition holds past its threshold, it emits a finding with a severity and a recommended action.
Built-in detectors
Detector
Fires when…
Default
Severity
repeated-command
The same normalized command starts at least the configured threshold in one session
4×
warning
repeated-failure-output
The same failure signature recurs in failed command or terminal evidence
4×
warning
repeated-file-edit
The same hashed path changes five times without a successful command between the first and latest edit
5 changes
warning
time-budget-exceeded
Elapsed session time exceeds an explicitly configured time budget
budget required
warning
no-progress-session
The time budget is exceeded with no successful command and repeated command or edit evidence
budget required
warning
permission-wait
Terminal or failed-command evidence says that user permission or approval is required
enabled
info
rate-limit-wait
Terminal or failed-command evidence reports throttling, quota exhaustion, or HTTP 429
enabled
info
context-exhaustion
Terminal or failed-command evidence reports a context-window or token-length limit
enabled
warning
abandoned-subprocess
A failed or crashed session ends after a command start without a matching command result
enabled
warning
Failure signatures
For repeated failure detection, onpath first redacts known secret patterns and strips ANSI control sequences. It then keeps at most the last 12 error-relevant lines, or the last 12 non-empty lines when no error pattern is present, collapses horizontal whitespace, and stores a SHA-256 signature of that normalized output. Equal signatures mean equal normalized evidence; they do not prove a shared semantic root cause.
Failure excerpts remain local. Human warnings and default reports show hashes unless --include-raw-local-data is explicitly selected.
Tuning sensitivity
Project defaults live in onpath.config.json. threshold applies to repeated command and failure evidence, while timeBudget activates elapsed-time checks. Use typed policy JSON for detector-specific thresholds, cooldowns, enablement, and warn, pause, or block actions.
The public config command writes JSON project defaults in onpath.config.json. Policy decides what onpath does when a finding fires — warn, pause for a decision, or block the run.
onpath.config.json
onpath config print reads onpath.config.json in the project root, or the path passed with --path. Project config is merged on top of built-in defaults.
Print the finding and keep going. Nothing is interrupted.
pause
Halt and wait for you to continue, skip, or stop — with the recovery prompt shown.
block
End the current run immediately. A reason is required only when a matching policy rule selects bypass with requireReason: true.
Every pause and block decision — including bypasses and their reasons — is written to the policy audit log, rendered in local reports and redacted policy decision payloads.
Thresholds
The public config is flat JSON: threshold controls repeated command and repeated failure detection, while timeBudget controls elapsed-session warnings. Detector-specific thresholds and actions belong to typed policy JSON, not TOML sections.
Per-project overrides
Commit onpath.config.json to share project defaults. Hosted policy affects local runs only after onpath dashboard policy pull enrolls .onpath/team-policy.json. Matching policy chooses the most restrictive action; source precedence breaks ties.
onpath is local-first by default. Nothing leaves your machine unless you turn sync on — and when you do, you preview the exact, redacted payload first.
Local-first storage
Every session is recorded to a single SQLite file at .onpath/events.sqlite. Reports are written alongside it. You can export, inspect, or delete this data at any time — it is yours.
terminalsh
$onpath data list$onpath data export--session<session-id>--output./onpath-export.json$onpath data delete--session<session-id>
Redacted sync preview
Sync is opt-in, per project. Before anything uploads, onpath sync preview shows the exact payload. Raw command text and terminal output are excluded by default; failure signatures are hashed.
The current CLI has no automatic local retention setting. Use onpath data list and explicit session-scoped deletion.
onpath data delete --session <session-id> removes one local session.
Hosted retention, export, and deletion are managed from the connected workspace's Sync & privacy controls.
Team analytics never include raw transcripts or individual developer rankings. Hosted views are derived from strict summary payloads such as detector, severity, policy, and agent-key metadata.
onpath ships a Model Context Protocol server that exposes findings and recovery context to your agent — strictly read-only. Your agent can see that it's stuck; it can never act through onpath.
Overview
The MCP server reads from your local session store and serves a small, structured view of the current session: active findings, failure signatures, and the generated recovery prompt. Install it once per agent, scoped to a workspace.
Install for your agent
terminalsh
$onpath mcp installcodex--workspace.
terminalsh
$onpath mcp installclaude--workspace.
terminalsh
$onpath mcp installcursor--workspace.
Preview the exact configuration change without writing it, or remove an installed entry:
The MCP server exposes no write tools. It cannot run commands, edit files, or change policy. It only answers questions about the session onpath is already recording.
A Work Record binds approved intent, agent attempts, recovery lineage, evidence, independent verification, and the offline Trust Gate without turning onpath into issue management.
Local trusted-work flow
Create a draft from an intent contract, authorize its current revision, checkpoint the repository, and attach each monitored run to the Work Record.
terminalsh
$onpath work create--idGH-482--fileintent.json--json$onpath work authorizewrk_...--reason"approved scope"$onpath work checkpointwrk_...$onpath run--workwrk_...--rolegenerator--codex exec"implement the approved change"
Work state, Guard decisions, checkpoints, and evidence stay local unless you explicitly upload a redacted projection. The daemon does not contact hosted services automatically.
Guard and bounded recovery
Guard evaluates approved paths, commands, dependency and schema changes, budgets, and adapter enforcement fidelity. Native prevention is reported separately from wrapper-level or observe-only evidence.
When an attempt fails, create a Recovery Capsule from selected findings and an existing checkpoint, then start a recovery-role run with that capsule.
terminalsh
$onpath work recoverwrk_...--attemptattempt_...--checkpointchk_...--findingfinding_...--next-action"inspect the failing boundary"$onpath run--workwrk_...--rolerecovery--recovery-capsulercv_...--claude
Evidence, verification, and gate
Build a deterministic Evidence Pack from the append-only Work journal. Verification runs contract-declared checks against the frozen changeset and may add an independent Codex or Claude review. The Trust Gate evaluates current evidence offline and fails closed when required evidence is missing, stale, contradictory, or invalid.
terminalsh
$onpath evidence buildwrk_...--json$onpath evidence verify-pack<evidence-pack-directory>--json$onpath verifywrk_...--agentclaude--json$onpath work approvewrk_...--subjectreviewer@example.com--rolereviewer$onpath gatewrk_...--outputgate.json--json
Stable exit codes
Exit
Meaning
0
Command or gate completed successfully.
2
Invalid input or configuration.
3
Unsupported adapter or insufficient enforcement fidelity.