Skip to content

Instantly share code, notes, and snippets.

@grahama1970
grahama1970 / REVIEW_BUNDLE_PROMPT.md
Created September 26, 2025 21:49
Extractor External Review — 2025-09-26

External Review Prompt (Extractor — Canonical v1)

Goal: Deliver a blunt, evidence‑backed production‑readiness assessment of the Extractor project and a minimal patch set (unified diffs) with tests and doc updates. Keep changes surgical. Ship safety first.

Reviewer persona & tone

  • Principal SRE/DevEx + AppSec; fluent with Python/uv, Typer/FastAPI, Vite/React, ArangoDB, CI.
  • Be terse, specific, and fail‑closed. Unverified claims must be marked 🔴 (blocking) or 🟡 (needs proof). No hand‑waving.

Project context (declare at top of your report)

  • Project: Extractor — Self‑Correcting Agentic Document Processing System (multi‑stage pipeline + tabbed UX)
@grahama1970
grahama1970 / config.toml
Created September 9, 2025 13:05
codex config.toml
# ======================================
# CORE
# ======================================
model = "gpt-5"
model_reasoning_effort = "high"
# Disable all sandboxing (no filesystem/network restrictions)
sandbox_mode = "danger-full-access"
# Never prompt for approvals (Codex will run commands directly)
@grahama1970
grahama1970 / AGENTS.md
Last active September 6, 2025 17:15
Instructions for Codex and GPT-5

AGENTS.md

Repository Guidelines

Based on OpenAI Prompting Guide.

Agent Quickstart (Codex CLI)

  • Activation: Start with the prompt:
    Activate the current dir as project using serena
@grahama1970
grahama1970 / codex_call.py
Last active August 29, 2025 14:26
Codexer: Async wrapper for running `codex exec` with robust supervision: supports overall and idle timeouts, graceful shutdown (SIGTERM→SIGKILL), non-deadlocking streamed I/O, rolling capture limits, optional binary/text output, safe logging with redaction & controlled environment handling. Requires Python 3.10+, loguru.
# codex_exec.py
"""
Async wrapper for running `codex exec ...` with robust timeout, streaming, and termination.
Key features:
- Overall and idle timeouts (wall and silence).
- Graceful shutdown (SIGTERM) → hard kill (SIGKILL) with process-group awareness.
- Stream readers that cannot deadlock; cancellation-safe finalization.
- Rolling capture limits to avoid unbounded memory growth.
- Optional binary or decoded text outputs.
@grahama1970
grahama1970 / codexer.sh
Last active August 27, 2025 22:26
Codexer: shell helper for codex that pipes a startup checklist plus the last Codex conversation into codex. Supports --resume, --limit, --id, --index, and --list. Finds session JSONL under ~/.codex/sessions, orders by timestamp, prints User/Assistant lines.
# --- Place below in .zshrc ---------
# === Self-contained codexer with resume seed builder ===
# --- codexer: simple conversation loader for the Codex CLI --------------------
# Features:
# --resume Append the last conversation (user + assistant) to the seed
# --limit N Include only the last N lines of that conversation
# --id SESSION_ID Resume a specific session id (instead of the most recent)
@grahama1970
grahama1970 / 01_litellm_call.py
Last active August 18, 2025 20:41
Fast async Python CLI to batch run prompts via LiteLLM with robust image support. Supports local/remote images in prompts, pre-downloads and inlines them, cache-enabled with Redis fallback, and flexible prompt input (files, stdin, or inline). Uses Typer for CLI.
#!/usr/bin/env python3
"""
LiteLLM Call - Easy async LLM batch runner with automatic image support
WHAT IT DOES:
- Run multiple LLM prompts in parallel for speed
- Automatically detects and includes images from URLs or local files
- Works with any LiteLLM-supported model (OpenAI, Anthropic, Ollama, etc.)
- Handles all image processing automatically (compression, base64 encoding)
@grahama1970
grahama1970 / codebase_indexer.py
Created August 15, 2025 14:21
codebase indexer for an agent
#!/usr/bin/env python3
"""
Codebase Indexer for Semantic Code Search
A tool for indexing code repositories into ArangoDB with semantic embeddings,
enabling intelligent code search beyond simple text matching.
Key Features:
- Extracts functions/classes using tree-sitter AST parsing
- Generates semantic embeddings using nomic-embed-code model (1024-dim)
@grahama1970
grahama1970 / scratch.md
Created August 1, 2025 13:44
perplexity estimate

Here is the final clear and concise estimate with math for how many full-time developers a 16 Nvidia H200 GPU cluster can support running Grok’s Kimi-k2, based purely on token throughput:

Given:

  • Average tokens per developer per day: ~5,800,000 tokens
  • Seconds per day: 86,400 seconds
  • Per-GPU token throughput (prefill + decode combined) from Grok Kimi-k2 benchmarks: ~4,000 tokens/sec
  • Number of GPUs in cluster: 16

Step 1: Calculate tokens per second per developer

@grahama1970
grahama1970 / code-reviewer.md
Created July 29, 2025 15:43
coder-review.md subagent for claude code

name: code-reviewer description: Proactively triggered for comprehensive code reviews and security analysis. If they say 'review code', 'check security', 'code quality', or mention pull requests, use this agent. When you prompt this agent, provide the code location and review focus areas (security, performance, style). Remember, this agent has no context about your standards, so specify coding conventions and acceptable risk levels. tools: python type: reviewer capabilities:

  • code_review_bundle
  • git_context_integration
  • security_analysis
  • performance_review
@grahama1970
grahama1970 / README.md
Last active July 26, 2025 17:06
Claude Tmux Dispatcher (proof of concept): The Claude Dashboard project is a real-time monitoring tool for managing Claude AI code instances via tmux slots and hook events. Built with React, Tailwind CSS, Shadcn/UI, and FastAPI, it provides live views of tmux outputs, event filtering, chat transcripts, and system health. It integrates tightly wi…

Claude Dashboard

A real-time monitoring dashboard for Claude code instances managed by claude_dispatcher.py, built with React, Tailwind CSS, Shadcn/UI, and FastAPI. It provides live observability of tmux slots, Claude hook events, and system health, inspired by the disler/claude-code-hooks-multi-agent-observability repository. The dashboard runs locally, leveraging uv for dependency management and WebSockets for real-time updates.

Key Features

  • Real-Time Monitoring: Displays live tmux slot statuses, Claude hook events (e.g., PreToolUse, Notification), and system health (CPU, memory, Redis) via WebSockets.
  • Live Tmux Output Streaming: Streams tmux capture-pane output for each slot in real-time, viewable in a modal.
  • Advanced Event Filtering: Filters hook events by event type, session ID, source app, and content on the Event Timeline page.
  • Chat Transcript Modal: Views Claude conversation history for Notification events, with formatted prompt/response pairs.