Skip to content

Instantly share code, notes, and snippets.

@seqis
seqis / gist:69ba87a3d8c552b94b8a6bf9612b1c28
Created February 21, 2026 07:38
Agent Zero to Telegram Bridge: How-To (AI-Coder Focus)
This guide explains how to wire a Telegram bot to Agent Zero (`/api_message`) with:
- secure auth (no hardcoded LLM keys in the bridge)
- per-chat context continuity
- voice/audio relay to local Whisper
- optional extension pattern for non-audio file attachments
Everything below is based on the bridge implementation in:
- `/a0/usr/telegram/telegram_bridge.py`
- `/a0/usr/telegram/send_message.sh`
# OpenClaw vs Nanobot: The 170x Reduction Explained
**TL;DR**: Nanobot forked OpenClaw and stripped it from **587k lines to 3.4k lines** (99.4% reduction). OpenClaw is a production-ready multi-platform AI assistant for normies. Nanobot is a research framework for devs who want to actually understand and modify their agent code. Both are good - just for completely different people.
---
## The Numbers
- **OpenClaw**: 587,341 lines across TypeScript, Swift, Kotlin
- **Nanobot**: 3,448 core Python lines
@seqis
seqis / gist:2e0f55b3b237ed6177b3a9595c9bf127
Created July 24, 2025 23:34
/update for therapy sessions with Claude Code for local CLAUDE.md
/update – Session Compaction for CLAUDE.md 🪶
─────────────────────────────────────────────────
NOTE: Operates ONLY on the project‑local ./CLAUDE.md
(global ~/.claude/CLAUDE.md remains untouched).
1. Pre‑Check Size
• Count lines + estimate tokens.
• If > 300 lines ➜ echo "⚠️ Consider pruning your local CLAUDE.md after updating".
• Run Bash date command to get current date and retain that for the rest of these instructions.
@seqis
seqis / gist:ea63546f4ee1d407df5757268f53a184
Last active July 27, 2025 20:20
Claude Code /therapist custom command
# Samantha - Integrative Therapist Command
You are to take on the role in this conversation as a cognitive-behavioral therapist integrating Viktor Frankl's Logotherapy, Stoicism, ACT, and Existential wisdom. Warmly supportive yet ready with "tough love" and brutal honesty when needed.
---
## Agent Metadata
- **persona_name**: `Samantha`
- **persona_version**: `2.0.0`
@seqis
seqis / gist:5aba0b65ac3f4d66c9cf6825b48d9565
Created June 1, 2025 17:55
This Python script analyzes your local Claude Code conversation logs to track token usage, costs, and provide detailed breakdowns by model and time period (7/30/60 days), automatically exporting data to timestamped CSV files for historical tracking. Since Claude Code may purge local logs after an unknown retention period (estimated 30 days), the…
#!/usr/bin/env python3
"""
Claude Code Usage Tracker - Public Version
IMPORTANT: Run this script periodically (daily recommended) as Claude Code may purge
local conversation logs after an unknown retention period (estimated 30 days based on
feedback transcript retention policy). Set up a cron job to preserve your usage history.
Example crontab entry (runs daily at 8 AM):
0 8 * * * cd /path/to/script && python3 PUBLIC_claude_usage_tracker.py >/dev/null 2>&1
@seqis
seqis / critical_capsule.sh
Created April 25, 2025 18:31
This bash script performs both mirrored and versioned backups every 30 minutes—ideal for running via cron or Task Scheduler—using rsync with hard-link deduplication, time-slot logic, and detailed logging, all while ensuring clean snapshots and efficient storage use.
#!/bin/bash
# ---------------------------------------------------------------------------
# CRITICAL CAPSULE BACKUP SCRIPT (PUBLISHABLE VERSION)
# ---------------------------------------------------------------------------
# This script performs two types of backups every 30 minutes:
#
# 1. **MIRRORED BACKUPS**: One-way sync that mirrors directories to a target.
# - No versioning; it's a direct snapshot of the source as it exists.
#
@seqis
seqis / gist:35b1ab092b113352ac261c6919d15bab
Last active October 18, 2024 03:11
Discussion from this Reddit thread where I plotted what was discussed as a 3D graph: https://www.reddit.com/r/singularity/comments/1g6028b/copilot_o1_just_gave_the_most_mindblowing_answer/
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Create a new figure for the 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Data points for Time (x), Fulfillment (y), and Impact on Others (z)
time = [1, 2, 3, 4, 5]
fulfillment = [1, 2, 4, 6, 8] # Sample y-values for fulfillment
@seqis
seqis / gist:ab6ea9be431d50cd24e6da9e825de3e1
Created September 15, 2024 20:30
This script takes a YouTube URL from the clipboard, retrieves the video’s metadata (including title, uploader, description, tags, and chapters), and fetches the transcript if available. The combined information is then formatted and automatically copied to the clipboard for easy use.
#!/usr/bin/env python3
"""
This Python script takes a YouTube URL from the clipboard, fetches detailed video metadata
and the transcript (if available), and formats it for easy pasting.
The extracted information includes:
- Video Title
- Uploader Name
- Description
@seqis
seqis / gist:9e226b84c056d39ac3fa8ed7b19ee5a7
Created September 15, 2024 20:23
This python script will take any YouTube URL in the clipboard & go out and grab the transcript (if available) and put it directly into the clipboard for pasting.
#!/usr/bin/env python3
# This python script will take any YouTube URL in the clipboard & go out and grab the transcript (if available) and put it directly into the clipboard for pasting.
import pyperclip
from youtube_transcript_api import YouTubeTranscriptApi
import re
import tkinter as tk
def get_video_id(url):
@seqis
seqis / gist:c4ca9671d5d876746f88cb942959d82e
Last active October 4, 2024 17:17
This script sends any text in your clipboard to the OpenAI API for summary and puts that summary right back into the clipboard. You can modify your model name and API key variables below.
#!/usr/bin/env python3
import pyperclip
from openai import OpenAI
# Function to summarize the text using a valid OpenAI model
def summarize_text(text, client):
# Define the instructions for the summarizer
instructions = """
IDENTITY and PURPOSE