Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar

Nader Dabit dabit3

View GitHub Profile
@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 14, 2026 21:22
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 January 20, 2026 20:57
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.
@dabit3
dabit3 / demoday.md
Last active December 7, 2025 17:03
How to Give a Killer Pitch or Hackathon Demo
@dabit3
dabit3 / page.tsx
Created April 4, 2024 14:08
Next.js + Capsule example
'use client'
import Capsule, {
Environment,
CapsuleModal,
} from '@usecapsule/react-sdk';
import { useState, useEffect } from 'react'
const capsule = new Capsule(
Environment.BETA,
@dabit3
dabit3 / page.tsx
Created December 1, 2023 22:28
Fal + Next.js Real Time with Websockets
'use client'
import { useState } from 'react'
import { Input } from '@/components/ui/input'
import * as fal from "@fal-ai/serverless-client";
import { Excalidraw, exportToBlob } from "@excalidraw/excalidraw";
import Image from 'next/image'
fal.config({
proxyUrl: "/api/fal/proxy",
})