Hitesh · StockDrifts
STOCKDRIFTSRESEARCH

The loop is leaving the terminal.

Nine open-source agent harnesses, read from source. Then Amplitude's Q2 call and the Wave demo: the same observe → act → verify loop that runs coding agents is about to run your product — and rewrite the job called "product manager".
PROMPTS READ FROM SOURCE 9 HARNESSES · AMPL Q2 + WAVE BIA HUBS · BERLIN · SEP 15 2026
→ to advance
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Executive summary

Every frontier agent is the same ~200-line loop; the winners compete on context — and Amplitude just pointed that loop at the product itself.

01 — The same loop
~200 lines
Send transcript + tool schemas, run what comes back, append, repeat. All nine coding products run this identical core — Claude Code to DeepSeek. Everything else is differentiation.
modeltoolsappend
02 — Where they compete
context
Prompts span 374 → 3,917 words; DeepSeek assembles its whole prompt from plugins in 702. The edge is compaction, KV-cache discipline, subagent isolation, sandboxes — not the loop.
prompttoolsloop ctxsafetymem
03 — The next host: your product
sense → act → learn
Amplitude Wave runs the loop over analytics, replays, feedback and traces; Cursor writes the PR; Statsig rolls it out. Demo receipt: "No engineers, no designers, and no product manager."
sense decide act learn
If you remember one line: the PM of 2027 doesn't write the roadmap — they write the harness the roadmap comes out of.
Sources: Harness Lab (9 harnesses, prompts read from source, Jul–Aug 2026) · Amplitude Q2 FY26 call + Wave demo, Aug 2026
stockdrifts.io · 02 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part A · what the harnesses taught us

Anatomy of a harness: one loop wearing different clothes, six places to compete.

system prompt+ transcript + schemas model tool calls execute plain text= done append results → repeat
01System promptIdentity, tone, coding rules, output format. 370–4,000 words — the most legible part, and increasingly the smallest.
02ToolsFrom 3 (Codex: shell, apply_patch, update_plan) to ~18. Edit-format wars: exact-string replace vs custom diff grammars.
03The loopTurn-taking, parallel tool calls, background jobs, preserved thinking blocks carried between turns.
04Context managementThe 2026 battleground: compaction prompts, KV-cache discipline, subagent isolation, Kimi's D-Mail rollback, DeepSeek's event-sourced session log.
05Safety & permissionsOS sandboxes (Seatbelt / Landlock) crossed with approval policies. Hooks for deterministic guardrails.
06Memory & extensibilityAGENTS.md / CLAUDE.md, skills with progressive disclosure, MCP as the universal tool bus, everything-as-a-plugin.
Source: Harness Lab — anatomy distilled from 9 harness codebases & prompts (Claude Code, Codex, Gemini, Kimi, Grok, OpenCode, Hermes, GLM, DeepSeek)
stockdrifts.io · 03 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part A · the players

Nine harnesses, nine philosophies — from three tools to everything-is-a-plugin.

Claude Code
Anthropic · the feature-maximal one
Popularized CLAUDE.md, hooks, skills, subagents, plan mode. Design center: context is the scarcest resource — progressive disclosure everywhere.
skills · hooks · subagents
Codex CLI
OpenAI · the minimalist
Three tools + OS-level sandboxing instead of per-tool prose. Per-model prompts: codex-tuned models get ⅓ the words — behavior is trained in.
3 tools · sandbox × approval
Gemini CLI
Google · the benchmarked prompt
Teaches the model the token economics of its own strategy; repo gates prompt edits behind SWE-bench runs. Self-healing sandbox.
prompt = tested code
Kimi CLI
Moonshot · the context innovator
D-Mail lets the model roll its own context back to a checkpoint, replacing dead ends with a note to its past self. K3: preserved thinking is mandatory.
D-Mail rollback
Grok Build
xAI · anchored edits
Small general prompt (668 words) and the most novel editor: hashline anchors — content-hashed line refs, atomic batch edits.
hashline · 2-level compaction
DeepSeek Harness
DeepSeek · the plugin purist · Aug 2026
206K stars in 18 days. Everything is a plugin — even the agent loop; 405 packages; runs Codex and Claude Code as its subagents; 842 design notes written by agents.
everything-is-a-plugin
OpenCode
SST · the model-agnostic switchboard
Ships seven system prompts (anthropic.txt, codex.txt, kimi.txt…) and picks one per model family — prompts are written per model, not per product.
7 prompts
Hermes
Nous · harness as text
Tool schemas live inside the prompt; calls come back as JSON tags — portable to any stack. Hermes Agent writes its own skills after each task.
374 words · self-writing skills
GLM / Z.ai
Zhipu · the contrarian
Builds no harness at all: Anthropic-compatible API, model trained to fit Claude Code's conventions, sold as a coding plan. The harness is a commodity.
borrow the harness
Source: Harness Lab — repos cloned & read Jul 19 + Aug 31, 2026; closed harnesses from first-hand session notes
stockdrifts.io · 04 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part A · measured · wc -w on source

Prompt size is a design decision: when behavior is trained in, the prompt shrinks 3×.

Core system prompt length (words, excl. tool schemas)
measured Jul 19 / Aug 31 2026 from cloned repos · gray bars = estimates (runtime-assembled or not fully public)
Gemini CLI — assembled coresnippets.ts (runtime-assembled)
≈ 4,200
Codex — base GPT-5 promptprompt_with_apply_patch_instructions.md
3,917
Claude Code — core promptfirst-hand; excl. tool descriptions
≈ 3,000
Kimi CLIagents/default/system.md
2,239
Z.ai Codecaptured prompt
1,393
OpenCode — Claude variantsession/prompt/anthropic.txt
1,335
Codex — codex-tuned promptgpt-5.2-codex_prompt.md
1,221
DeepSeek Harness — assembled defaultsnapshots/…/system-prompt.expected.md
702
Grok Build — main templatexai-grok-agent/templates/prompt.md
668
Hermes — function-callingprompt_assets/sys_prompt.yml
374
−69% · SAME PRODUCT OpenAI ships 3,917 words to general GPT-5 but only 1,221 to codex-tuned models — trained-in behavior needs no prose. DeepSeek goes further: no prompt file exists; each plugin owns its own paragraph and 175 snapshot tests pin the result.
Source: Harness Lab — wc -w on repo files; estimates flagged. 11× spread across the field
stockdrifts.io · 05 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part A · primary sources · verbatim

Read from source: the prompts say the quiet part out loud.

codex/prompt_with_apply_patch_instructions.md✓ source
"Do not waste tokens by re-reading files after calling apply_patch… The tool call will fail if it didn't work."
gemini-cli/…/snippets.ts · engineering comment✓ source
"You must run the major benchmarks, such as SWEBench, prior to committing any changes to the Context Efficiency section."
kimi-cli/…/dmail · tool prompt✓ source
"You are basically folding the recent messages in your context into a single message… Just explain to your past self."
grok-build/…/templates/prompt.md✓ source
"Weigh each action by how easily it can be undone and how far its effects reach… One approval is not a blank check."
deepseek-harness/snapshots/…/system-prompt.expected.md✓ source
"Your bash tool runs under a file sandbox — a [sandbox: file access denied …] result is policy, not a command bug."
kimi-cli/agents/default/system.md · Ultimate Reminders✓ source
"ALWAYS, keep it stupidly simple. Do not overcomplicate things."
Source: Harness Lab prompts/ — verbatim files cloned Jul 19 & Aug 31, 2026; every quote checked against repo text
stockdrifts.io · 06 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part A · the irreducible core

The whole thing is ~15 lines — everything nine companies do is a refinement of three rules.

msgs = [system_prompt(cwd, os, date, agents_md)]  # stable prefix — never edit
msgs.append(user_msg)
while True:
    resp = model(msgs, tools=[shell, read, edit, write, todo])
    msgs.append(resp)
    if not resp.tool_calls:
        break                                  # plain text = final answer
    for call in resp.tool_calls:               # parallel if independent
        gate(call)                             # permission check / sandbox
        msgs.append(tool_result(call, run(call), cap=25_000))
    if tokens(msgs) > 0.8 * window:
        msgs = [msgs[0], compact(msgs), *msgs[-K:]]  # dedicated summarizer
Rule 1
Append-only, stable prefix. No timestamps in the system prompt, no editing history — this is what keeps the KV cache hot. A cache miss costs 10×.
Rule 2
Cap every tool result (~25k tokens, keep head + tail). One verbose build log otherwise eats the window.
Rule 3
Compact at 80% with a structured summarizer: current task, errors + fixes, decisions, file paths. Keep last K turns verbatim.
Source: Harness Lab §07 — the loop every harness runs, distilled to pseudocode. Remember this shape — it comes back on slide 09
stockdrifts.io · 07 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · the bridge

Coding agents collapsed the cost of build; "use" and "learn" still crawl by hand — so the next loop wraps the product, not the repo.

Amplitude on itself · Q2 FY26 call
Pull requests
3×
in six months, after bringing AI into PM, design and go-to-market
PR cycle time
5h → 44m
merge cycle, org-wide
Bug reports
−55%
while shipping 3× more
PRs by non-engineers
5%
submitted by designers and PMs with no engineering involvement
USEby hand LEARNby hand BUILDcost → 0 SHIPflags the product loop · Wave automates the red boxes
"Coding agents are collapsing the cost of build to zero. But use and learn still crawl by hand."amplitude.com/wave · the reason Wave exists
"What we're seeing is a convergence between engineers, product managers, and designers into this AI builder persona… you have product managers who are also just shipping code."Spenser Skates, CEO · Q2 FY26 call, Aug 2026
Sources: Amplitude Q2 FY26 earnings call (Aug 2026), prepared remarks + Q&A, verbatim · amplitude.com/wave
stockdrifts.io · 08 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · same loop, product tools

Wave is the harness loop with product tools: sense → decide → act → learn — subagents, sandbox review, memory and a human gate included.

ctx = [taxonomy, metrics, area_memory]   # stable prefix = tracking plan
while True:
    sig = swarm(scoped_agents,                  # ~80B events / day
        over=[analytics, replay, feedback, errors, traces])
    cards = decide(sig, rank_by=impact_metric)  # cited opportunity cards
    for card in human_approve(cards):     # hardest funnel: ~11% ship
        pr = route(card, cursor | claude_code | experiment | human)
        review_agent(pr).test().replay()  # validation before victory
        statsig.rollout(pr, 1% → 100%, auto_rollback=True)
        measure(card.metric, until=stat_power) # Shipped → Measured
    memory += reflect(approved, rejected, notes) # per-area memories
Rule 1 → stable taxonomy
Event names + metric definitions are the product's KV cache. Rename an event mid-stream and every downstream agent cache-misses.
Rule 2 → capped, cited signals
One impact metric per card, every claim cited. A quality judge scores citations at 80% F1 — replay analysis is noisy, references go stale.
Rule 3 → reflection = compaction
Approvals, rejections and notes distill into per-area memory. Positive feedback rate went ~5% → 70%+ as memory compounded.
Source: "Inside Amplitude Wave" (amplitude.com/blog/wave, Jun 10 2026) — architecture, funnel numbers and failure modes as published; pseudocode is my rendering
stockdrifts.io · 09 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · the demo · Aug 2026

The demo: Wave found failing searches, wrote the spec, Cursor wrote the code, a technical writer merged it — no engineer, no designer, no PM.

01 · Sense
Search failuresSwarm spots rising failed searches across analytics + replay.
02 · Evidence
Problem cardPlain-language problem statement with a full explanation of the evidence.
03 · Plan
Wireframe + spec3-character minimum, 200 ms debounce before triggering search.
04 · Act
PR auto-created"Cursor wrote the code." Review agent runs tests, records a replay.
05 · Human gate
Merged by a writerMark, technical writer, merged and shipped it. Approval, not authorship.
06 · Learn
Measured"Massive decrease in total search failures." Card moves Shipped → Measured.
"Wave can also drive execution. It automatically created the pull request and Cursor wrote the code. Mark, our technical writer, was able to merge this pull request and ship this. No engineers, no designers, and no product manager. Finally, Wave measures the results of the change."Spenser Skates, CEO · Q2 FY26 call demo, Aug 2026
"We've been talking about self-improving products here at Amplitude for about nine years… it's the perfect problem for AI: the data sets are massive and complex, so you can't get any human to look at them."Skates · Q2 FY26 Q&A — why it's happening now, not in 2017
Ship rate · mature codebase
~11%
of opportunities ship end-to-end vs 50% the team says it "would do". The human funnel is the hardest.
Greenfield codebase
101
features shipped in one week where nothing was legacy.
Status
CLOSED BETA ROLLOUT H2 2026  Runs on Amplitude itself: auto-triaging bugs, optimizing landing pages, sharpening its own agents by analyzing their traces.
Sources: Amplitude Q2 FY26 call demo (Aug 2026), verbatim · amplitude.com/wave · "Inside Amplitude Wave" (Jun 10 2026) for funnel numbers
stockdrifts.io · 10 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · it's a trend line, not a demo

Agents already produce 40% of the insights on Amplitude's platform — up from zero in October 2024.

Insights from agents, not humans
40%+
Oct 240% Q1 2625% Q2 2640%+
share of queries (Q1) / insights (Q2) generated by AI agents
Global Agent
1.3M
interactions per week; root-causes 75% of customer questions, improving +1 pt / month
MCP tool calls
1.21M
per week from Claude, Cursor & co. — the product is becoming a tool other agents call
The Economist · "Lens"
96.9%
task success; weekly failures −84% once Agent Analytics scored every answer instead of sampled reads
AI-native customers
40+
pay >$100k/yr: Harvey, Midjourney, Character AI, a leading foundation-model lab
ARR · Q2 FY26
$410M
+22% incl. Statsig; record FCF $23.7M; gross margin held in the low 70s by design (inference)
Market read · $AMPL
$7.66 → $13.02
Jun 8 → Sep 4, 2026, +70%. Bear case: "a race car without a driver" — Statsig's team stayed at OpenAI. Not investment advice.
Sources: Amplitude Q2 FY26 call (Aug 2026) · Q1 FY26 call (agentic share) · amplitude.com live stats, Sep 6 2026 · FMP quote · Optimizely CEO quote via press, May 2026
stockdrifts.io · 11 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · the permission system

Statsig is the sandbox × approval layer for product change: gates say what's possible, rollouts say when, auto-rollback is the hook.

Coding harness  →  Product harness
  • Sandbox mode (read-only / workspace / full) → Feature gate: what is technically live for whom.
  • Approval policy (untrusted / on-request / never) → Progressive rollout: employees → early access → early release → scheduled everyone.
  • Hooks — deterministic, not a prompt wish → Automatic rollback + dynamic configs: pull back when a guardrail metric breaks, tune while live.
  • "Validation is the only path to finality" → Sequential testing + CUPED, 95% CI. Demo: checkout +27.4% ± 2.3, engineer-run, no statistician.
  • Filesystem as context → Warehouse-native: experiments run on Snowflake / BigQuery / Databricks / Redshift, data never leaves.
Events / day
1T+
Experiment subjects / mo
2.5B
Flag evaluation
<1 ms
Moved to Amplitude · May 2026
~320
customers + brand, $16M ARR, no disclosed price
"It's engineering-first teams… They're building out whole software development harnesses, they want to manage how stuff is deployed in that harness… OpenAI runs a version of that infrastructure internally… we're doing the same thing except with everyone outside of OpenAI."Spenser Skates, CEO · Q2 FY26 Q&A, Aug 2026 — the CEO's word, not mine
Sources: statsig.com (Sep 6 2026) · Amplitude Q2 FY26 call + demo (Aug 2026) · Amplitude–OpenAI Statsig agreement, May 5 2026 · Codex docs for sandbox/approval taxonomy
stockdrifts.io · 12 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · the job

The PM of 2027 writes the product's harness — taxonomy, guardrails, evals, rollout policy — and the roadmap comes out of the loop.

01
Stable prefix → stable taxonomyEvent names and metric definitions are the product's cache. Version them like code; a rename is a cache miss for every agent downstream.
02
Few tools → four primitivesEvents, flags, experiments, replay. Every extra dashboard is schema tax. Codex proves three tools suffice.
03
Prompt = constraints → PRD = evalsThe spec is what the review agent tests against: guardrail metrics + acceptance criteria, not a feature list.
04
Memory = markdown → tracking plan as codePlus per-area memory written by reflection, plus MCP so other agents can read it. 1.21M tool calls/wk says they do.
05
Sandbox × approval → gate × rolloutFeature gate decides what's live; progressive rollout decides when; auto-rollback is the hook. Human approval is the hardest funnel (~11%).
06
Subagents for context → scoped swarmsOne agent per domain — metrics, feedback, traces, friction — each returns a cited card, never the raw data.
07
Validation before victory → every change is an experimentAnd every AI answer gets scored (Agent Analytics). "Massive decrease" only counts once it's Measured.
08
Taste is the moatWave's 8-mode rejection taxonomy still needs a human for "Not worth it" and "Bad strategy". That judgment is the job that's left — and it trains the discriminator.
Output of the role shifts from tickets to: taxonomy · evals · rollout policy · rejections that teach the loop. Engineer + PM + designer → one "AI builder" (Skates).
Synthesis: Harness Lab decisions 01–10 mapped onto Wave's published architecture ("Inside Amplitude Wave", Jun 2026) and the Q2 FY26 call
stockdrifts.io · 13 / 15
STOCKDRIFTSRESEARCH
Hitesh · StockDrifts
Part B · step zero · first-hand

Step zero, done at Stockdrifts this week: from "how many clicks" to "what made money" — one identity, ~30 events, revenue server-side.

Before · Friday morning
  • ✗
    autocapture: true + session replay on both apps — and nothing else
  • ✗
    No identity. Marketing site, app and Stripe were three strangers
  • ✗
    No custom events, no revenue, nothing server-side
  • ✗
    Could answer "how many clicks" — not "which paywall makes money"
After · PR #26, Saturday
  • ✓
    One identity = Supabase user id across marketing → app → Stripe webhook; cookie on the apex domain so sessions merge
  • ✓
    Six money questions → six charts, written before any event: which page converts, what free users do before paying, which paywall annoys, churn by plan
  • ✓
    ~30 events, [Noun] [Past-tense Verb] — the paywall funnel: Paywall Viewed → Upgrade Prompt Opened → Plan Selected → Checkout Started → Subscription Started
  • ✓
    Revenue from the server, deduped by Stripe object id — the no-code Stripe source was rejected: invoices carry no user id, renewals would split users
A self-improving product can't learn from data that doesn't exist. The tracking plan is the AGENTS.md of your product — write it first, then let the loop run.
Source: Stockdrifts monorepo spec 2026-09-05-amplitude-tracking-plan-design.md · PR #26, Sep 5–6 2026 · charts + revenue flags still to wire in the workspace
stockdrifts.io · 14 / 15

Steal the discipline.
Point the loop at your product.

Stable taxonomy. Four primitives. Spec = constraints + evals. Flags over promises.
Every change an experiment. Keep the taste — that's the job that's left.
Hitesh · StockDrifts
Stockdrifts Research · BIA Hubs "Building What's Next", Berlin, Sep 15 2026 · sources on every slide
stockdrifts.io · 15 / 15
01 / 15
→ / scroll · F fullscreen · P print