Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar

Nader Dabit dabit3

View GitHub Profile
@dabit3
dabit3 / you_couldve_invented_openclaw.md
Last active February 12, 2026 06:34
You Could've Invented OpenClaw

What makes OpenClaw powerful is surprisingly simple: it's a gateway that connects an AI agent to your messaging apps, gives it tools to interact with your computer, and lets it remember who you are across conversations.

The complexity comes from handling multiple channels simultaneously, managing persistent sessions, coordinating multiple agents, and making the whole thing reliable enough to run 24/7 on your machine.

In this post, I'll start from scratch and build up to OpenClaw's architecture step by step, showing how you could have invented it yourself from first principles, using nothing but a messaging API, an LLM, and the desire to make AI actually useful outside the chat window.

End goal: understand how persistent AI assistants work, so you can build your own.

First, let's establish the problem

@dabit3
dabit3 / mini-openclaw.py
Created February 11, 2026 00:44
Mini Openclaw in 400 lines
#!/usr/bin/env python3
# mini-openclaw.py - A minimal OpenClaw clone
# Run: uv run --with anthropic --with schedule python mini-openclaw.py
import anthropic
import subprocess
import json
import os
import re
import threading
@dabit3
dabit3 / setup.md
Last active February 11, 2026 14:55
How to set up OpenClaw on Digital Ocean

OpenClaw on DigitalOcean

1. Create a Droplet

Ubuntu 24.04 LTS, nearest region

2. Select Premium AMD

2 GB RAM / 1 AMD CPU / 50 GB NVMe

3. SSH into server

@dabit3
dabit3 / programmatic-tool-calling.ts
Created January 13, 2026 16:19
Full example of programmatic tool calling
import Anthropic from "@anthropic-ai/sdk";
import { Pool } from "pg";
const anthropic = new Anthropic();
// dn connection - Claude never sees this
const db = new Pool({
host: "your-database-host.com",
port: 5432,
database: "sales_db",
@dabit3
dabit3 / invented-claude-code.md
Last active January 31, 2026 08:38
You Could've Invented Claude Code

You Could've Invented Claude Code

This is cross-posted from the original x post.

What makes Claude Code powerful is surprisingly simple: it's a loop that lets an AI read files, run commands, and iterate until a task is done.

The complexity comes from handling edge cases, building a good UX, and integrating with real development workflows.

In this post, I'll start from scratch and build up to Claude Code's architecture step by step, showing how you could have invented it yourself from first principles, using nothing but a terminal, an LLM API, and the desire to make AI actually useful.

@dabit3
dabit3 / claude-agent-tutorial.md
Last active February 8, 2026 13:33
The Complete Guide to Building Agents with the Anthropic Agent SDK

Building AI agents with the Claude Agent SDK

If you've used Claude Code, you've seen what an AI agent can actually do—read files, run commands, edit code, figure out the steps to accomplish a task.

And you know it doesn't just help you write code, it takes ownership of problems and works through them the way a thoughtful engineer would.

The Claude Agent SDK is the same engine, yours to point at whatever problem you want, so you can easily build agents of your own.

The Claude Agent SDK is how you build that same thing into your own applications.

@dabit3
dabit3 / ai-prompt.md
Last active April 13, 2025 23:17
Verifiable AI Inference AVS prompt using OpenAI Using WAVS - https://docs.wavs.xyz/overview

Create an OpenAI inference component based on the ETH Price Oracle (components/eth-price-oracle). The component should:

  1. Accept input in the format 'PROMPT|OPENAI_API_KEY|SEED' from a Makefile parameter
  2. Use fetch_json and http_request_post_json for API communication
  3. Return and log only choices[0].message.content and choices[0].finish_reason
  4. Include proper input validation and SEED should be an integer
  5. Use the main makefile, do not create a separate one.

Important Implementation Details:

@dabit3
dabit3 / wavs-prompting.md
Last active May 27, 2025 12:37
Prompting a WAVS price oracle AVS for a sports score oracle AVS - https://docs.wavs.xyz/overview

I want to create a similar oracle to the ETH Price Oracle at components/eth-price-oracle, but I want it to use the SportRadar API.

I want to set and reference the SportRadar API key from the Makefile, I do not want to use an .env file..

The request parameters for calling the SportRadar API look like this:

curl --request GET \
     --url 'https://api.sportradar.com/ncaamb/trial/v8/en/games/fa15684d-0966-46e7-a3f8-f1d378692109/boxscore.json?api_key={insert-api-key} \
     --header 'accept: application/json'
@dabit3
dabit3 / eigen-mcp.ts
Created March 19, 2025 22:20
EigenLayer MCP Server Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import 'dotenv/config'
const server = new McpServer({
name: "EigenLayer AVS service",
version: "1.0.0",
});
@dabit3
dabit3 / generateTemplate.ts
Last active December 27, 2024 13:45
Generate a random template
const baseInstructions = `
You do not like NFTs, so don't talk about them. Never use the word Buidl.
You are a hyper-optimist while also being a skeptic.
Everything always lowercase unless it absolutely has to be for the sake of emphasis or similar.
Never use emojis.