{"slug": "the-codebase-is-the-harness", "title": "The Codebase Is the Harness", "summary": "Pyn runs a monorepo in which the bots that modify its product code also modify their own harness — their markdown instruction files, databases and MCPs — so agents can update their own instructions after a fix, the company's engineering blog reports. In one example, an agent given access to PostHog session recordings diagnosed and fixed two bugs without intervention: a user making a change, clicking back and getting stale data, and a user unable to log in because the error message wasn't showing, with the review bot assisting. The author argues a human still supplies macro direction and self-improvement is currently only a carve-out, but that even a fraction of self-improvement applied to the system itself yields a compounding system.", "body_md": "I have a growing belief that self-improving codebases are the end goal. Perhaps that self-improvement starts small and niche, but it can grow and compound. To get there a codebase has to understand itself (to the extent necessary). That has changed what I think a \"harness\" is.\n\nThe word usually means the wrapper around a model: the prompts, the tools and the loop that make it an agent. I've used it that way on this blog, and it's where [half my day goes](https://jonathannen.com/sharpening-the-axe/). But to be self-improving it needs to be self-referencing. I now think the codebase *is* the harness.\n\nAt [Pyn](https://www.pyn.ai) we have a handful of bots that perform work on the codebase. They have their own markdown files, databases, MCPs and so on, and all of it is oriented toward the codebase. Even the code review process is part of the harness<sup>[\\[1\\]](#fn1)</sup>.\n\nIt's a monorepo. The bots and their tooling live in the same repo as the product, so the agents that change the product also change the harness. It sits inside the codebase and gets improved the same way everything else does.\n\nA handy example I have is PostHog. We gave an agent access to the session recordings<sup>[\\[2\\]](#fn2)</sup>, and it can diagnose issues and fix them without intervention. It saw someone click in, make a change, then click back and get stale data. It saw someone else having trouble logging in because the error message wasn't showing. It diagnosed and fixed both (with the help of the review bot).\n\nYou find bugs like those by watching someone use the product, and that's what I mean by the codebase understanding itself. It can see how it's being used, and it can act on what it sees.\n\nThe next part is key: after a fix like that the agents can assess if it was successful, and then alter their own instructions to suit. Those instructions live in the same repo, so they can be changed to proactively find other similar issues and stop them slipping into new code. That is the tiniest increment, but an incredibly powerful one.\n\nA human still needs to provide the macro direction. The part that improves itself is only a carve-out at the moment, but it's growing<sup>[\\[3\\]](#fn3)</sup>. If you can get even a fraction of self-improvement, *and* it's improving the system itself, then you have a system that can compound.", "url": "https://wpnews.pro/news/the-codebase-is-the-harness", "canonical_source": "https://jonathannen.com/codebase-is-the-harness/", "published_at": "2026-11-18 20:52:59+00:00", "updated_at": "2026-11-18 21:15:51.589931+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Pyn", "PostHog", "MCP"], "also_reported_by": [], "takeaway": "Putting agents and their instruction files in the same monorepo as the product lets them diagnose bugs from session recordings, fix them, then rewrite their own instructions to catch similar issues in new code.", "recommendation": {"advice": "Keep agent instructions and tooling in the product monorepo so agents can update their own instructions after a verified fix and proactively catch similar bugs in new code.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/the-codebase-is-the-harness", "markdown": "https://wpnews.pro/news/the-codebase-is-the-harness.md", "text": "https://wpnews.pro/news/the-codebase-is-the-harness.txt", "jsonld": "https://wpnews.pro/news/the-codebase-is-the-harness.jsonld"}}