Skip to content

Instantly share code, notes, and snippets.

protoclaw — WhatsApp AI agent spec

Self-hosted WhatsApp AI agent that runs on a Linux box, polls for unread messages on a schedule, thinks with the Claude Code CLI, and replies (or stays silent). Personality, identity, and memory are loaded from markdown files at runtime; the agent can edit those files to persist learnings across runs.

This document is a reproduction spec: enough detail for a fresh Claude Code session to rebuild the project from scratch.


1. What it is

WhatsApp Composing Debounce Patch for OpenClaw

Version tested: OpenClaw 2026.3.1, Baileys 7.0.0-rc.9

Problem

OpenClaw's inbound debounce (default 6s) can't tell if the sender is still typing. Send "Hello", start writing a long follow-up → the bot responds to "Hello" alone before you finish.

Fix

@maraoz
maraoz / gist:388eddec39d60c6d52d4
Created February 20, 2016 22:03
Imagenet output tensor index to label mapping
{
0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
@maraoz
maraoz / deploy.ts
Created July 11, 2022 20:14
Using WalletConnect from a hardhat script example
import { ethers } from "hardhat";
import { Signer } from "ethers";
import WalletConnectProvider from "@walletconnect/web3-provider";
async function deploy(deployer: Signer) {
const address = await deployer.getAddress();
console.log("Deploying contracts with the account:", address);
console.log("Account balance:", (await deployer.getBalance()).toString());
@maraoz
maraoz / gist:7dbbd94070c689286da3
Created June 16, 2014 15:16
brain wallets in bitcore
var bitcore = require('bitcore');
var password = 'an example of an insecure password';
var privateKey = bitcore.util.sha256(password);
var key = new bitcore.Key();
key.private = privateKey;
key.regenerateSync();
var addr = new bitcore.Address.fromKey(key);
@maraoz
maraoz / links.txt
Last active June 20, 2018 12:57
some smart contracts links
0xb0145Ae156D201d6E371d07265FE3C045071c967
@maraoz
maraoz / Original version
Last active October 5, 2016 13:25
Hashed Timelock Contract (HTLC) as proposed in lightning.network paper
OP_DEPTH 3 OP_EQUAL
OP_IF
OP_HASH160 <hash160(R)> OP_EQUALVERIFY
OP_0 2 <AlicePubkey1> <BobPubkey1> 2 OP_CHECKMULTISIG
OP_ELSE
OP_0 2 <AlicePubkey2> <BobPubkey2> 2 OP_CHECKMULTISIG
OP_END
// Proof of Existence contract, version 1
contract ProofOfExistence {
// state
bytes32 proof;
// constructor
function ProofOfExistence() {
}
geth --testnet --rpc console 2>> geth.log