{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/steipete-me/2025-08-05-poltergeist-the-ghost-that-keeps-your-builds-fresh/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "![](https://steipete.me/assets/img/2025/poltergeist-ghost-keeps-builds-fresh/header.png)\n\n**TL;DR**: [Poltergeist](http://polter.build) is an AI-friendly universal file-watcher that auto-detects any project and rebuilds them as soon as a file has been changed. It’s `npm run dev` for native apps, with automatic configuration, notifications and a smart build queue.\n\n## The Story\n\nIn agentic engineering, loop iteration speed is everything. While building [Peekaboo](https://peekaboo.boo), a macOS OS automation agent/cli/mcp written in Swift, my main friction point is build time. Swift isn’t famous for its fast compiler, and it’s especially noticeable once you start doing more web dev. In the time Swift is calculating dependencies, my TypeScript project already recompiled.\n\nWorse, agents would sometimes forget to rebuild before testing, leading to debugging sessions on code that was already fixed.\n\nPoltergeist fixes that. It builds in the background as soon as a file has been changed, accelerating the code/debug loop for both agents and humans.\n\nSo I wrote a quick bash script to watch Swift files and auto-rebuild in the background. Problem solved - for Swift. But then I realized this would be incredibly useful for any kind of project. I already had both the CLI and Mac app building automatically, and I figured out this could work for so many other use cases.\n\nThat’s when I decided to make this more of a thing - and went into another rabbit hole of building tools for my agents so I can be faster building tools for my agents.\n\n## The Universal Solution\n\nI rewrote the entire system in TypeScript with one goal: make it work for any project, any language, any build system. [Poltergeist](https://github.com/steipete/poltergeist) became a universal file watcher that ‘haunts’ your projects.\n\nWhile there are tools like `watchexec`, I didn’t find anything that was designed with an agentic engineering flow in mind. Poltergeist even [detects if a human or agent calls it](https://github.com/steipete/poltergeist/blob/85d8edfdd48ae4c6b30813264ce453d1df78ee83/src/cli.ts#L389) and adds helpful messages for agents to steer them to correct usage, even without polluting your AGENTS.ms file.\n\nEverything happens invisibly. Save a file. By the time you’re ready to test, the fresh binary is waiting. For Mac apps, it even quits and relaunches automatically (yah I hear you, that’s a config setting). True hot reload would be nice, but that’s something for the future.\n\n## Channeling the Spirit\n\nI’ve built Poltergeist completely with Claude Code. It’s a build tool and in the beginning I didn’t plan to make it a thing, only once I saw how useful it is, I decided to spend extra time and focus on it to make it its own thing. It started as a bunch of bash scripts, eventually I asked my agent to convert these into TypeScript and then kept iterating on it.\n\nSentences like “all autogenerated code” are insofar not meaningful anymore, as I’ve surely written (or rather: talked) 20 pages of prompts to perfect the design. With AI, English is the new programming language, and the fact that it’s TypeScript is more an implementation detail.\n\nWhy TypeScript? Agents can write it extremely well, the iteration flow is amazingly fast, compilation is instant, it’s cross-platform and Watchman has TypeScript bindings for it.\n\n## Dancing with Agents\n\nYou’ve already noticed - I love building developer tools and stuff that makes my life easier. Poltergeist seemed like such an obvious idea, that I was surprised that it didn’t exist yet.\n\nI usually use [my spec.md based approach](https://steipete.me/posts/2025/understanding-codebases-with-ai-gemini-workflow) for new projects, however this one evolved from some bash scripts to a full-blown dev tool, so there’s no spec, just a lot of prompts and iterating.\n\nBuilding it almost felt too easy. Agents are extremely good at writing TypeScript and Go, so Claude one-shotted most of my prompts. I use [WisprFlow](https://wisprflow.ai) and my prompts are usually quite long ramblings. I learned that talking more and giving *reason* to the things you want, really helps agents to understand and build the right thing.\n\nThe process is in most cases: long prompt + plan only ultrathink. Sometimes also: Give me a few options - esp. when I’m unsure what to do.\n\nI don’t use Claude’s plan mode, simply saying “plan only” works equally well and fits my flow better (and [don’t get me started on subagents](https://x.com/steipete/status/1952763998266372231)). I often iterate multiple times on a plan before I type “y” to build it.\n\nAfter it’s done I usually write “add tests + update docs” - adding tests per feature is much better than trying to add them at the end, plus if you have the feature in your context, writing tests will almost always uncover bugs in the feature implementation, and since the agent has all context it’s the best time to fix it. If I prompt everything at once they usually still stop and seem less focused - thus the explicit separation.\n\nI add [CI early on GitHub](https://github.com/steipete/poltergeist/actions/runs/16762891298) (again, simply ask cc) which is another layer of testing, that way I can make sure the project works with all OSes, not just on my Mac.\n\nWhile writing this blog post, I asked Claude about his opinion on my language choice, and [it didn’t give me the answer I expected](https://x.com/steipete/status/1952748261472641170). So - you can already guess - I did the obvious thing and let it loop a few hours to rewrite it in Go.\n\n## From Poltergeist to Poltergohst\n\nPorting your project to a different language would have been nuts just a few months ago, these days I can just use agents and let them run in loops until it’s done. I saw this as an experiment to again try out open models and alternative CLIs [and tweeted about it here](https://x.com/steipete/status/1952748261472641170) - currently there are still too many bugs around Qwen 3 Coder and GLM 4.5 with OpenCode and Crush so I can’t recommend either.\n\nThey both have potential but just aren’t well-tested yet with open models and you’ll eventually encounter API errors and slowdowns. Which is unfortunate, since Qwen 3 Coder’s 1 Mio context window would have been perfect to absorb the whole project in one go and convert it.\n\nMy process with Claude Code was to convert all important files (sources, tests, not examples) to one big 1.1MB markdown file, and then copy/paste the complete text with the command “convert to Go”. That way you work around the 256KB limit that would make claude only read the file partially and slowly.\n\nThere are many websites to do the GitHub conversion, [I prefer this one](https://repo2txt.simplebasedomain.com) as it makes it easy to select file types and is fast+simple.\n\nI didn’t use any todo structure for the conversion and simply nudged Claude a few times to continue - models tend to stop eventually (after ~30-60 min loops), no sophisticated prompts were required though.\n\nWhile I built Poltergeist mostly with Claude Sonnet, I did the conversion with [Opus 4.1](https://www.anthropic.com/news/claude-opus-4-1), to celebrate its release. To improve code quality, I searched for [an idiomatic, modern Go guide](https://gist.github.com/ashokallu/26445f706d33308b0f243f76618cb687) and ran a few refactors with that.\n\nUltimately I decided against Go, since I’m not super comfortable in it, and with [Bun’s SPA mode](https://x.com/jarredsumner/status/1952827266440019986), startup time is at ~44ms, and it’s perfect to distribute as a single binary (~20 MB compressed) on Homebrew.\n\nThere’s also the ecosystem argument that I didn’t see initially. Poltergeist uses Watchman under the hood which has superb TypeScript bindings, but no official Go bindings, leading to more code to maintain. [The only Go binding project](https://github.com/sjansen/watchman) that exists hasn’t been maintained in years.\n\nI kept this experiment on GitHub - [check out poltergohst](https://github.com/steipete/poltergohst).\n\n## Seance Time\n\nPick homebrew if you’re on a modern Mac, otherwise npm. The npm version needs [Watchman](https://facebook.github.io/watchman/docs/install.html) and [Node](https://nodejs.org/en/download).\n\n```bash\n# For modern macOS\nbrew tap steipete/tap\nbrew install poltergeist\n\n# Windows, Linux, Intel Mac (Node 20+)\nnpm install -g @steipete/poltergeist\n\n# Auto-detect and configure your project\npoltergeist init\n\n# That's it! (`start` works too, gotta keep the agents happy!)\npoltergeist haunt\n\n# Run your tool (always fresh!)\npolter my-cli --help\n```\n\nOh, before I forget - there’s also a native macOS menu bar app! It still needs some work so I haven’t released it yet, you can totally [get the source though](https://github.com/steipete/poltergeist/tree/main/apps/mac) and play with it. With that you’ll always see if Poltergeist is compiling and if your build is red or green. Might just call it Ghostbuster.\n\n### Catch the Ghost\n\nPoltergeist is a new kind of tool that’s built for humans and agents in mind - something we’ll surely see more of in the future. You install it once and then forget about it, since it fades into the background, your agent will use it automatically and you can use it or keep doing things the manual way. It’s the perfect invisible addition - you don’t see it, yet it’s here and helps you get results faster.\n\nThe best tools are invisible until you need them, then indispensable once you have them. [Poltergeist](http://polter.build) is both - and it’s just one `init` away.\n",
  "authors": [],
  "captured_at": "2026-09-27T19:29:15.293681927+00:00",
  "category": "programming",
  "content_html": "<p><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://steipete.me/assets/img/2025/poltergeist-ghost-keeps-builds-fresh/header.png\" alt=\"\" loading=\"eager\" decoding=\"async\" fetchpriority=\"high\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></p>\n<p><strong>TL;DR</strong>: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://polter.build\">Poltergeist</a> is an AI-friendly universal file-watcher that auto-detects any project and rebuilds them as soon as a file has been changed. It’s <code>npm run dev</code> for native apps, with automatic configuration, notifications and a smart build queue.</p>\n<h2>The Story</h2>\n<p>In agentic engineering, loop iteration speed is everything. While building <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://peekaboo.boo\">Peekaboo</a>, a macOS OS automation agent/cli/mcp written in Swift, my main friction point is build time. Swift isn’t famous for its fast compiler, and it’s especially noticeable once you start doing more web dev. In the time Swift is calculating dependencies, my TypeScript project already recompiled.</p>\n<p>Worse, agents would sometimes forget to rebuild before testing, leading to debugging sessions on code that was already fixed.</p>\n<p>Poltergeist fixes that. It builds in the background as soon as a file has been changed, accelerating the code/debug loop for both agents and humans.</p>\n<p>So I wrote a quick bash script to watch Swift files and auto-rebuild in the background. Problem solved - for Swift. But then I realized this would be incredibly useful for any kind of project. I already had both the CLI and Mac app building automatically, and I figured out this could work for so many other use cases.</p>\n<p>That’s when I decided to make this more of a thing - and went into another rabbit hole of building tools for my agents so I can be faster building tools for my agents.</p>\n<h2>The Universal Solution</h2>\n<p>I rewrote the entire system in TypeScript with one goal: make it work for any project, any language, any build system. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/steipete/poltergeist\">Poltergeist</a> became a universal file watcher that ‘haunts’ your projects.</p>\n<p>While there are tools like <code>watchexec</code>, I didn’t find anything that was designed with an agentic engineering flow in mind. Poltergeist even <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/steipete/poltergeist/blob/85d8edfdd48ae4c6b30813264ce453d1df78ee83/src/cli.ts#L389\">detects if a human or agent calls it</a> and adds helpful messages for agents to steer them to correct usage, even without polluting your AGENTS.ms file.</p>\n<p>Everything happens invisibly. Save a file. By the time you’re ready to test, the fresh binary is waiting. For Mac apps, it even quits and relaunches automatically (yah I hear you, that’s a config setting). True hot reload would be nice, but that’s something for the future.</p>\n<h2>Channeling the Spirit</h2>\n<p>I’ve built Poltergeist completely with Claude Code. It’s a build tool and in the beginning I didn’t plan to make it a thing, only once I saw how useful it is, I decided to spend extra time and focus on it to make it its own thing. It started as a bunch of bash scripts, eventually I asked my agent to convert these into TypeScript and then kept iterating on it.</p>\n<p>Sentences like “all autogenerated code” are insofar not meaningful anymore, as I’ve surely written (or rather: talked) 20 pages of prompts to perfect the design. With AI, English is the new programming language, and the fact that it’s TypeScript is more an implementation detail.</p>\n<p>Why TypeScript? Agents can write it extremely well, the iteration flow is amazingly fast, compilation is instant, it’s cross-platform and Watchman has TypeScript bindings for it.</p>\n<h2>Dancing with Agents</h2>\n<p>You’ve already noticed - I love building developer tools and stuff that makes my life easier. Poltergeist seemed like such an obvious idea, that I was surprised that it didn’t exist yet.</p>\n<p>I usually use <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://steipete.me/posts/2025/understanding-codebases-with-ai-gemini-workflow\">my spec.md based approach</a> for new projects, however this one evolved from some bash scripts to a full-blown dev tool, so there’s no spec, just a lot of prompts and iterating.</p>\n<p>Building it almost felt too easy. Agents are extremely good at writing TypeScript and Go, so Claude one-shotted most of my prompts. I use <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://wisprflow.ai\">WisprFlow</a> and my prompts are usually quite long ramblings. I learned that talking more and giving <em>reason</em> to the things you want, really helps agents to understand and build the right thing.</p>\n<p>The process is in most cases: long prompt + plan only ultrathink. Sometimes also: Give me a few options - esp. when I’m unsure what to do.</p>\n<p>I don’t use Claude’s plan mode, simply saying “plan only” works equally well and fits my flow better (and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://x.com/steipete/status/1952763998266372231\">don’t get me started on subagents</a>). I often iterate multiple times on a plan before I type “y” to build it.</p>\n<p>After it’s done I usually write “add tests + update docs” - adding tests per feature is much better than trying to add them at the end, plus if you have the feature in your context, writing tests will almost always uncover bugs in the feature implementation, and since the agent has all context it’s the best time to fix it. If I prompt everything at once they usually still stop and seem less focused - thus the explicit separation.</p>\n<p>I add <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/steipete/poltergeist/actions/runs/16762891298\">CI early on GitHub</a> (again, simply ask cc) which is another layer of testing, that way I can make sure the project works with all OSes, not just on my Mac.</p>\n<p>While writing this blog post, I asked Claude about his opinion on my language choice, and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://x.com/steipete/status/1952748261472641170\">it didn’t give me the answer I expected</a>. So - you can already guess - I did the obvious thing and let it loop a few hours to rewrite it in Go.</p>\n<h2>From Poltergeist to Poltergohst</h2>\n<p>Porting your project to a different language would have been nuts just a few months ago, these days I can just use agents and let them run in loops until it’s done. I saw this as an experiment to again try out open models and alternative CLIs <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://x.com/steipete/status/1952748261472641170\">and tweeted about it here</a> - currently there are still too many bugs around Qwen 3 Coder and GLM 4.5 with OpenCode and Crush so I can’t recommend either.</p>\n<p>They both have potential but just aren’t well-tested yet with open models and you’ll eventually encounter API errors and slowdowns. Which is unfortunate, since Qwen 3 Coder’s 1 Mio context window would have been perfect to absorb the whole project in one go and convert it.</p>\n<p>My process with Claude Code was to convert all important files (sources, tests, not examples) to one big 1.1MB markdown file, and then copy/paste the complete text with the command “convert to Go”. That way you work around the 256KB limit that would make claude only read the file partially and slowly.</p>\n<p>There are many websites to do the GitHub conversion, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://repo2txt.simplebasedomain.com\">I prefer this one</a> as it makes it easy to select file types and is fast+simple.</p>\n<p>I didn’t use any todo structure for the conversion and simply nudged Claude a few times to continue - models tend to stop eventually (after ~30-60 min loops), no sophisticated prompts were required though.</p>\n<p>While I built Poltergeist mostly with Claude Sonnet, I did the conversion with <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.anthropic.com/news/claude-opus-4-1\">Opus 4.1</a>, to celebrate its release. To improve code quality, I searched for <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://gist.github.com/ashokallu/26445f706d33308b0f243f76618cb687\">an idiomatic, modern Go guide</a> and ran a few refactors with that.</p>\n<p>Ultimately I decided against Go, since I’m not super comfortable in it, and with <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://x.com/jarredsumner/status/1952827266440019986\">Bun’s SPA mode</a>, startup time is at ~44ms, and it’s perfect to distribute as a single binary (~20 MB compressed) on Homebrew.</p>\n<p>There’s also the ecosystem argument that I didn’t see initially. Poltergeist uses Watchman under the hood which has superb TypeScript bindings, but no official Go bindings, leading to more code to maintain. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/sjansen/watchman\">The only Go binding project</a> that exists hasn’t been maintained in years.</p>\n<p>I kept this experiment on GitHub - <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/steipete/poltergohst\">check out poltergohst</a>.</p>\n<h2>Seance Time</h2>\n<p>Pick homebrew if you’re on a modern Mac, otherwise npm. The npm version needs <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://facebook.github.io/watchman/docs/install.html\">Watchman</a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://nodejs.org/en/download\">Node</a>.</p>\n<pre><code class=\"language-bash\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> For modern macOS</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">brew</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> tap steipete/tap</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">brew</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> install poltergeist</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> Windows, Linux, Intel Mac (Node 20+)</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">npm</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> install<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>g</span> @steipete/poltergeist</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> Auto-detect and configure your project</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">poltergeist</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> init</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> That&#39;s it! (`start` works too, gotta keep the agents happy!)</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">poltergeist</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> haunt</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> Run your tool (always fresh!)</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">polter</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> my-cli<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>help</span></span>\n</span></span></code></pre>\n<p>Oh, before I forget - there’s also a native macOS menu bar app! It still needs some work so I haven’t released it yet, you can totally <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/steipete/poltergeist/tree/main/apps/mac\">get the source though</a> and play with it. With that you’ll always see if Poltergeist is compiling and if your build is red or green. Might just call it Ghostbuster.</p>\n<h3>Catch the Ghost</h3>\n<p>Poltergeist is a new kind of tool that’s built for humans and agents in mind - something we’ll surely see more of in the future. You install it once and then forget about it, since it fades into the background, your agent will use it automatically and you can use it or keep doing things the manual way. It’s the perfect invisible addition - you don’t see it, yet it’s here and helps you get results faster.</p>\n<p>The best tools are invisible until you need them, then indispensable once you have them. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://polter.build\">Poltergeist</a> is both - and it’s just one <code>init</code> away.</p>\n",
  "content_markdown": "![](https://steipete.me/assets/img/2025/poltergeist-ghost-keeps-builds-fresh/header.png)\n\n**TL;DR**: [Poltergeist](http://polter.build) is an AI-friendly universal file-watcher that auto-detects any project and rebuilds them as soon as a file has been changed. It’s `npm run dev` for native apps, with automatic configuration, notifications and a smart build queue.\n\n## The Story\n\nIn agentic engineering, loop iteration speed is everything. While building [Peekaboo](https://peekaboo.boo), a macOS OS automation agent/cli/mcp written in Swift, my main friction point is build time. Swift isn’t famous for its fast compiler, and it’s especially noticeable once you start doing more web dev. In the time Swift is calculating dependencies, my TypeScript project already recompiled.\n\nWorse, agents would sometimes forget to rebuild before testing, leading to debugging sessions on code that was already fixed.\n\nPoltergeist fixes that. It builds in the background as soon as a file has been changed, accelerating the code/debug loop for both agents and humans.\n\nSo I wrote a quick bash script to watch Swift files and auto-rebuild in the background. Problem solved - for Swift. But then I realized this would be incredibly useful for any kind of project. I already had both the CLI and Mac app building automatically, and I figured out this could work for so many other use cases.\n\nThat’s when I decided to make this more of a thing - and went into another rabbit hole of building tools for my agents so I can be faster building tools for my agents.\n\n## The Universal Solution\n\nI rewrote the entire system in TypeScript with one goal: make it work for any project, any language, any build system. [Poltergeist](https://github.com/steipete/poltergeist) became a universal file watcher that ‘haunts’ your projects.\n\nWhile there are tools like `watchexec`, I didn’t find anything that was designed with an agentic engineering flow in mind. Poltergeist even [detects if a human or agent calls it](https://github.com/steipete/poltergeist/blob/85d8edfdd48ae4c6b30813264ce453d1df78ee83/src/cli.ts#L389) and adds helpful messages for agents to steer them to correct usage, even without polluting your AGENTS.ms file.\n\nEverything happens invisibly. Save a file. By the time you’re ready to test, the fresh binary is waiting. For Mac apps, it even quits and relaunches automatically (yah I hear you, that’s a config setting). True hot reload would be nice, but that’s something for the future.\n\n## Channeling the Spirit\n\nI’ve built Poltergeist completely with Claude Code. It’s a build tool and in the beginning I didn’t plan to make it a thing, only once I saw how useful it is, I decided to spend extra time and focus on it to make it its own thing. It started as a bunch of bash scripts, eventually I asked my agent to convert these into TypeScript and then kept iterating on it.\n\nSentences like “all autogenerated code” are insofar not meaningful anymore, as I’ve surely written (or rather: talked) 20 pages of prompts to perfect the design. With AI, English is the new programming language, and the fact that it’s TypeScript is more an implementation detail.\n\nWhy TypeScript? Agents can write it extremely well, the iteration flow is amazingly fast, compilation is instant, it’s cross-platform and Watchman has TypeScript bindings for it.\n\n## Dancing with Agents\n\nYou’ve already noticed - I love building developer tools and stuff that makes my life easier. Poltergeist seemed like such an obvious idea, that I was surprised that it didn’t exist yet.\n\nI usually use [my spec.md based approach](https://steipete.me/posts/2025/understanding-codebases-with-ai-gemini-workflow) for new projects, however this one evolved from some bash scripts to a full-blown dev tool, so there’s no spec, just a lot of prompts and iterating.\n\nBuilding it almost felt too easy. Agents are extremely good at writing TypeScript and Go, so Claude one-shotted most of my prompts. I use [WisprFlow](https://wisprflow.ai) and my prompts are usually quite long ramblings. I learned that talking more and giving *reason* to the things you want, really helps agents to understand and build the right thing.\n\nThe process is in most cases: long prompt + plan only ultrathink. Sometimes also: Give me a few options - esp. when I’m unsure what to do.\n\nI don’t use Claude’s plan mode, simply saying “plan only” works equally well and fits my flow better (and [don’t get me started on subagents](https://x.com/steipete/status/1952763998266372231)). I often iterate multiple times on a plan before I type “y” to build it.\n\nAfter it’s done I usually write “add tests + update docs” - adding tests per feature is much better than trying to add them at the end, plus if you have the feature in your context, writing tests will almost always uncover bugs in the feature implementation, and since the agent has all context it’s the best time to fix it. If I prompt everything at once they usually still stop and seem less focused - thus the explicit separation.\n\nI add [CI early on GitHub](https://github.com/steipete/poltergeist/actions/runs/16762891298) (again, simply ask cc) which is another layer of testing, that way I can make sure the project works with all OSes, not just on my Mac.\n\nWhile writing this blog post, I asked Claude about his opinion on my language choice, and [it didn’t give me the answer I expected](https://x.com/steipete/status/1952748261472641170). So - you can already guess - I did the obvious thing and let it loop a few hours to rewrite it in Go.\n\n## From Poltergeist to Poltergohst\n\nPorting your project to a different language would have been nuts just a few months ago, these days I can just use agents and let them run in loops until it’s done. I saw this as an experiment to again try out open models and alternative CLIs [and tweeted about it here](https://x.com/steipete/status/1952748261472641170) - currently there are still too many bugs around Qwen 3 Coder and GLM 4.5 with OpenCode and Crush so I can’t recommend either.\n\nThey both have potential but just aren’t well-tested yet with open models and you’ll eventually encounter API errors and slowdowns. Which is unfortunate, since Qwen 3 Coder’s 1 Mio context window would have been perfect to absorb the whole project in one go and convert it.\n\nMy process with Claude Code was to convert all important files (sources, tests, not examples) to one big 1.1MB markdown file, and then copy/paste the complete text with the command “convert to Go”. That way you work around the 256KB limit that would make claude only read the file partially and slowly.\n\nThere are many websites to do the GitHub conversion, [I prefer this one](https://repo2txt.simplebasedomain.com) as it makes it easy to select file types and is fast+simple.\n\nI didn’t use any todo structure for the conversion and simply nudged Claude a few times to continue - models tend to stop eventually (after ~30-60 min loops), no sophisticated prompts were required though.\n\nWhile I built Poltergeist mostly with Claude Sonnet, I did the conversion with [Opus 4.1](https://www.anthropic.com/news/claude-opus-4-1), to celebrate its release. To improve code quality, I searched for [an idiomatic, modern Go guide](https://gist.github.com/ashokallu/26445f706d33308b0f243f76618cb687) and ran a few refactors with that.\n\nUltimately I decided against Go, since I’m not super comfortable in it, and with [Bun’s SPA mode](https://x.com/jarredsumner/status/1952827266440019986), startup time is at ~44ms, and it’s perfect to distribute as a single binary (~20 MB compressed) on Homebrew.\n\nThere’s also the ecosystem argument that I didn’t see initially. Poltergeist uses Watchman under the hood which has superb TypeScript bindings, but no official Go bindings, leading to more code to maintain. [The only Go binding project](https://github.com/sjansen/watchman) that exists hasn’t been maintained in years.\n\nI kept this experiment on GitHub - [check out poltergohst](https://github.com/steipete/poltergohst).\n\n## Seance Time\n\nPick homebrew if you’re on a modern Mac, otherwise npm. The npm version needs [Watchman](https://facebook.github.io/watchman/docs/install.html) and [Node](https://nodejs.org/en/download).\n\n```bash\n# For modern macOS\nbrew tap steipete/tap\nbrew install poltergeist\n\n# Windows, Linux, Intel Mac (Node 20+)\nnpm install -g @steipete/poltergeist\n\n# Auto-detect and configure your project\npoltergeist init\n\n# That's it! (`start` works too, gotta keep the agents happy!)\npoltergeist haunt\n\n# Run your tool (always fresh!)\npolter my-cli --help\n```\n\nOh, before I forget - there’s also a native macOS menu bar app! It still needs some work so I haven’t released it yet, you can totally [get the source though](https://github.com/steipete/poltergeist/tree/main/apps/mac) and play with it. With that you’ll always see if Poltergeist is compiling and if your build is red or green. Might just call it Ghostbuster.\n\n### Catch the Ghost\n\nPoltergeist is a new kind of tool that’s built for humans and agents in mind - something we’ll surely see more of in the future. You install it once and then forget about it, since it fades into the background, your agent will use it automatically and you can use it or keep doing things the manual way. It’s the perfect invisible addition - you don’t see it, yet it’s here and helps you get results faster.\n\nThe best tools are invisible until you need them, then indispensable once you have them. [Poltergeist](http://polter.build) is both - and it’s just one `init` away.\n",
  "dateCreated": "2026-09-27T19:29:15.293681927+00:00",
  "date_created": "2025-08-05T14:00:00+00:00",
  "date_modified": "2025-08-05T14:00:00+00:00",
  "date_published": "2025-08-05T14:00:00+00:00",
  "description": "Meet Poltergeist: an AI-friendly universal build watcher that auto-detects and rebuilds any project—Swift, Rust, Node.js, CMake, or anything else—the moment you save a file. Zero config, just haunting productivity.",
  "external_url": "https://steipete.me/posts/2025/poltergeist-ghost-keeps-builds-fresh/",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/steipete-me/2025/08/2025-08-05-poltergeist-the-ghost-that-keeps-your-builds-fresh.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/steipete-me/2025/08/2025-08-05-poltergeist-the-ghost-that-keeps-your-builds-fresh.md"
  },
  "id": "urn:aggr:item:f3da15d401dd15ce46932374a91437d28dbb1ee3",
  "isBasedOn": {
    "@id": "https://steipete.me/posts/2025/poltergeist-ghost-keeps-builds-fresh/"
  },
  "mainEntity": {
    "@id": "https://steipete.me/posts/2025/poltergeist-ghost-keeps-builds-fresh/",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/steipete-me/2025-08-05-poltergeist-the-ghost-that-keeps-your-builds-fresh/#webpage"
    },
    "dateModified": "2025-08-05T14:00:00+00:00",
    "datePublished": "2025-08-05T14:00:00+00:00",
    "headline": "Poltergeist: The Ghost That Keeps Your Builds Fresh",
    "timeRequired": "PT7M",
    "url": "https://steipete.me/posts/2025/poltergeist-ghost-keeps-builds-fresh/",
    "wordCount": 1453
  },
  "name": "Archived snapshot: Poltergeist: The Ghost That Keeps Your Builds Fresh",
  "preview": null,
  "reading_minutes": 7,
  "replicated_at": null,
  "source": "steipete-me",
  "source_name": "Peter Steinberger",
  "summary": "Meet Poltergeist: an AI-friendly universal build watcher that auto-detects and rebuilds any project—Swift, Rust, Node.js, CMake, or anything else—the moment you save a file. Zero config, just haunting productivity.",
  "tags": [],
  "temporalCoverage": "2026-09-27T19:29:15.293681927+00:00",
  "title": "Poltergeist: The Ghost That Keeps Your Builds Fresh",
  "url": "https://aggr.aymericbeaumet.com/items/steipete-me/2025-08-05-poltergeist-the-ghost-that-keeps-your-builds-fresh/",
  "word_count": 1453
}