# Agent-loop hosting · replace-in-place URLs · Stacktree

Source: https://stacktr.ee/agent-loop-hosting

[Skip to content](#main) [Stacktree](/)[Developers](/developers)[Agents](/agents)[Docs](/docs)[Use cases](/use-cases)[Pricing](/pricing)[Blog](/blog)[Dashboard](https://app.stacktr.ee)[Sign in →](https://app.stacktr.ee)      By [ Steve Smith ](/about) · Founder, Stacktree  ·  Last updated May 14, 2026          concept

#  One URL. Every revision. That's agent-loop hosting.

   When an agent iterates 30× in a session, you don't want 30 URLs. Agent-loop hosting is a publishing model where the URL is stable, the content swaps underneath, and the viewer's bookmark always shows the latest version.

  [ Get started free ](https://app.stacktr.ee/?join=1&from=seo_agent_loop_hosting)   install npx stacktree-install
Copy
     No card · 3 pages free · about a minute

##  What is agent-loop hosting?

Agent-loop hosting is a static-HTML publishing model designed around the way AI agents actually work: by revising the same artifact many times in a single session. The hosting service guarantees that the URL stays stable across revisions, so the link a human bookmarked at minute 1 still shows the latest version at minute 30. Stacktree exposes this as one MCP tool call: `update_site`.

##  The loop, by the numbers

  -   ~200 ms  time from update_site request to the new content being live at the edge. [
Source: Cloudflare R2 latency ↗
](https://developers.cloudflare.com/r2/api/workers/workers-api-usage/)
-   12–30  typical artifact revisions per Claude Code or Codex session of moderate length. [
Source: Karpathy on agent HTML output ↗
](https://x.com/karpathy/status/2053872850101285137)
-   1  stable URL across every revision — the whole reason this primitive exists. [
Source: MCP tools spec ↗
](https://modelcontextprotocol.io/specification/2025-11-25/server/tools)
-   1.8×  more AI citations for pages with a visible "last updated" timestamp — replace-in-place pages keep it fresh automatically. [
Source: AirOps 2026 citation study ↗
](https://www.airops.com/blog/aeo-answer-engine-optimization)

## The problem in three lines

  - An AI agent writes a 600-line HTML report.
 - The agent revises that report 12 times in the next 30 minutes — adding sections, fixing numbers, restyling.
 - Twelve new URLs is twelve broken bookmarks for the teammate you're sharing it with.

The "send the latest link in Slack" workaround is what teams do today, and it's exactly the kind of friction that should be a primitive instead of a habit. The right answer is: one URL, all twelve revisions, viewer refreshes when they want the latest.

## Why every other host gets this wrong

  - Tiiny Host, Pastebin, ngrok shares. Each upload is a new URL. Replace-in-place is paid or impossible.
 - GitHub Pages. The URL is stable, but the rebuild lag (30 s – 5 min) breaks the iteration cadence, and the unit of update is a commit.
 - Vercel preview URLs. Brilliant for CI, but every deploy is a distinct preview URL by design. The "production" alias is stable, but it's a heavy primitive for a five-minute artifact.
 - Notion / Linear / GDocs. URL is stable, but the content has to be expressed in their flavour of rich text. Agent-emitted HTML rarely survives the round-trip.

## What Stacktree does

Stacktree exposes `update_site` as a first-class verb in its MCP server and HTTP API. The agent calls:

```
`PUT /sites/{slug}
Content-Type: text/html

<!doctype html>…`
```

The R2 object is replaced atomically, the edge cache is purged, and the same URL serves the new content on the next request. No new slug, no new token, no new "see V3" message in Slack.

## The viewer-side contract

The deal with the viewer is: this URL always points to the latest version. They bookmark once. They refresh when they want the current state. If the artifact has been deleted or expired, they see a clean 404 — never a stale cached page silently. That's the contract that makes agent-loop hosting actually trustworthy.

## When you shouldn't use it

  - Compliance-archived artifacts. If you need to prove what V7 looked like in March, you want an immutable URL per revision. Stacktree can do this too — just call publish_html for each new revision instead of update_site.
 - Public marketing pages. Real CDN, real DNS, real cache-control headers. Stacktree handles small-to-medium static loads fine, but a viral homepage is not its job.

FAQ

## Frequent questions

     What is agent-loop hosting? +  A hosting model where the URL is stable across revisions. The agent calls one tool to publish, then calls a second tool (`update_site`) every time it revises the artifact. The viewer's bookmark always shows the latest version.   Why does this matter? +  Because agents iterate. A 30-message session might revise the same spec 12 times. If every revision is a new URL, your teammate has 12 stale bookmarks. If the URL is stable, they have one that always works.   How is this different from a normal static host? +  Most static hosts treat each upload as a new artifact (Tiiny Host on free tiers, S3 pre-signed URLs, Pastebin). Some hosts let you replace the file but force a redeploy that bumps cache (GitHub Pages, Vercel). Agent-loop hosting is purpose-built for the case where the URL must not change.   Does the agent need write access to keep the URL stable? +  Yes — the same slug + an authentication token. Stacktree's MCP server handles this automatically: it stores a token at `~/.stacktree/credentials` and binds the slug to the account on first publish.   How does this play with caching and CDN? +  Stacktree pushes new content to its edge cache on every `update_site` call. End users see the new version on the next request; there's no manual cache-bust step.   Can multiple agents update the same site? +  Yes — they just need to share the slug and an API token. Useful when one agent generates the data and another renders the report.
Keep reading

## Related guides

   -  [ Have your agent publish its own run report as a link End every agent run with a link, not a wall of terminal text: the agent renders an HTML run report, calls publish_html. ](/workflows/agent-publishes-its-own-report)
-  [ The MCP publish tool Every verb, with examples. ](/mcp-publish-html)
-  [ Publish from Claude Code The most common agent-loop workflow. ](/claude-code)
-  [ Publish from Codex Same loop, wired into Codex CLI. ](/codex)
-  [ Share Claude artifacts Why bookmarkable links matter for artifact hand-off. ](/share-claude-artifacts)

References

## Sources and further reading

   -  [ Karpathy — agents output HTML ↗ The thread that crystallised the "agents emit HTML" thesis behind this page. ](https://x.com/karpathy/status/2053872850101285137)
-  [ Model Context Protocol — tools ↗ How MCP exposes verbs like publish_html / update_site to agents. ](https://modelcontextprotocol.io/specification/2025-11-25/server/tools)
-  [ Cloudflare Workers — atomic R2 writes ↗ The primitive that lets update_site swap content under a stable URL atomically. ](https://developers.cloudflare.com/r2/api/workers/workers-api-usage/)
-  [ HTTP caching (MDN) ↗ Why replace-in-place hosting must handle cache invalidation carefully. ](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching)

##  Give every revision the same URL.

 Install the MCP server. The agent does the rest.

 [ Sign up free → ](https://app.stacktr.ee/?join=1&from=cta_agent_loop_hosting)   install npx stacktree-install
Copy
       Private hosting for the HTML your agents make.

[](https://betalist.com/startups/stacktree?utm_campaign=badge-stacktree&utm_medium=badge&utm_source=badge-featured)[Featured on](https://devhunt.org/tool/stacktree)[](https://buildlist.io)[Get started free](https://app.stacktr.ee/?join=1)

## Product

- [Page video](/page-video)
- [Ask this page](/ask-this-page)
- [Client spaces](/client-spaces)
- [Templates](/templates)
- [Example deliverables](/examples)
- [Custom domains](/custom-domains)
- [Client feedback](/client-feedback-loop)
- [One-time links](/one-time-view-links)
- [See how pages get read](/page-engagement)
- [Made with Stacktree](/made-with)
- [Security](/security)
- [Watch the demo](/demo)

## Agents

- [All integrations](/agents)
- [Claude Code](/claude-code)
- [OpenAI Codex](/codex)
- [Cursor](/cursor)
- [Claude.ai connector](/claude-ai-connector)
- [Claude Cowork](/what-is-claude-cowork)
- [Meta Muse](/muse)
- [MCP server](/mcp-publish-html)
- [Deploy from Claude Code](/deploy-html-from-claude-code)
- [Skills](/skills)
- [Slack app](/slack)
- [n8n node](/n8n)
- [Agent payments (x402)](/x402)

## Alternatives

- [All comparisons](/alternatives)
- [Head-to-head comparisons](/compare)
- [Tiiny Host](/tiiny-host-alternative)
- [GitHub Pages (private)](/github-pages-private-alternative)
- [Vercel](/vercel-alternative-for-agents)
- [ngrok](/ngrok-alternative-for-html)
- [Display.dev](/display-dev-alternative)
- [Static.app](/static-app-alternative)
- [OpenAI Codex Sites](/openai-codex-sites-alternative)
- [here.now](/here-now-alternative)
- [Shippage](/shippage-ai-alternative)
- [Best private hosting](/best-private-html-hosting)

## Use cases

- [All use cases](/use-cases)
- [Share with clients](/share-with-clients)
- [Send a file to a client](/share-html-file-with-client)
- [Share Claude artifacts](/share-claude-artifacts)
- [Share Jupyter notebooks](/share-jupyter-notebook-html)
- [Host Storybook privately](/host-storybook-privately)
- [Architecture diagrams](/share-architecture-diagrams)
- [AI-generated reports](/host-ai-reports)
- [Internal HTML tools](/internal-tool-hosting)
- [Private HTML hosting](/private-html-hosting)
- [Vibe-coded page hosting](/vibe-coding-hosting)
- [Leave a website builder](/website-builder-migration)

## Learn

- [Blog](/blog)
- [Glossary](/glossary)
- [FAQ](/faq)
- [Where AI output should live](/where-ai-output-lives)
- [Agent-loop hosting](/agent-loop-hosting)
- [Why agents need a publish primitive](/blog/why-agents-need-a-publish-primitive)
- [MCP servers explained](/blog/mcp-servers-explained-for-developers)
- [What changed in the 2026-07 MCP spec](/blog/mcp-2026-spec-changes)
- [Sites in Codex explained](/blog/sites-in-codex-explained)
- [Private-by-default hosting](/blog/private-by-default-html-hosting)
- [An agent paid us $1 (x402)](/blog/agent-paid-to-provision-itself)
- [When a loop hits a paywall](/blog/loop-engineering-paywall)
- [Pricing](/pricing)
- [Self-host (new)](/self-host)
- [Changelog](/changelog)
- [Docs](https://stacktr.ee/docs)
- [About](/about)
© 2026 Stacktree · stacktr.ee

[Privacy](/privacy)[Terms](/terms)[Security](/security)[Dashboard](https://app.stacktr.ee)[npm](https://www.npmjs.com/package/stacktree-mcp)[Sitemap](/sitemap.xml)[llms.txt](/llms.txt)[API spec](/openapi.json)

---
Full markdown summary of the Stacktree marketing surface: https://stacktr.ee/llms-full.txt
