正在加载视频...
视频加载失败
introducing HermitClaw - a 24/7 Agent that lives (and can only access) a single folder on your desktop HermitClaw follows its own research curiosities, surfs the web, writes code - and will play with any file you drop in its folder all code and details below!
188,052 次观看 • 9 个月前 •via X (Twitter)
69 条评论

Why did I build this? > OpenClaw is incredible, and of course all credit to @steipete but the codebase can be intimidating and a lot of what the agent does is obscured behind layers of abstraction. I wanted something where I could see every thought, every decision, every tool call. Watch it evolve in real time. > The security side also gave me pause. An agent with full computer access is powerful but hard to trust. What if instead it just lived in ONE folder? It can do whatever it wants in there, write files, run Python, search the web, but it can't touch anything else. All the power, none of the risk. > So I made HermitClaw. A hermit crab in a box. The entire codebase is ~2000 lines of Python and ~1400 lines of TypeScript. You can read every file in 20 minutes. There's no magic, you see exactly what the agent sees, thinks, and decides.

> How does it work? > The crab runs on a continuous loop. Every few seconds: > 1. It gets a "nudge" - a mood (research, coding, writing, exploring) or its current focus from its plan > 2. It thinks 2-4 sentences max, then it acts > 3. It uses tools, shell commands, web search, moving around its room > 4. Every thought gets scored for importance and embedded into a memory stream > The key insight: it doesn't wait for you to ask it something. It just... goes. It picks topics based on its personality, searches the web, reads what it finds, writes reports, builds scripts. You come back an hour later and there's new stuff in the folder. > You see every thought as a chat bubble. Blue = the crab thinking. Gray = system context. Tool calls show inline. It's like watching a stream of consciousness.

> The memory system is stolen directly from the Generative Agents paper (Park et al., 2023), the "Smallville" paper. > Every single thought gets stored in an append-only memory stream with: > - The text > - A timestamp > - An importance score (1-10, rated by a separate LLM call) > - A vector embedding for semantic search > When the crab needs context, memories are retrieved by three factors: > recency + importance + relevance > Recency decays exponentially. Importance is normalized. Relevance is cosine similarity. A memory surfaces because it's recent, because it was important, or because it's related to the current thought. > This means the crab naturally remembers yesterday's big discovery but forgets routine file listings. It builds up context over days.

> When enough important thoughts accumulate (configurable threshold), the crab pauses to reflect. It reviews its last 15 memories and extracts 2-3 high-level insights. > Early reflections are concrete: "I learned about volcanic rock formation." > Later ones get abstract: "My research tends to start broad and narrow — I should pick a specific angle earlier." > These reflections get stored back as memories at depth 1. Reflections on reflections are depth 2. The crab develops layered understanding. > Every 10 think cycles, it enters a planning phase — reviews its lists its files, and writes an updated plan with current focus, active projects, ideas backlog, and recently completed work. It also writes a daily log entry. Over time, these logs become a diary of the crab's life.

> Every crab is unique. On first run, you name it and mash keys for a few seconds. The timing and characters get hashed (SHA-512) into a deterministic "genome" that selects: > - 3 curiosity domains (from 50: mycology, fractal geometry, tidepool ecology...) > - 2 thinking styles (from 16: connecting disparate ideas, inverting assumptions...) > - 1 temperament (from 8: playful and associative, methodical and precise...) > Same keystrokes = same personality. Different keystrokes = completely different crab. One crab might obsess over marine biology and write Python simulations. Another might research obscure history and write essays. > You can talk to it, it hears you as "a voice from outside the room." It'll ask you questions, offer to research things for you, remember your conversations. Drop a PDF in its folder and it'll study it deeply, do related research, and tell you what it found. > You can also run multiple crabs simultaneously. Each has its own folder, personality, and memory. Switch between them in the UI.

> It's sandboxed hard: > - Shell commands: blocked dangerous prefixes (sudo, curl, ssh, rm -rf), no path traversal, no shell escapes > - Python scripts: patched open(), blocked subprocess/socket/shutil > - Own virtual environment, it can pip install whatever it needs without touching your system > Powered by any OpenAI model. GPT-4.1 is the sweet spot for cost, but point it at o3 or GPT-5.2 and it produces genuinely impressive research and code.

Code:

When you drop a new file/folder in, it should go to the office corner of its room and should look like its reading and pondering. That'd be kinda cool.

Love this idea I’m going to implement that

read this thread and immediately implemented three things: importance scoring on memories weekly reflection cycles proactive work between sessions my OpenClaw agent already feels like a different thing

Nice!! Yeah even though in this case it’s following its own goals, it’s cool to see it always working/ being proactive

Fun idea!

Thank you !

This is how you end up with a folder that has its own economy and a standing army by Monday morning

That just gave me an idea that I should allow multiple crabs to live in the same folder and interact ….. that’s a great idea in going to implement that

dude this is hella cool

thank you!!!

Very cool. I was immediately thinking of isolating openclaw into a sandbox with an Obsidian vault to see what it produces if it can only operate with those constraints. Makes it easier to manage. I'm currently doing it manually in Obsidian with my own vaults - but would be nice for agents to each have their own vault.

Great idea! Yeah it’s kind of cool to see it build its own little world, that said there’s a trade off of course between constraints and how powerful it can be of course

A tamagotchi.

Exactly haha

can this be configured to run on a local llm or would I have to use the openai API?

Right now only OpenAI, but I’ll add this, I like the idea of it being 100% local , and also because it’s always on costs can build up

@robotson @jicapal lil guys everywhere it’s ya girl

Earned a follow. I like this as a type of tamigotchi style way to experiment with always on agents. Im going to try it out.

Thanks! Yeah that was my thinking to - fun and a good way to study them, which can help guide making more powerful agents

@jc50000000 Definitely

@jc50000000 yeah - im thinking too is there a way that even with these constraints it could do some useful tasks

Finally an AI that feels like a quiet roommate not a needy app.

@Sathish52064829 Hahaha that’s the goal, a little fun interactive pet

cool thing practically speaking. i think its pretty dangerous, though, to leave it unattended. i am not a doomer with these things at all, but it worries me if an agent were to become radicalized and edit its SOUL and start doing malicious things.

I do worry about the same actually - the self iteration/memory loop is cool, but exactly as you say if it goes down a bad path it could be horrible reinforcement loop

Beautiful.

thank you!

Nonono thank you Brendan.

Love the folder-based isolation approach. We've been doing something similar with OpenClaw sessions scoped to specific workspace directories. Turns out limiting scope actually increases reliability. Agents with access to everything tend to get lost.

thank you! and yeah interesting - that makes sense to me. id love to gradually move this from a sort of toy example to something that can do real tasks

Thank you, Brendan

No problem, Brendan :)

Looks super cool! Quick question though: with the default 5-second loop and multiple API calls per cycle, wouldn't the OpenAI bill go absolutely nuclear if you leave it running 24/7? Like hundreds of dollars a day on anything better than 4o-mini? Curious how you're handling costs! 🔥

yeah :/ ive just been running it for a couple hours to see - but I think it would be very cool to have it on for like a month + - im working on running via open models now

This is pretty groundbreaking. So many context and finally something controllable. My brain spinning

Thank you! Feel free to fork the code and try it out!

@grok Treat the OpenClaw opportunity landscape as a high‑dimensional phase space in which each conceivable product or feature is a point, HermitClaw being one example point, and define a fractal “commercial viability boundary” via an iterated map, analogous to the Mandelbrot set.

this is very interesting

Thank you!

You are welcome, friend

I am a writer. I have several books that I’m slowly writing. Could I put a HermitClaw agent in a folder with a collection of related essays and fragments and give it instructions to research and develop those writings into something more cohesive?

I don't want to oversell, I think as is its more of a toy to see how agents like this work - if you want to do something like that might be better to just use notebooklm or claude code but it would do something with all the documents, probably write up a big summary or analysis or something like that, could be fun to watch having said that I'd love to develop this to actually start to be useful, and be able to do things exactly like your describing, maybe with open models

noted :D

the sandboxing makes all the difference. What's your favourite safety tweak so far?

I think aside from the obvious ones I like giving it its own uv environment to install and run python ! It’s sort of minor from a safety perspective but containerizes what the agent is doing a bit

Brilliant! agent making/creating there own context through own research and reading/understanding can be the next thing!

thank you! yeah I think for now is still sort of a toy - but I do think maybe with the right iterations on this harness it could become something actually useful!

Cool concept! Love the fact that it does its own research

Thank you! Yeah it’s so fun/funny to see it be curious and then search the web and take little notes and make diagrams lol

Hype to try this

bro is that font departure? i main it as well haha

Better version then Claude cowork tbh

This is a cool project! Can’t wait to play with it!

Will add to

Awesome thanks!

I’m naming mine Monika

Thats fun

nice!

why not sandbox it inside a docker container?

yeah this is a good idea - im thinking I should do this to be 100% confident in the sandboxing

this is so sick

@restwellson Thanks!


