DEV Community

Cover image for Ghost In The Machine: Helpful Spirit That Makes You Productive
Keerthana Kasthuril
Keerthana Kasthuril

Posted on

Ghost In The Machine: Helpful Spirit That Makes You Productive

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

*This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine*

What I Built

I built Spooky Site Blocker, a privacy-first Chrome extension that acts as a productivity tool possessed by a poltergeist.

I wanted to interpret the "Ghost in the Machine" theme literally. Instead of a standard website blocker that just shows a generic "Time's Up!" screen, this extension reads the actual title of the tab you are wasting time on and generates a hyper-specific, sinister message telling you to leave. If you are procrastinating by watching mechanical keyboard reviews, the screen goes pitch black, a ghost appears, and a local AI whispers something like: "The plastic will outlive you, yet your code remains unwritten. This tab is dead."

Demo

Dev site when blocked by Spooky site blocker

Code

👻 Ghost in the Machine: Local AI Site Blocker

A privacy-first, locally powered Chrome extension built for the Hacktoberfest "Ghost in the Machine" Challenge.

This extension monitors the time you spend on distracting websites. When your time is up, it locks the page with a spooky overlay and uses a local AI model (Gemma) to generate a context-aware, creepy message based on the specific tab you were reading, telling you to get back to work.

🦇 Why Open Innovation Matters Here

A time-tracking extension that actively reads the DOM and titles of your browser tabs is a massive privacy risk if it sends that data to a cloud provider.

By building this with Ollama and the Gemma:2b open-weight model, this project ensures:

  • Total Privacy: Your browsing habits and tab history never leave your machine.
  • Offline Capability: The poltergeist in your machine doesn't need an internet connection to haunt you…

How I Built It

The project is built entirely on local, open-source AI infrastructure:

  • The Brain: I used the open-weight Gemma:2b model running locally via Ollama.
  • The Framework: A vanilla JavaScript Chrome Extension using Manifest V3.

The most interesting technical challenge was getting a Chrome extension to talk to a local AI without triggering modern web security blocks. I couldn't just call the Ollama API from the injected content script because websites like GitHub or YouTube have strict Content Security Policies (CSP) that block requests to localhost.

To solve this, I architected a messaging system where the injected content.js scrapes the page context, passes it to the invisible background.js service worker, which then safely makes the fetch() call to the local Gemma model (running with CORS enabled) and sends the creepy response back to the UI.

Why Does Open Innovation Matter?

Open innovation is the only reason this extension is safe to use.

To generate context-aware messages, the extension has to actively read the DOM and titles of your browser tabs. If I had built this using a closed API, I would be streaming my entire browsing history to a third-party cloud server—a massive privacy violation just for a productivity joke.

By utilizing local inference with Ollama and an open-weight model like Gemma, your browsing data never leaves your machine. Plus, it runs perfectly offline. Your Wi-Fi might go down, but the ghost in your machine will still haunt you.

My Agent Session

I utilized an AI agent as a pair programmer to brainstorm the initial concept and navigate the architectural shift required to bypass Chrome's strict Content Security Policies for local API fetching.

The Spirit of It

The real magic of this project is the jumpscare of accountability. There is something deeply unsettling about being 20 minutes deep into a mindless Reddit rabbit hole, only for your screen to lock up and a localized AI to specifically call out the exact topic you are wasting your life on. It transforms a standard productivity tool into something that genuinely feels like the machine is watching you.

Top comments (0)