Without Agent Sidecar
unchecked final$2.84
per run
Agent Sidecar run
Without Agent Sidecar
unchecked final$2.84
per run
With Agent Sidecar
validated fix$1.41
per run
Agent Sidecar runs beside Codex and Claude Code, corrects failure modes mid-run, and proves whether the intervention helped
The warning
Fortune reported that Uber burned through its 2026 AI coding tools budget in four months after Claude Code adoption surged
Fortune on UberThat is where Agent Sidecar comes in: a runtime layer for Codex and Claude Code that cuts repeated loops, stale context, and wasted tokens so builders spend less per successful task.
Reuse approved local fixes as short runbook notes when the repo, task shape, and failure signal line up
situation / avoid / unlock
Keep hash-checked notes about important files so the agent does not keep rereading code it already understood
path / symbols / validation
Catch repeated attempts, stale evidence, drift, and low-progress runs before they burn another round of tokens
drift / stale / repeat
Score commands, edits, fetches, and searches for risk or waste before the agent stacks up avoidable work
command / edit / fetch
Convert vague requests into scoped task briefs, carry validation evidence forward, and trim low-value history
brief / constraints / proof
Ask cheaper configured models for narrow guidance when Codex or Claude Code needs direction, then spend less overall
low-cost steerers
Phase 1 Hook setup
Install the sidecar, start the daemon, and connect Codex hooks
$ python -m pip install agent-sidecar
$ agent-sidecar daemon start
$ agent-sidecar hook install --provider codex
hooks ready
Phase 2 Prompt enters Codex
The user asks Codex for a scoped auth fix while Agent Sidecar watches the workspace
src/auth/session.ts
01import { cookies } from "next/headers"
02import { redirect } from "next/navigation"
03import { refreshToken, readSession } from "./tokens"
04import { saveSession, clearSession } from "./store"
05import { validateSessionCookie } from "./validation"
06
07type User = {
08 id: string
09 email: string
10 session: string
11}
12
13export async function loadCurrentUser() {
14 const session = cookies().get("sid")?.value
15 if (!session) return null
16 return readSession(session)
17}
18
19export async function refreshSession(user: User) {
20 const token = await refreshToken(user.session)
21 saveSession(user.id, token)
22 return redirectAfterLogin(user)
23}
24
25function redirectAfterLogin(user: User) {
26 return redirect(`/account/${user.id}`)
27}
28
29export async function signOut() {
30 await clearSession()
31}
Phase 3 Prompt optimization
Agent Sidecar converts the vague Codex prompt into a compact task contract before the agent continues
Prompt optimizer
Original prompt
Login keeps breaking after token refresh. Can you figure it out and fix whatever is wrong?
Optimized contract
Task: Fix auth refresh so users stay signed in after token renewal
Scope: Inspect session persistence, token save path, and auth tests
Constraints: Keep the change narrow and avoid unrelated auth refactors
Validation: Run targeted auth refresh and login flow tests before final response
Phase 4 Runtime checks execute
Agent Sidecar runs the six controls before Codex spends more steps
Agent Sidecar runtime
Runbook memory
Find auth-refresh fix note
Repo map cache
Load session.ts ownership hint
Trajectory watchdogs
Watch for repeated edits
Tool-cost guardrails
Score command and edit risk
Prompt shaping
Replace vague prompt with task brief
Ensemble steering
Run low-cost guidance vote
Phase 5 Codex edits with steering
Codex applies the scoped fix using Agent Sidecar's optimized prompt and low-cost steering ensemble
18export async function refreshSession(user: User) {
19 const token = await refreshToken(user.session)
20- saveSession(user.id, token)
20+ await saveSession(user.id, token)
21+ await validateSessionCookie(user.id)
22 return redirectAfterLogin(user)
23}
Phase 6 Dashboard records the result
The control plane records the auth-refresh fix, the sidecar decision, and the cost saved against the unguarded baseline
Live runs
Guarded runs
18
Decisions
43
Saved lessons
9
Total cost saved
$4,820
Estimated from guarded runs compared with matched baseline traces, including the auth-refresh fix shown in this demo
This run saved
$1.43
$2.84 to $1.41
auth-refresh-fix
validated
billing-webhook
watching
worker-memory-leak
review
Selected trace
The dashboard is the control plane and replay UI. The core product is still the runtime pipeline: observe real agent runs, intervene on common failure modes, and measure whether interventions improve cost per successful task.
Live runs
guarded runs
18
decisions
43
saved lessons
9
total cost saved
$4,820
Estimated from guarded runs compared with matched baseline traces
auth-refresh-fix
healthy
billing-webhook
watching
worker-memory-leak
review
selected trace