> refactor the auth middleware to use the session helper
⠋Forging…8s · ↑ 2.1k tokens
▲SponsoredRailway·Deploy from your terminal in minutes
✓ signature valid✓ not a duplicate✓ fraud-cleared
verified · +$0.014 earned
WaitLayer does not bill a surface until it can prove the wait.
The setup
A new attention surface
AI coding agents changed where developer attention lives. Developers now spend long stretches watching agents plan, edit, test, and refactor — inside terminals, not browsers. Those workflows are full of wait states: model thinking, tool runs, validation loops.
Traditional developer advertising lives in newsletters, docs, and dashboards. The developers most worth reaching are increasingly somewhere none of it can follow. Wait states are frequent, high-intent, and unmonetized — and extremely easy to get wrong. Developers will reject anything intrusive, creepy, or low-value in their terminal.
The wedge
The first thesis
The original idea was simple: developers are already watching AI agents work. If a clearly labeled sponsor line appeared tastefully during those waits, developers could earn from attention they were already giving — 70% of verified media spend — and sponsors could reach AI-native developers in a workflow-native moment.
Claude Code's statusLine looked like the fastest way in: visible, lightweight, native to the terminal. It became the wedge. It could not become the moat — but proving that took building it.
Constraints first
The rules were written before the features.
Never
Code access
Prompt access
Terminal output upload
Repo or file-path collection
Raw click payouts
Guaranteed earnings
Automatic payout
Always
A labeled Sponsored: line
Timing-only telemetry
Server-side billability
Manual review before payout
A privacy log you can read
Fail closed on any doubt
Uninstall that actually uninstalls
Enforced in code — the event schema has no field that could carry work content.
The constraint
Trust was the product
Developers don't want ads in their workflow unless the exchange is clear, valuable, and honest. So the constraints came before the features. The client can see timing — when bytes arrive, which direction they flow — and nothing else. No prompts, no code, no output, no file paths. A privacy log shows every developer exactly what would leave their machine.
And the money rule that shaped everything: the client can only nominate candidates. The server decides what's billable, every earning starts as pending review, and nothing pays out automatically.
The probe
The failed assumption
A sponsor impression is only legitimate if it appears during a real wait. Which raised an uncomfortable question about the wedge itself: could Claude's statusLine actually tell when the agent was working?
Rather than assume, I built a probe. Run it, use Claude normally for a while, and it quietly samples what the statusLine can see — update cadence, counter deltas, payload shape. Field names and timings, never content.
The statusLine turned out to be a rearview mirror. Its counters sat flat through an entire long think, then recorded the whole wait in one lump after the answer arrived — fifty-five seconds appearing in a single step, after the fact. It could show a sponsor line. It just couldn't prove anyone was waiting when the line showed.
That left one honest option: ship it permanently non-billable. The backend even has a structural backstop so the statusLine can never bill, even if its flag were flipped by mistake. The first obvious implementation wasn't good enough for the trust bar — so it doesn't earn.
If the vendor's hook can't prove a wait, own the runtime. WaitLayer wraps the agent in a pseudo-terminal — the agent behaves exactly as if launched directly, and the wrapper observes only byte-arrival timing, never content.
The counterintuitive insight that makes detection work: agents animate while they think. A spinner means output is flowing — so output flowing means busy, and quiet means idle. The opposite of naive idle detection. The detector layers hysteresis on top so a spinner's micro-pauses don't flap the state, and requires a wait to be established — two seconds of sustained busy — before anything can be counted.
The wrapper is also the defensibility: it doesn't depend on Claude, OpenAI, or any vendor preserving a monetizable hook.
The pipeline
Detect. Bridge. Render. Bill.
01Detect
The PTY wrapper classifies busy and idle from byte-arrival timing, four times a second. Content never enters the picture.
02Bridge
The detector publishes ephemeral local state with a two-second freshness window. Stale state means nothing renders.
03Render
The sponsor line appears only while the wrapper says fresh and busy — and disappears when the agent goes idle.
04Bill
The server decides billability. Only an actively-busy, established wait can mint an impression — the client just nominates candidates.
The primitive
A Verified Agent Impression
Most ad systems count views. A VAI has to pass proof and policy: a valid campaign and delivery token, an approved creative, a billable surface, a wrapper-detected established wait, five seconds of minimum visibility, no user input during the counted window, an eligible detector version, an opted-in and unmuted developer, fraud checks, and available budget — decided server-side, every time.
Waits of eight seconds or more earn the high quality tier; two to eight seconds, medium; anything less is diagnostic only and worth nothing.
Proof-gated
Rendered is not billable. Billable is not paid.
Rendered sponsor line
Shown only during a wrapper-verified wait. Rendering alone is worth nothing.
≠
Candidate impression
The client nominates; timing, surface, and detector metadata attached.
Everything lands as pending review. A human approves or rejects, on an audit log.
≠
Payout
Approval is not payout. Nothing pays automatically.
The math
The economics said no
The first calculator was honest and brutal. At a $20 CPM with a 70% developer share, a verified impression pays the developer $0.014 — and even heavy usage produced single-digit dollars per month. Worse, the ceiling was structural: developer payouts can never exceed funded sponsor spend, no matter how much wait time exists.
The economics reshaped the product. CPM-only became an earnback stack: base verified impressions, plus sponsor-confirmed qualified actions — a signup, a trial activation, verified by signed callbacks, never raw clicks — plus sponsor-funded compute credits against the bills developers actually resent: AI APIs, databases, deploys.
Clicks were deliberately demoted to attribution-only. Paying for clicks manufactures fraud; paying for sponsor-confirmed outcomes builds trust on both sides.
Unit economics
From 1.4 cents to an earnback stack.
$0.014
One verified impression, CPM-only. The model that failed.
Verified impressions ≈ $97.50
Qualified actions $60
Compute credits $40
One illustrative month≈ $197
Illustrative, not guaranteed.
Proof
The day it stopped being a theory
The checkpoint ran on one real machine with nothing mocked — Postgres, the API, the CLI, and an interactive Claude session doing actual work. I watched the sponsor line hold through a seven-second verified wait, twenty-five samples out of twenty-five, then vanish the instant the agent went idle.
Then I spent the afternoon trying to break it. Clicked the sponsor line: attribution recorded, zero earnings. Forged a callback signature: rejected. Sent an action with no impression to claim: rejected. Read the privacy log like a skeptic would: timings and reason codes, nothing else.
The best moment wasn't scripted. A rapid-fire render path I triggered by accident lit up the fraud system, which calmly rejected all 115 events as velocity farming. The first farmer WaitLayer ever caught was its own founder.
The checkpoint
The loop, proven end to end.
render gated by a real verified wait 25/25 ✓
established wait, high quality tier 7.25 s ✓
click redirect → earnings created zero ✓
qualified action → pending review credit ✓
bad HMAC signature rejected ✓
unattributed action rejected ✓
privacy inspection bannedFields: [] ✓
115-event velocity farm rejected as farming ✓
automatic payout none ✓
The marketplace
The cold start, and what we didn't build
The two-sided problem is explicit: developers want meaningful earnback, sponsors want verified outcomes, and neither commits first. The plan runs on proof — a small cohort of high-usage founding developers, a handful of founding sponsors funding bounded pools, compute credits creating real early value, and weekly proof reports turning verified data into the sales asset.
Just as deliberate is what doesn't exist yet: no public billability, no automatic payouts, no plugin sprawl across other agents, no self-serve sponsor marketplace, no earnings guarantees anywhere in the copy. The moat isn't another integration — it's accumulated proof.
Status
Where it stands
WaitLayer today is an internal product with an external posture: the loop is proven, the copy promises nothing it can't deliver, and the next milestone is a private beta with founding developers and sponsors. What's left to prove isn't mechanics — it's the market.
Scorecard
Proven — and not yet.
Validated
Wait detection
Render gating
Privacy-safe telemetry
Click attribution
Signed qualified actions
Manual review
Compute-credit lifecycle
Fraud velocity rejection
Not yet
Sponsor demand at scale
Developer retention
Real payout behavior
Long-term fraud rates
A marketplace needs one verified, auditable loop before it needs scale.
Lessons
What building it taught me.
The obvious implementation is rarely the right architecture
The statusLine got us started. The owned runtime made it defensible.
Monetization math must shape product strategy
The calculator's bad news was the best product input we got.
Developer trust is a feature
The privacy allowlist and manual review are the product, not paperwork.
A marketplace needs proof before scale
The first goal was one verified loop, not a thousand users.
Outcome data is the moat
Renders are easy to copy. Verified actions, fraud decisions, and renewals compound.
The principle
Don't bill what you can't prove.
The internal loop now proves it end to end. The next step is turning that proof into the first sponsor-funded developer earnback pool.