DEV Community

kaz
kaz

Posted on • Originally published at 0xkaz.com

Loop Engineering: Turning Browser Clips into Agent Work

"---\ntitle: \"Loop Engineering: Turning Browser Clips into Agent Work\"\ntags: [ai, agents, mcp, cloudflare, productivity, opensource]\nplatform: dev.to\nstatus: draft\ndate: 2026-06-23\ncanonical_url: https://0xkaz.com/writing/agentclip-loop-engineering/\n---\n\nThe most interesting part of AI agents is not the model. It is the loop.\n\nA prompt gets you an answer. A loop gets you ongoing work: read something new, compare it against everything you already know, decide if it matters, and surface it when it does. Without the loop, an agent is just a chatbot with a longer memory. With the loop, it becomes something that watches while you do other things.\n\nThis idea — loop engineering — has become one of the dominant threads in agent tooling this year. The conversation has shifted from \"which model is best?\" to \"what does the loop actually do?\" People are less interested in a one-shot answer and more interested in an agent that keeps running.\n\nI built AgentClip as the inbox that triggers that loop.\n\n## What AgentClip Does\n\nAgentClip has three pieces:\n\n- Browser extension — select text on any page and clip it.\n- Mobile app — share a link or paste text into AgentClip from iOS/Android.\n- Agent interface — both MCP and REST, so local AI agents can read, search, and process everything I clip.\n\nClips go to Cloudflare Workers, are stored in D1, and are indexed for search. The agent does not need to know any of that. It calls search_clips or GET /clips/search and gets back what it needs.\n\nThe point is not to build a better bookmark manager. The point is to build an inbox that agents loop over.\n\n## From Storage to Inbox\n\nMost clipping tools ask: \"How do we help the user organize what they saved?\"\n\nThat was never my problem. My problem was the opposite: I saved things and forgot to do anything with them. Read-later queues became graveyards. Bookmarks became folders I never opened. The bottleneck was not storage. It was processing.\n\nAgentClip treats each clip as a trigger. A clip is not \"something I might want later.\" It is \"something I want something done about.\" That could mean summarize, compare, find related ideas, or just tell me if it conflicts with something I already believe.\n\nThe inbox is the interface. The agent is the worker. The loop is where the value is.\n\n## What the Loop Actually Does\n\nHere is what a typical AgentClip loop looks like on my machine. It is a script that runs every morning and asks four concrete questions:\n\n1. What did I clip in the last 24 hours?\n2. For each new clip, what older clips seem related?\n3. Does any new clip change or contradict something I saved before?\n4. Write a short digest and save it as a Markdown file.\n\nThe output lands in my local notes directory as something like 2026-06-23-agentclip-ideas.md with a few sections:\n\n- Summary of the new clip\n- Older clips that seem related\n- A tentative conclusion or open question\n- Suggested next searches\n\nThat Markdown file becomes the trigger for the next loop. I point another local agent at it — often Claude Code or a local LLM — and ask it to expand the research, find gaps, or sketch an implementation. The first loop turns a raw clip into a structured note. The second loop turns the note into a design or a draft.\n\nI keep each loop small on purpose. The first agent does not write code. The second agent does not browse the web. Each one has a narrow job, and AgentClip is the shared inbox they both read from.\n\n## MCP and REST\n\nMCP is the convenience layer. Claude Code, Cursor, or any MCP client can discover AgentClip and call it like a native tool. That is how I do ad-hoc exploration.\n\nREST is the control layer. When I write my own watch script, it fetches clips through GET /clips and passes them to an LLM on my own terms. The LLM does not need to know AgentClip exists. It just receives the data and reasons about it.\n\nI use both. MCP for interactive work. REST for scheduled loops.\n\n## How the Loop Ends\n\nIf you do not design the end condition, the loop runs forever and bills forever.\n\nMy loops end in one of three ways:\n\n- Time box — run for 15 minutes, then stop.\n- Task limit — process the five most recent clips, then stop.\n- Token budget — spend up to N tokens, then stop and wait for me.\n\nThe exact condition depends on the task. A daily summary loop gets a small budget. A deep research loop gets a larger one. The important thing is that the loop never runs open-ended. An infinite loop is not engineering. It is a bug.\n\n## Multiple Agents, One Inbox\n\nI do not run one loop. I run several, each with a different model and purpose.\n\n- Kimi handles broad research and idea expansion.\n- Codex picks up clips that involve code, APIs, or infrastructure.\n- Claude Code does deep local work, reading my codebase and pulling relevant context from AgentClip.\n- Local LLM via llamafile runs the cheap loops: summarization, redundancy checks, and anything I do not want to send to the cloud.\n\nThey all read from the same inbox. Each one takes the clips it is good at and ignores the rest.\n\n## What I Tried Before This\n\nI wanted automatic processing of research and ideas, so I tried more autonomous agents — the kind that watch, learn, and act on their own. The premise is appealing.\n\nIn practice, I found them hard to debug and harder to trust. When an agent decides on its own what to remember and what to do, you spend as much time managing the agent as you would have spent doing the work yourself.\n\nLocal coding agents with MCP — Claude Code, in particular — turned out to be a better fit. They are transparent, controllable, and compose well. That is why AgentClip stays simple. The loop is not the brain. The loop is the plumbing.\n\n## Try It\n\nAgentClip is open source:\n\n- github.com/0xkaz/agentclip — Chrome extension + Cloudflare Workers + MCP server + REST API\n- github.com/0xkaz/agentclip-mobile — Expo + React Native client\n\nBoth are early but usable. I run them in daily sessions across multiple agents.\n\nIf you also want your agents to keep working while you are not typing at them, the pattern is worth stealing.\n"

Top comments (0)