Gloop is an open-source framework that lets AI agents modify their own behavior in real-time, spawning new capabilities without requiring a restart or manual redeployment. Built as both a terminal application and TypeScript library by developer ianrumac, Gloop represents a different approach to agentic AI—one where the system isn't just given tools but can write, debug, and install its own.

A Minimal Agent Loop With Maximum Flexibility

At its core, Gloop abstracts the classic agent loop—think, act, evaluate, repeat—into a composable library that requires just three lines to instantiate. The package @hypen-space/gloop-loop exposes an AgentLoop class accepting any OpenAI-compatible provider through OpenRouter, meaning you're not locked into a single model. Want Claude for planning and Gemini for code generation? Pass both in. Built-in primitive tools handle file I/O, shell execution, memory management, and context handling out of the box. The library's Form type defines agent actions as discriminated unions: think (reasoning steps), tool (function calls), seq (sequential operations), and done (completion signals). This typed structure means your editor catches logic errors before runtime—a welcome change from debugging LLM-generated spaghetti code in production.

Integration With the Effect Runtime

For developers already invested in the Effect functional programming ecosystem, @hypen-space/gloop-effect offers native integration. Agents become Effect programs, meaning you can fork agent turns into fibers, compose them with other services using Layers, and pipe events through Stream operations with built-in backpressure. Testing gets a real boost here: swap a Layer to stub the model, mock the filesystem, or fake shell commands without touching globals or monkey-patching anything.

Self-Modifying Capabilities

The headline feature is self-modification. Gloop can edit its own source code, clone itself into project-specific instances with isolated configs and toolsets, and spawn subagents for parallel tasks. Tools hot-reload in-session—build a new capability on the fly, and the agent installs and uses it without restart. The system ships markdown-based "skills" that are discoverable at startup and invocable via /skill-name syntax. The project website itself was generated by Gloop from its own source code—a meta-touch that reinforces the framework's pitch: if you want a truly hackable AI agent, it needs to be able to modify itself.

Getting Started

Clone the repo, run ./setup.sh (requires bun or Node.js), and you're looping. Pass a model as an argument, use --task for task mode, or --debug to inspect what's happening under the hood. Each working directory can have its own gloop instance with local configuration.

Key Takeaways

  • Gloop requires three lines of TypeScript to instantiate a functional agent loop
  • Works with any OpenRouter model—Claude, Gemini, Grok, Deepseek—all swappable
  • Self-modifying: agents write features, fix bugs, and build tools in-session
  • Effect-native integration (@hypen-space/gloop-effect) enables fiber-based concurrency and testable Layer swapping
  • Clone per project with isolated configs; hot-reload tools without restart

The Bottom Line

Gloop isn't for everyone—if you need guardrails and predictability, look elsewhere. But if you're the type who wants an agent that can extend itself, debug its own failures, and adapt to your codebase on the fly, this is one of the more coherent implementations hitting that itch. Worth watching.