{"data":{"post":{"title":"Build Your First 24/7 Agentic Loop","subtitle":"","isPublished":true,"createdTime":"2025-09-25T00:00:00.000Z","lastModifiedTime":null,"license":null,"tags":["AI","Agent"],"category":"Programming","file":{"childMdx":{"excerpt":"Fun fact:  My Claude Code usage reached  USD 3,000  in September, 2025. That's because I've been…","code":{"body":"function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nconst layoutProps = {};\nreturn class MDXContent extends React.Component {\n  constructor(props) {\n    super(props);\n    this.layout = null;\n  }\n\n  render() {\n    const _this$props = this.props,\n          {\n      components\n    } = _this$props,\n          props = _objectWithoutProperties(_this$props, [\"components\"]);\n\n    return React.createElement(MDXTag, {\n      name: \"wrapper\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"em\",\n      components: components,\n      parentName: \"p\"\n    }, `Fun fact:`), ` My Claude Code usage reached `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `USD 3,000`), ` in September, 2025.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/4520d/3k-usd-usage-of-claude-code.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/4ae7e/3k-usd-usage-of-claude-code.jpg\",\n        \"srcSet\": [\"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/aeae1/3k-usd-usage-of-claude-code.jpg 178w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/3465b/3k-usd-usage-of-claude-code.jpg 356w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/4ae7e/3k-usd-usage-of-claude-code.jpg 712w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/01d22/3k-usd-usage-of-claude-code.jpg 1068w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/d7775/3k-usd-usage-of-claude-code.jpg 1309w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/943f6/3k-usd-usage-of-claude-code.webp\",\n        \"srcSet\": [\"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/b1d2a/3k-usd-usage-of-claude-code.webp 178w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/c91cd/3k-usd-usage-of-claude-code.webp 356w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/943f6/3k-usd-usage-of-claude-code.webp 712w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/8a6dd/3k-usd-usage-of-claude-code.webp 1068w\", \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/4520d/3k-usd-usage-of-claude-code.webp 1309w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d6ed59e7cfb2799b677a6e5d3be9ea00/4520d/3k-usd-usage-of-claude-code.webp\",\n        \"alt\": \"3,000 USD Claude Code Usage\",\n        \"title\": \"3,000 USD Claude Code Usage\",\n        \"width\": 712,\n        \"height\": 821,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            3,000 USD Claude Code Usage\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `That's because I've been running Claude Code inside a\n`, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `24/7 agentic loop`), ` to power my side project. While I sleep, the loop\nevaluates, spawns subagents, and keeps moving forward. When I wake up,\nprogress is already made.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `But the magic isn’t tied to Claude; once you grasp the essence of the\nconfiguration you can replicate it with models and agent runtimes that\nimplement the same elements.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Here's how you can build your own.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `The Secret Behind the Curtain`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The truth is: the latest large-language models --- Claude 4, GPT-5 ---\nhave been `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `trained with agent tasks`), `. They \"know\" how to evaluate, plan,\ncall tools, and hand control back. You don't need a massive framework.\nYou just need a contract and a loop.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `The Essence of an Agentic Loop`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `To make “a contract and a loop” concrete, the diagram below shows the\nminimal flow: the evaluator chooses the next action, spawns executors to\nuse tools, executors report results, and control returns to the evaluator\nuntil the goal is met.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/1d214e7e58132e0713973d5e031c7e02/4aad0/basic-agentic-loop.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/1d214e7e58132e0713973d5e031c7e02/0cc25/basic-agentic-loop.png\",\n        \"srcSet\": [\"/static/1d214e7e58132e0713973d5e031c7e02/5116e/basic-agentic-loop.png 178w\", \"/static/1d214e7e58132e0713973d5e031c7e02/92f55/basic-agentic-loop.png 356w\", \"/static/1d214e7e58132e0713973d5e031c7e02/0cc25/basic-agentic-loop.png 712w\", \"/static/1d214e7e58132e0713973d5e031c7e02/7ae06/basic-agentic-loop.png 1068w\", \"/static/1d214e7e58132e0713973d5e031c7e02/eee47/basic-agentic-loop.png 1424w\", \"/static/1d214e7e58132e0713973d5e031c7e02/38407/basic-agentic-loop.png 2136w\", \"/static/1d214e7e58132e0713973d5e031c7e02/3361d/basic-agentic-loop.png 2893w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/1d214e7e58132e0713973d5e031c7e02/690c8/basic-agentic-loop.webp\",\n        \"srcSet\": [\"/static/1d214e7e58132e0713973d5e031c7e02/25c8a/basic-agentic-loop.webp 178w\", \"/static/1d214e7e58132e0713973d5e031c7e02/60698/basic-agentic-loop.webp 356w\", \"/static/1d214e7e58132e0713973d5e031c7e02/690c8/basic-agentic-loop.webp 712w\", \"/static/1d214e7e58132e0713973d5e031c7e02/d7e52/basic-agentic-loop.webp 1068w\", \"/static/1d214e7e58132e0713973d5e031c7e02/456ef/basic-agentic-loop.webp 1424w\", \"/static/1d214e7e58132e0713973d5e031c7e02/2a654/basic-agentic-loop.webp 2136w\", \"/static/1d214e7e58132e0713973d5e031c7e02/4aad0/basic-agentic-loop.webp 2893w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/1d214e7e58132e0713973d5e031c7e02/4aad0/basic-agentic-loop.webp\",\n        \"alt\": \"A diagram titled “Main Loop” showing evaluators and executors interacting in a repeating five-step cycle where requests to evaluate a situation spawn executors, executors request task details, and responses spawn evaluators\",\n        \"title\": \"Basic Agentic Loop\",\n        \"width\": 712,\n        \"height\": 586,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Basic Agentic Loop\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `However, to turn that flow into a working system, three components must\nwork together: the right `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `model`), `, `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `prompts`), ` that enforce the contract,\nand an `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `agent runtime`), ` designed for tool use:`), React.createElement(MDXTag, {\n      name: \"ol\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `Get the right model`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Pick an advanced model that can:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components,\n      parentName: \"li\"\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Follow strict JSON formats under prompt pressure.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Stay disciplined about roles and actions.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Reason sensibly about tool use without hallucination.`))), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `Write prompts with contracts in mind`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `The backbone of your loop is a fixed-format schema. Every evaluator\nand executors must respond in this structure. This turns free-form LLM\nchatter into predictable, machine-readable communication.`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `Support tools`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Without tools, your loop is just self-talk. With CLI commands, it can\nrun tests, fetch data, patch code, or monitor systems. Subagents aren’t\neven required, since you can spawn external agent instances to build the\nevaluator-executor heartbeat via the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `bash`), ` tool.`))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Writing Your First Contract-Driven Prompts`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `You’ve seen the loop and its roles. Now we’ll wire real prompts using\nClaude Code subagents and a custom command to build a loop that\ncleans up TODOs and FIXMEs across your repository. No standalone schema\nfiles—the contract is exactly what your prompts already define. Claude 4\nis a solid choice for running a 24/7 agentic loop.`), React.createElement(MDXTag, {\n      name: \"blockquote\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"blockquote\"\n    }, `Project URL: `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"href\": \"https://github.com/WeZZard/agentic-loop-playground.git\"\n      }\n    }, `agentic-loop-palyground`))), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `1) The Structure of the Loop`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The loop has three components:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `cleanup`), ` command`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `cleanup-evaluator`), ` subagent`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `cleanup-executor`), ` subagent`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/2a2c9e8362277703d35423ccdbc66fbf/32770/the-todo-fixme-loop.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/2a2c9e8362277703d35423ccdbc66fbf/0cc25/the-todo-fixme-loop.png\",\n        \"srcSet\": [\"/static/2a2c9e8362277703d35423ccdbc66fbf/5116e/the-todo-fixme-loop.png 178w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/92f55/the-todo-fixme-loop.png 356w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/0cc25/the-todo-fixme-loop.png 712w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/7ae06/the-todo-fixme-loop.png 1068w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/eee47/the-todo-fixme-loop.png 1424w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/38407/the-todo-fixme-loop.png 2136w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/3504a/the-todo-fixme-loop.png 3929w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/2a2c9e8362277703d35423ccdbc66fbf/690c8/the-todo-fixme-loop.webp\",\n        \"srcSet\": [\"/static/2a2c9e8362277703d35423ccdbc66fbf/25c8a/the-todo-fixme-loop.webp 178w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/60698/the-todo-fixme-loop.webp 356w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/690c8/the-todo-fixme-loop.webp 712w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/d7e52/the-todo-fixme-loop.webp 1068w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/456ef/the-todo-fixme-loop.webp 1424w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/2a654/the-todo-fixme-loop.webp 2136w\", \"/static/2a2c9e8362277703d35423ccdbc66fbf/32770/the-todo-fixme-loop.webp 3929w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/2a2c9e8362277703d35423ccdbc66fbf/32770/the-todo-fixme-loop.webp\",\n        \"alt\": \"A diagram titled “cleanup loop” showing how TODO/FIXME items are collected, reorganized by a cleanup-evaluator, executed by a cleanup-executor, and cycled back through a cleanup process in five repeating steps.\",\n        \"title\": \"The TODO/FIXME Loop\",\n        \"width\": 712,\n        \"height\": 463,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            The TODO/FIXME Loop\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup`), ` command is the loop’s entry point and hosts\nthe `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), `. It first scans the repository for TODO/FIXME items and\nprepares a working list, then passes that list to the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), `\nsubagent.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), ` subagent triages and orders the list, then\nresponds to the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` with the reorganized list and a next action\nof `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `spawn(cleanup-executor)`), `.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` then follows the response from the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), `,\nspawning a `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-executor`), ` subagent and passing the reorganized list to it.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-executor`), ` subagent dequeues the first TODO/FIXME item from\nthe reorganized list, executes it, updates the list when execution\ncompletes, and responds to the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` with the updated list and a\nnext action of `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `spawn(cleanup-evaluator)`), `.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` then follows the response from the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-executor`), `,\nspawning a `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), ` subagent and passing the updated list to\nit, thereby returning to the beginning of the loop.`), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `2) The Contract`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The key to this loop is ensuring the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` and subagents always\nfollow the contract. The good news: the contract is straightforward. In\nthis example, each subagent receives a JSON object from\nthe `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` in the following format:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-json\"\n      }\n    }, `{\n  \"incomplete_items\": [incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list]\n}\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `and responds to the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` in the following format:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-json\"\n      }\n    }, `{\n  \"incomplete_items\": [reordered_incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list],\n  \"next_action\": \"spawn(cleanup-executor)|spawn(cleanup-evaluator)|mission_complete\"\n}\n`)), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `3) Collecting TODOs/FIXMEs with Tool Call`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `You might be wondering what `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `[incomplete_item_list]`), ` means. Think of these\nas “variables” inside the prompt. They’re gathered through tool calls, triggered\nby the prompt at the beginning of the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup`), ` command:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `## MANDATORY: 1. FIND DOCUMENTED TODOs and FIXMEs\n\nYou SHALL use the \\`grep\\` tool piped with \\`head\\` to find the first \\`10\\` documented TODOs and FIXMEs in the repository.\n\nCommand: grep -r -n -E \"TODO|FIXME\" . | head -n 10\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `However, the raw outputs of this command aren’t ready to use as-is. We need to\nguide the agent on the expected format and instruct it to reshape the results into\na JSON object that follows the required schema.`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `The outputs are in the following format.\n\n\\`\\`\\`shell\n[file]:[line]:[content]\n\\`\\`\\`\n\nYou SHALL READ round each [line] in [file] and EXTRACT the [content] from all the found TODOs and FIXMEs, filtering out the ones cannot be applied with the restrictions of the platform, operating system, and required tools, then convert into a JSON object of the following format, using [incomplete_item_list] as the mnemonic:\n\n\\`\\`\\`json\n[\n  {\n    \"type\": \"todo\",\n    \"id\": \"TODO_1\",\n    \"file\": [todo_1_file],\n    \"line\": [todo_1_line],\n    \"content\": [todo_1_content]\n  },\n  {\n    \"type\": \"todo\",\n    \"id\": \"TODO_2\",\n    \"file\": [todo_2_file],\n    \"line\": [todo_2_line],\n    \"content\": [todo_2_content]\n  },\n  {\n    \"type\": \"fixme\",\n    \"id\": \"FIXME_1\",\n    \"file\": [fixme_1_file],\n    \"line\": [fixme_1_line],\n    \"content\": [fixme_1_content]\n  },\n  {\n    \"type\": \"fixme\",\n    \"id\": \"FIXME_2\",\n    \"file\": [fixme_2_file],\n    \"line\": [fixme_2_line],\n    \"content\": [fixme_2_content]\n  }\n]\n\\`\\`\\`\n\nYou SHALL NOTE a JSON object with and empty \"items\" array as [completed_item_list]:\n\n\\`\\`\\`json\n[]\n\\`\\`\\`\n\nYou SHALL NOTE a JSON object with and empty \"items\" array as [postponed_item_list]:\n\n\\`\\`\\`json\n[]\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `4) Enforcing the Contract with Prompts`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The contract is baked into the prompts themselves—no hidden tricks, just\nclear imperatives and consistent repetition until the model obeys.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The snippet below shows the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` spawning a `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), ` at the start of the loop.`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `## MANDATORY: 2. SPAWN A CLEANUP-EVALUATOR TO EVALUATE INCOMPLETE TODOs and FIXMEs\n\nYou MUST spawn a cleanup-evaluator subagent to evaluate the gap between the incomplete TODOs and FIXMEs and the existing situation.\n\nYou SHALL ALWAYS send the cleanup-evaluator with a JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list]\n}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `On the cleanup-evaluator side, we should also enforce the contract.`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup-evaluator.md\",\n        \"path\": \"cleanup-evaluator.md\"\n      }\n    }, `## MANDATORY: PARSE THE RECEIVED JSON OBJECT\n\nYOU WILL RECEIVE a JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list]\n}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Once the cleanup-evaluator is ready to conclude its evaluation, it\nprepares a response to the main agent using the contract format. In this\nexample, its `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `next_action`), ` is always to spawn a cleanup-executor or tell\n\"mission complete\".`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup-evaluator.md\",\n        \"path\": \"cleanup-evaluator.md\"\n      }\n    }, `## MANDATORY: RESPOND TO THE MAIN AGENT\n\nYou SHALL RESPOND with the [reordered_incomplete_item_list], [completed_item_list], [postponed_item_list] to the main agent with the JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [reordered_incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list],\n  \"next_action\": \"spawn(cleanup-executor)|mission_complete\"\n}\n\\`\\`\\`\n\nThe \\`next_action\\` field SHALL BE \\`mission_complete\\` when NO ITEMS ARE LEFT in [reordered_incomplete_item_list].\n\nOtherwise, the \\`next_action\\` field SHALL BE \\`spawn(cleanup-executor)\\`.\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Back in the main agent, it follows the response from\nthe `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), ` subagent, spawns a `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-executor`), ` subagent,\nand passes the lists to it.`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `## MANDATORY: 3. UNDERSTAND THE CLEANUP-EVALUATOR'S RESPONSE\n\nThe cleanup-evaluator subagent is ALWAYS the core of the workflow.\n\nYOU MUST OBEY THE DECISION OF THE CLEANUP-EVALUATOR IN [next_action].\nYou SHALL NEVER CHANGE THE DECISION OF THE CLEANUP-EVALUATOR in [next_action].\n\nThe [next_action] COULD BE: \\`spawn(cleanup-executor)\\` | \\`mission_complete\\`:\n\nThe [next_action_details] COULD BE:\n\n\\`\\`\\`json\n{\n  \"type\": \"todo|fixme\",\n  \"id\": [next_item_id],\n  \"file\": [next_item_file],\n  \"line\": [next_item_line],\n  \"content\": [next_item_content]\n}\n\\`\\`\\`\n\nOR\n\n\\`\\`\\`json\n{\n  \"type\": \"mission_complete\"\n}\n\\`\\`\\`\n\nThe cleanup-evaluator subagent SHALL NEVER know if it is the last time to evaluate until the [next_action] of a spawned cleanup-evaluator turns out to be \\`mission_complete\\`.\n\n### MANDATORY: ALWAYS TRANSFER [incomplete_items], [completed_items], [postponed_items] FROM THE CLEANUP-EVALUATOR'S RESPONSE TO THE NEXT SUBAGENT\n\nYOU MUST transfer the [incomplete_items], [completed_items], [postponed_items] from the cleanup-evaluator's response to the next subagent with the JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [incomplete_item_list],\n  \"completed_items\": [completed_item_list],\n  \"postponed_items\": [postponed_item_list],\n}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `At this point, the contract allows the main agent to spawn a\n`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-executor`), ` subagent to execute the next TODO/FIXME item. However,\nwe still need to instruct the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` to follow responses from\nsubagents other than the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `cleanup-evaluator`), `:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `## MANDATORY: 4. UNDERSTAND THE RESPONSE FROM OTHER SUBAGENTS\n\nAll the subagents other than the cleanup-evaluator subagent SHALL ALWAYS respond with a JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [next_incomplete_item_list],\n  \"completed_items\": [next_completed_item_list],\n  \"postponed_items\": [next_postponed_item_list],\n  \"next_action\": \"spawn(cleanup-evaluator)\",\n}\n\\`\\`\\`\n\n### MANDATORY: ALWAYS READ Subagent’s Response to Decide Next Action\n\nThe [next_action] is ALWAYS to spawn a cleanup-evaluator subagent.\n\nYou MUST SEND the cleanup-evaluator a JSON object of the following format:\n\n\\`\\`\\`json\n{\n  \"incomplete_items\": [next_incomplete_item_list],\n  \"completed_items\": [next_completed_item_list],\n  \"postponed_items\": [next_postponed_item_list],\n}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Finally, the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `main agent`), ` needs to know when to end the loop:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-markdown\",\n        \"metastring\": \"path=cleanup.md\",\n        \"path\": \"cleanup.md\"\n      }\n    }, `## MANDATORY: 5. HANDLING MISSION COMPLETE\n\nIf \\`next_action\\` in the response from the cleanup-evaluator subagent is \\`mission_complete\\`, then the mission is completed.\n\nYou SHALL STOP ALL THE SUBAGENTS AND EXIT THE WORKFLOW.\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Now we've built our first agentic loop with a collection of\ncontract-driven prompts.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Have a Try`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Here's what happens when you run this loop against the llama.cpp project.\nThe loop processes exactly 10 TODOs and FIXMEs before completing—no\nambitious mission required, just a focused cleanup cycle that demonstrates\nthe core mechanics in action.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/7299c9ce23f6adc2afc97b25a740b51f/0a362/try-with-claude-code.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/7299c9ce23f6adc2afc97b25a740b51f/0cc25/try-with-claude-code.png\",\n        \"srcSet\": [\"/static/7299c9ce23f6adc2afc97b25a740b51f/5116e/try-with-claude-code.png 178w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/92f55/try-with-claude-code.png 356w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/0cc25/try-with-claude-code.png 712w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/7ae06/try-with-claude-code.png 1068w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/eee47/try-with-claude-code.png 1424w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/38407/try-with-claude-code.png 2136w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/82750/try-with-claude-code.png 2566w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/7299c9ce23f6adc2afc97b25a740b51f/690c8/try-with-claude-code.webp\",\n        \"srcSet\": [\"/static/7299c9ce23f6adc2afc97b25a740b51f/25c8a/try-with-claude-code.webp 178w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/60698/try-with-claude-code.webp 356w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/690c8/try-with-claude-code.webp 712w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/d7e52/try-with-claude-code.webp 1068w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/456ef/try-with-claude-code.webp 1424w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/2a654/try-with-claude-code.webp 2136w\", \"/static/7299c9ce23f6adc2afc97b25a740b51f/0a362/try-with-claude-code.webp 2566w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/7299c9ce23f6adc2afc97b25a740b51f/0a362/try-with-claude-code.webp\",\n        \"alt\": \"Try with Claude Code\",\n        \"title\": \"Have a Try\",\n        \"width\": 712,\n        \"height\": 787,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Have a Try\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Running 24×7`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Running a loop around the clock is about feedstock, not just uptime. A\nloop survives by continuously converting A into B: turning one kind of\nartifact into another on repeat. If A is an idea and B is a program (or a\nfix, a test, a release), then a 24×7 loop needs endless ideas.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `We don’t actually have infinite ideas. The practical pattern is this: you\ndesign the loop to tackle work that’s substantial enough to buy you\nthinking time. While the agent is converting A→B — compiling, testing,\npackaging, or deploying — you use that breathing room to decide the next\nA. Optional feeders like TODO/FIXME scanners or issue trackers can surface\ncandidates, but they don’t replace your judgment. The loop does meaningful\nwork; you curate the input stream. That’s a perfectly valid way to run a\n24×7 operation.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Beyond the Claude Code`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `At this point, you might ask: I'm not using Claude Code; I'm using Codex.\nWhat should I do? The answer is simple: the approach stays the same. This\nloop doesn't depend on any vendors; it rests on three essentials: a\ncontract, a loop, and a runtime. Put simply, the evaluator chooses the\nnext step, the worker carries it out, and the main agent routes and\nsafeguards. Everything else is implementation detail.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Claude Code is convenient because it offers two helpful primitives:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Subagents: lightweight agent instances with their own prompts and roles.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Custom Commands: first-class command blocks that carry prompts and tool wiring.`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `But neither is mandatory. You can replace both:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Replace Subagents with a tool call that starts another AI agent instance\n(for example, invoke a CLI that spins up a new agent and returns its\nstructured response).`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `Replace Custom Commands with a shell script that sends a custom prompt\nto launch an AI agent.`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `As long as you preserve the contract and the loop, the mechanics are\ninterchangeable. Your main agent routes, enforces the schema, and keeps\ncycling until `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `next_action`), ` is `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `mission_complete`), `.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Comparison with LangChain and LangGraph`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `However, you might be wondering: why not just use LangChain or LangGraph? The\ntable below makes the trade-offs clearer.`), React.createElement(MDXTag, {\n      name: \"table\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"thead\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"thead\"\n    }, React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Aspect`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Agent runtime`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `LangChain or LangGraph`))), React.createElement(MDXTag, {\n      name: \"tbody\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Requirements`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Appropriate model`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `SDK + tools + memory abstractions`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Setup`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Prompts`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Chains or graphs`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Tool calling`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Via prompts`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Via prompts and system-level adapters`)))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This comparison lays out the trade-offs between the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `agent runtime`), ` approach\ndescribed here and frameworks like LangChain or LangGraph. It highlights three\nessentials: what you need to build a loop, how you set it up, and how tools are\ncalled.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `From the table, it’s clear the `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `agent runtime`), ` path is lighter to boot, leans\non native tools so it fits any stack, stays vendor-neutral, and keeps humans in\ncharge of the input stream—while the loop itself does meaningful work 24×7.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Conclusion`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Building a 24×7 loop doesn't require LangChain or LangGraph. All you need is:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `A model trained with agent tasks.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `A prompt-enforced contract.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, `A runtime that supports tool use.`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `With that, you can run Claude Code (or Codex) in a loop that works while\nyou sleep.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Try it tonight. Tomorrow morning, you might wake up to progress already made.`));\n  }\n\n}\nMDXContent.isMDXComponent = true;","scope":""},"headings":[{"value":"The Secret Behind the Curtain","depth":2},{"value":"The Essence of an Agentic Loop","depth":2},{"value":"Writing Your First Contract-Driven Prompts","depth":2},{"value":"1) The Structure of the Loop","depth":3},{"value":"2) The Contract","depth":3},{"value":"3) Collecting TODOs/FIXMEs with Tool Call","depth":3},{"value":"4) Enforcing the Contract with Prompts","depth":3},{"value":"Have a Try","depth":2},{"value":"Running 24×7","depth":2},{"value":"Beyond the Claude Code","depth":2},{"value":"Comparison with LangChain and LangGraph","depth":2},{"value":"Conclusion","depth":2}]}}},"earlierPostExcerpt":{"slug":"/post/2025/08/the-cupertino-ghost-in-the-machine-9ee3","title":"The Cupertino Ghost in the Machine: An Analysis of Xcode's New AI Assistant","subtitle":"","createdTime":"2025-08-31T00:00:00.000Z","tags":["AI","Developer Tools","Xcode"],"category":"Programming","file":{"childMdx":{"excerpt":"My journey into the internals of Xcode 26’s new AI assistant began not with a bug, but with a feature so persistent it felt like a personality. The animations and design of Xcode have never been better, a testament to Apple's polish. Yet, interacting with the new intelligence features felt…"}}},"laterPostExcerpt":null},"pageContext":{"postId":"438483cf-5de1-57bb-b6e0-3e08ec97bbe3","earlierPostId":"62c9b374-86f3-5a74-b008-dd3b3ed47e67","laterPostId":null}}