The Problem

I have always run into usage limits when conducting my work. And I have always thought that if there were some way to actually utilize time fully and even have my developmental workflow continue developing even when I am not at my computer or asleep, that would lead to maximizing utility while receiving developmental aid from AI applications.

What We Built

Relai is a task-continuation system for Claude that watches a running session, decides — deterministically — whether continuing is safe and justified, and sends the continuation itself. It is not a "press Continue" macro. It maintains a real task record (objective, completed/remaining work, known issues, approved commands, autonomy policy, event history) and only acts within limits the user sets. When it hits something it can't safely resolve — a real question, a stuck loop, a safety limit — it stops and escalates to a human instead of guessing.

How It Works

Every cycle runs a fixed sequence:

$$\text{OBSERVE} \to \text{INTERPRET} \to \text{SAFETY CHECK} \to \text{INTELLIGENCE} \to \text{EXECUTE} \to \text{MEMORY}$$

Two providers supply the OBSERVE step: the official Anthropic Messages API, and a Chrome extension plus local bridge server that drives the user's own already-logged-in claude.ai tab (labeled honestly as browser automation, not an API integration). Before Relai spends a cycle, it checks hard limits — a task with cycle count c, max cycles C, consecutive failures f, and max failures F is only allowed to continue if c < C and f < F, plus runtime and operating-window checks. Every send is idempotent, keyed by taskId:cycle:n, so a crash between "sent" and "recorded" can never cause a duplicate.

AI/ML Approach

The Intelligence Engine is deterministic by default — no LLM call, no API key, no network request. It reads two real inputs: what the user wrote (objective, preset commands, tracked lists) and what Claude's own last visible message says, via pattern matching for questions, completions, errors, and stuck-loop detection uses Jaccard word-overlap similarity between consecutive messages — similarity = |A ∩ B| / |A ∪ B| — and flags a likely-stuck loop above a threshold. Relai never invents instruction content — it only ever selects and lightly augments commands the user already approved. This is deliberate: an auditable decision layer with no prompt-injection surface between "Claude said X" and "Relai sent Y."

Challenges & What We Learned

The hardest part wasn't the AI logic — it was resisting the pull to make Relai "smarter" by just adding an LLM call everywhere. Keeping the default path fully deterministic forced real engineering discipline: every heuristic had to be explainable and testable on its own. The browser bridge was the other challenge — DOM automation against claude.ai is inherently brittle, so selectors were centralized into one array specifically to make breakage a one-line fix instead of a rewrite.

What's Next for Relai

Real multi-user auth, a pluggable (opt-in) LLM engine for harder ambiguity cases, and support for additional providers beyond Claude.

AI Tools Disclosure

When I first got the idea, I used Chatgpt to research on the scope of my proposed idea. Claude was used while building the extension, I first laid out a barebones folder structure and project vision and then used Claude to iterate it on it, then I tested each version made manual edits where unforeseen errors came and the cycle repeated , So Claude undertook most of the heavy-work of development and also the technical writing aspects.

Built With

Share this project:

Updates

Submission history