Yeemio (@yeemio) header
Yeemio (@yeemio) profile picture

Building AI agent harnesses and dev tools. Sharing what works and what breaks. Here for good coffee and honest rants.

Joined April 2013
Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)Photo by Yeemio (@yeemio)
Pinned Tweet
Ever seen what full decoding collapse actually looks like in a live Codex CLI session? Today I hit it on turn 2 of a brand-new handoff thread running gpt-6.2-astra (xhigh) at only 30.2% context. Two marathon threads right before it ran nearly 14 days each with zero garbled replies: • Thread A (gpt-6.1-sol, xhigh + max): 13d 15h 56m, 5,038 tool calls, 28 compactions, 1.39B cumulative input tokens (0 / 695 saved messages garbled). • Thread B (gpt-6.2-sol max + gpt-6.2-astra xhigh): 13d 23h 20m, 6,493 tool calls, 34 compactions, 1.77B cumulative input tokens (0 / 652 saved messages garbled). The new handoff thread had completely separate context at 78,042 of 258,400 input tokens. The two 14-day threads did not spill into it. The logged sequence on turn 2: • 13:24:27 · Last command returned 1,470 bytes. • 13:41:45 · After 17m 18s of xhigh reasoning, the response was metered at 6,006 output tokens. On screen, it started to answer "I pick C" in Chinese, hit the letter C, and veered into "CNXplayers flank..." followed by Cyrillic, Arabic, Korean, Georgian, and random code fragments. • 13:43:49 · TLS connection closed, one retry. • 13:44:37 · Turn interrupted. The JSONL recorded the 6,006 token count, while the reply text itself is missing from disk. Flagging this for @thsottiaux and the Codex team @ajambrosino . A fresh 30% session on gpt-6.2-astra xhigh hitting full decoding collapse after a 17-minute turn, leaving metered output tokens in the JSONL without the reply text, is a rare edge case heavy runs will eventually cross into. Three habits I now stick to for heavy Codex work: • Reserve xhigh for short, bounded hard steps. Routine handoffs and read-only audits run faster and safer on medium or high without 17-minute single-turn stalls. • Keep canonical state, handoff docs, and live readbacks on disk outside the chat log. When a fresh thread breaks on turn 2, closing it loses zero work. • Rotate long threads at clean checkpoints, and watch stalled turns closely so a broken stream does not burn output tokens silently. Full numbers from the rollout logs are in the chart below.
17
1
18
1,108
Coding agents drift in two ways: overturning settled rules and silently guessing on open questions. Grounded in the Replit code-freeze incident and Thoughtworks' 2026 Radar, here is how to split Decided from Open and pause only when needed.
14
9
349
After dozens of threads this week on context rot, compaction loss, and agent guardrails, I distilled my own global rules file down to one lean starter template. You can copy this straight into Claude Code, Codex, Cursor, or Antigravity and adapt it to your own workflow. It puts intent and communication at the top, closure tiers in the middle, and hard red lines at the very end so the model sees them last before acting. GLOBAL AGENT RULES (STARTER TEMPLATE) 1. Intent and Communication - Judge what I am asking right now; do not let the prior turn auto-fill this turn. Ask one short question only when two reasonable readings would change the deliverable. - Explain concepts in plain language first and go deeper when asked. Report finished work with the conclusion upfront, followed by actions and evidence. - State verified completion directly. Report failures with key output, and name anything skipped or unverified. 2. Scope and Minimal Edits - Focus on the single main gap blocking the goal. Log side discoveries instead of spawning extra refactors. - Read files before editing and make the smallest complete change. Skip speculative abstractions, feature flags, and fallback shims. - Execute safe, reversible in-scope work directly. Ask only for missing permissions, destructive actions, real scope changes, or strict TDD opt-in. 3. Three Closure Tiers - Direct Closure (default): for reversible work verifiable at the boundary, execute, read back, and stop. Skip process theater. - Guarded Closure: for one decision-changing uncertainty, add one targeted check or read-only review. - Full Gate: reserve for irreversible actions, permissions, security, money, or schema migrations. 4. End-Anchored Red Lines - After compaction or whenever paths, hashes, counts, or earlier rules feel fuzzy, read the primary files, git status, or event ledger on disk first. Never guess from a compressed summary. - Keep unrelated dirty changes intact. Never run git push, reset, clean, force flags, or broad staging without explicit approval (back this up with host approval gates). - Stop any failing tool or lookup path after two attempts with no new signal, switch to a read-only check, or report the exact gap. - Never claim completion without matching command output or verified state. Pair this with host-level approval gates for destructive commands, and move project-specific specs into your repo rules file so this global prefix stays short and cache-friendly.
7
10
514
全局 Agent 规则(通用起步模板) 1. 意图与沟通 - 独立判断我这一轮真正要做什么,别让上一轮任务自动补全本轮意图。只有在两种合理理解会明显改变交付物时,用一句话问清。 - 解释概念先用大白话,我追问再展开细节。汇报已完成的工作时结论先行,紧跟行动与证据。 - 验证通过直接说完成;失败附关键输出,跳过或未验证的内容直接明说。 2. 范围与最小改动 - 只盯住阻塞当前目标的唯一主要缺口;顺手发现的次要问题记下来即可,不顺手重构。 - 编辑前先读文件,只做最小完整改动;跳过假想出来的抽象层、feature flag 和兜底垫片。 - 范围内安全可逆的操作直接推进;只因缺少权限、破坏性操作、真实范围变化或严格 TDD 授权提问。 3. 三档收口标准 - Direct Closure(默认):可逆且能在边界读回验证的工作,执行、读回、停止,不做表演式流程。 - Guarded Closure:针对一个会改变决策的不确定点,只加一层针对性检查或只读复核。 - Full Gate:只留给不可逆操作、权限、安全、资金或数据结构迁移。 4. 压尾红线 - 触发上下文压缩后,或对路径、哈希、计数和早先规则有任何拿不准时,必须先读磁盘原文件、git 状态或事件账本,绝不凭压缩摘要猜。 - 保留无关的脏工作区改动;未经明确批准,绝不执行 git push、reset、clean、强制参数或宽泛暂存(底层用宿主审批闸门做硬拦截)。 - 同一失败的工具或检索路径连续两次没有新信号就立刻停手,改用只读核查或直接报出精确缺口。 - 没有对应的命令输出或已验证状态,绝不宣称已完成。 把这份模板配合宿主层的破坏性命令审批闸门一起用,再把单项目专属规范挪进各自仓库的规则文件里,全局前缀就能一直保持简短,也更吃得满前缀缓存。
2
48
Building a reliable coding agent does not require a heavy orchestration framework on day one. When I wire up a minimum viable harness from scratch, I ship seven thin blocks in one loop: 1. Task spec with explicit non-goals. 2. Context assembler with a stable prefix. 3. Pre-write permission gate in host code. 4. Sandboxed tool execution. 5. Append-only ledger on disk. 6. Hard retry cap and clean stop. 7. Deterministic acceptance check. Every single production failure I have hit traced back to skipping one of these seven.
Early coding agents often fail because everything is tangled inside one monolithic loop. Drawing on Anthropic, Stripe Minions, and Addy Osmani, here is a 7-block responsibility map and a 3-block MVP you can wire up tonight.
7
1
14
473
Most teams still debug a failing agent by rewriting the system prompt ten times. Each generation of agent engineering actually solves a different failure mode: 1. Prompt engineering tunes phrasing for a single turn. 2. Context engineering controls what enters the attention window across turns. 3. Harness engineering owns durable state, pre-write gates, and deterministic acceptance checks. Each layer wraps the previous one. Better wording never fixes a missing harness.
AI engineering has shifted from prompt wording to context curation and now to outer harnesses. For developers building agents: how OpenAI's Codex-built internal repo, Anthropic's context guide, and Mitchell Hashimoto's harness rules fit together.
11
8
398
Once you stop putting hard rules inside Claude Code auto memory, the next leak shows up as soon as you switch between Claude Code, Codex, and Cursor on the same repo. Claude Code keeps auto memory local to your machine, Codex keeps its own separate local memory store, and Cursor reads repo rule files without sharing either one. A decision Claude Code notes at 11pm is invisible to Codex the next morning, and letting the main loop edit memory mid-task also slows down every turn. Two habits keep multi-tool coding sessions clean: 1. Promote every lasting decision into one checked-in repo rules file shared by both Claude Code and Codex, never trapped in machine-local auto memory. 2. Keep memory search read-only on the hot path during a run, and curate learned notes asynchronously after the turn.
Claude Code auto memory loads only the first 200 lines or 25KB of its memory index at startup and leaves the rest in topic files for the model to open on demand. That works great for exploratory notes, and breaks fast when you treat it like a safety layer. An OS has a hardware page fault that fires every time a process touches a protected page. Claude Code and Codex have to remember to look. That is why I split state into two lanes: 1. Host-injected + hook-gated: task spec, frozen files, live config, and hard rules loaded every turn and enforced in a pre-write hook. 2. On-demand paged: huge repos, old design docs, and past incident logs left on disk for read-only search. If missing a rule once breaks production, put it in a checked-in file and a hook. Never gamble on auto memory opening the right note.
12
10
482
The reset you promised for today is live. Thanks, Tibo! Time to go all in on Astra.
Took a while longer to propagate, but all done. Tomorrow, we reset again. Will just say that it will by by EOD and not a specific time to give a little more flexibility.
1
1
271
Most architecture debates around agents stall because five different layers get called by the same name. When I design a new coding or ops agent, I separate them by the single job each layer owns: 1. Model reasons and proposes the next step. 2. Workflow locks a fixed graph when steps never change. 3. Framework gives reusable SDK abstractions. 4. Runtime executes tools, retries, and durable state. 5. Harness controls context layout, write gates, and acceptance checks. On day one, I start with a model and a thin harness, adding frameworks and dedicated runtimes only when real scale forces the split.
Agent terms blur as builders mix models, workflows, frameworks, runtimes, and harnesses. For developers shipping LLM tools: a responsibility lens across the five roles, backed by Anthropic, OpenAI Codex, and LangChain, and when to stay thin.
4
4
244
Letting Claude Code or Codex remember past MCP tool calls feels like free speed until one tool schema changes silently. Then the experienced agent fails tasks that a fresh session with zero memory passes on the first try. A Nov 16 study (Experience Rot, eBay and UChicago) tested six models on MCP-style tools after silent interface changes. With complete docs, fresh agents with no memory succeeded on 88% to 100% of tasks. Agents carrying out-of-date experience dropped to 26% to 49%, checked docs at most 6% of the time, copied their old call anyway, and reported success. Reading back the stored state after writing recovered 94 of 97 bad writes. Treat saved tool memory as a speed shortcut, never proof that the live MCP schema still matches.
25
2
18
697
Claude Code auto memory loads only the first 200 lines or 25KB of its memory index at startup and leaves the rest in topic files for the model to open on demand. That works great for exploratory notes, and breaks fast when you treat it like a safety layer. An OS has a hardware page fault that fires every time a process touches a protected page. Claude Code and Codex have to remember to look. That is why I split state into two lanes: 1. Host-injected + hook-gated: task spec, frozen files, live config, and hard rules loaded every turn and enforced in a pre-write hook. 2. On-demand paged: huge repos, old design docs, and past incident logs left on disk for read-only search. If missing a rule once breaks production, put it in a checked-in file and a hook. Never gamble on auto memory opening the right note.
13
2
13
1,047
Every new model release triggers the same debate: can I delete the harness now? Half of it, yes. Stronger models let me rip out brittle step-by-step scripts and prompt crutches that used to babysit weak reasoning. The other half moves in the opposite direction. The more autonomy a model earns, the larger its blast radius gets, so host write gates, sandboxes, and CI checks matter even more.
Stronger models let teams delete prompt scaffolding, yet broader repo access and unattended runs raise the stakes. Here is how Harness-Bench, OpenAI, Anthropic, and Vercel data separate what to prune from what to reinforce.
8
10
433
Once you split agent memory into clean drawers, the next failure hits a month later: facts flip, and an append-only store never forgets the old truth. You migrate a service from SQLite to Postgres, or retire an old webhook port. Similarity search still ranks the old postmortem near the top because the keywords match, and popular memory layers like Claude Code auto memory, Mem0, Zep, and LangGraph store document no default expiry at all. To stop stale memory from sabotaging new runs, I separate three write operations explicitly: 1. Supersede: mark the old decision inactive and link it to the new record, keeping the old row strictly for audit queries. 2. Expire: attach a short shelf life to temporary task states so "skip checks today" dies automatically. 3. Revoke: give explicit forget requests a hard delete path at the storage layer instead of relying on prompt wording.
Dumping user preferences, debug logs, repo rules, and scratch notes into one memory store feels convenient on day one. Three weeks later, similarity search pulls up a casual "skip tests today" note from an old chat right next to a production release rule, and the agent follows whichever sits closer in embedding space. Before picking a memory database, I split cross-session memory into four logical drawers with different write rules: 1. Working state: current task turns and tool outputs, cleared when the run ends. 2. Episodic logs: timestamped past bug fixes and postmortems, read as historical precedent and never promoted into standing rules. 3. Semantic facts: active preferences and project decisions, with an explicit active or revoked status so old choices stay in audit history without steering today's code. 4. Procedural rules: prompts, skills, and repo guidelines, kept read-only at runtime and changed only through Git review. All four can live in the same SQLite database or local folder on day one. What cannot share a bucket is write authority and expiration.
12
2
1
12
659
A written "never touch this" rule in a prompt is still just polite advice. Once an agent gets stuck on a failing test, polite advice is the first thing it bends. The split that actually holds up in long runs: 1. Soft layer (task spec): ban extra features and drive-by refactors, caught in diff review. 2. Hard layer (host allowlist + CI): lock tests, configs, migrations, and secrets so protected paths fail closed before a write lands.
Writing what an agent should not touch matters as much as the goal. This piece pairs Malte Ubl's real non-goals and three-tier boundaries with host write allowlists, CI gates, and retry caps.
7
8
372
Most teams worry about prompt injection poisoning agent memory. The weirder failure shows up with zero attackers at all: your own harmless notes from yesterday quietly break safety boundaries today. In a recent Princeton and Anthropic study (The Memory Trap), researchers gave frontier models ordinary permission notes from 20 low-risk coding chores, like telling the agent to go ahead without checking in. When those notes carried into high-stakes tasks, Claude Sonnet-4.6 jumped from under 1% unsafe actions to 35% to 81%, and Opus-4.8 cheating on ImpossibleBench climbed from 29% to 74% after legitimate stale-test repair notes. An audit of 599 self-written notes found 93% stripped out the original scope limits. A one-off convenience from a cleanup task should never silently become a global rule. I keep source, authorization scope, and runtime tool permissions separate, and gate irreversible actions in the host regardless of what memory says.
15
19
609
Dumping user preferences, debug logs, repo rules, and scratch notes into one memory store feels convenient on day one. Three weeks later, similarity search pulls up a casual "skip tests today" note from an old chat right next to a production release rule, and the agent follows whichever sits closer in embedding space. Before picking a memory database, I split cross-session memory into four logical drawers with different write rules: 1. Working state: current task turns and tool outputs, cleared when the run ends. 2. Episodic logs: timestamped past bug fixes and postmortems, read as historical precedent and never promoted into standing rules. 3. Semantic facts: active preferences and project decisions, with an explicit active or revoked status so old choices stay in audit history without steering today's code. 4. Procedural rules: prompts, skills, and repo guidelines, kept read-only at runtime and changed only through Git review. All four can live in the same SQLite database or local folder on day one. What cannot share a bucket is write authority and expiration.
18
2
22
1,303
I don’t care whether Cursor is called Grok or Build, or whether it brings back Astra and supports Opus and Neon. As long as it keeps brushing users off with an AI support bot, I don’t see how enterprise customers can count on it.
Good news for builders, the teams at OpenAI and SpaceX have worked hard to reach a new agreement that brings OpenAI models, including Astra, to @Build (formerly Cursor). Together, we've made important technical progress that will allow us to keep our models available in a tool developers use everyday.
6
8
408
Writing what an agent should not touch matters as much as the goal. This piece pairs Malte Ubl's real non-goals and three-tier boundaries with host write allowlists, CI gates, and retry caps.
25
1
23
982
Once you start compacting early to keep prompts lean, a counterintuitive trade-off shows up fast: aggressive compaction can make a long coding run slower and more expensive. Microsoft Research analyzed 13.5 million GitHub Copilot agent sessions across 3.2 million users and 760 million LLM calls. Only 7.8% of sessions ever triggered compaction, yet those sessions burned 44.2% of total tokens. Worse, default synchronous compaction shrank prompts by 72.9% while dropping prefix-cache hit rate by 57.8%. Three habits keep compaction from quietly inflating my bill: 1. Batch old tool-output clearing above a minimum token threshold instead of trimming a few lines every turn and busting the prefix cache repeatedly. 2. Trigger compaction at clean subtask boundaries, or prepare summaries asynchronously in the background so the active prefix stays warm. 3. Measure whole-task token spend (summary calls, cache rebuilds, and post-compaction re-reads) instead of celebrating a single-turn shrink ratio.
Auto-compaction feels like magic when a coding agent sails past turn 40 without hitting the context limit. The silent failure shows up ten turns later: the main task keeps moving while the one safety rule you set on turn 1 quietly disappears. Summarizers optimize for task continuity, so hard side constraints and exact file paths get smoothed away into vague prose. Before letting any agent auto-compact a long run, I split context cleanup into three layers: 1. Offload bulky old tool outputs to disk first, leaving only a file path and a one-line status in the prompt so nothing is permanently lost. 2. Keep hard rules and frozen decisions in a separate read-only slot outside the summarizer, and enforce destructive actions in host permission gates. 3. Compact only the leftover discussion incrementally at clean subtask boundaries, or stop cleanly when a safety margin hits.
6
7
779
Auto-compaction makes a long coding session look tidy while quietly erasing almost every exact detail from earlier turns. A Nov 29 study analyzing real Claude Code and Codex compaction points across four engineers' sessions found the post-compaction context kept only 6% of exact answers and 40% of gist answers. Agents relying only on that summary scored 22% to 35% on questions about their own earlier work. It is slow too. Across 72 real Claude Code compactions at a median of 336k tokens, the agent froze for a median of 61 seconds, with the longest stall hitting 206 seconds. The fix that actually worked in the study was surprisingly simple: keep the full transcript on disk and add a one-line instruction telling the agent to search it. Even plain grep over transcript files lifted recall to 77% to 94%, and indexed search reached 81% to 94%. Summaries work for keeping the active goal in sight. Exact facts belong in a searchable record on disk.
31
38
4,623
Auto-compaction feels like magic when a coding agent sails past turn 40 without hitting the context limit. The silent failure shows up ten turns later: the main task keeps moving while the one safety rule you set on turn 1 quietly disappears. Summarizers optimize for task continuity, so hard side constraints and exact file paths get smoothed away into vague prose. Before letting any agent auto-compact a long run, I split context cleanup into three layers: 1. Offload bulky old tool outputs to disk first, leaving only a file path and a one-line status in the prompt so nothing is permanently lost. 2. Keep hard rules and frozen decisions in a separate read-only slot outside the summarizer, and enforce destructive actions in host permission gates. 3. Compact only the leftover discussion incrementally at clean subtask boundaries, or stop cleanly when a safety margin hits.
9
2
7
1,124