Project Wiki
Technical documentation for every system running inside Hannibal AI. Use the sidebar to navigate or click any card below.
Mac Relay
File-based command bridge โ Claude runs commands on your Mac autonomously
Trading Dashboard
Unified view of all bot performance, trades, and live P&L
Trading Platform
Three bots: BlackTide, Kraken Scalper, Kalshi โ all in paper mode
MSP Prospect Bot
Automated lead discovery for Think Connected using Perplexity + ntfy
Bug Bounty Bot
Automated vulnerability research and reporting
Hannibal Workspace
Persistent AI workspace for ongoing research and task tracking
Live System Status
All Processes
Everything running under PM2 on the Mac Mini.
| ID | Name | Status | Purpose |
|---|---|---|---|
| 10 | mac-relay | online | Claude โ Mac command bridge |
| 7 | dashboard | online | Trading performance UI |
| 8 | fantasy | online | Fantasy sports automation |
| 5 | hannibal-workspace | online | Persistent AI workspace |
| 6 | it-leads-bot | online | MSP prospect discovery |
| 2 | kalshi-bot | paper | Prediction market trading |
| 1 | kraken-scalper | paper | Short-term crypto scalping |
| 0 | kraken-swing-bot | paper | Swing trading crypto |
| 4 | bug-bounty-bot | online | Vulnerability research |
| 3 | trading-dashboard | online | Legacy dashboard |
Common PM2 Commands
pm2 list # check everything
pm2 restart <name> # restart a process
pm2 logs <name> --lines 50 # view logs
pm2 save # persist after reboot
mac-relay through the relay itself โ it will kill itself before writing the result. Use Terminal directly.Mac Relay โ online
File-based command bridge between Claude's sandbox and your Mac Mini. Built 2026-05-14.
Why it exists
Claude runs in a locked-down Linux sandbox with no direct access to your Mac. The relay bridges this gap using a shared folder as a mailbox โ Claude writes a command, the relay daemon picks it up, runs it in a full login shell, and writes the result back.
This replaced Terminus (SSH) which broke whenever the Mac screen was locked.
Key design choices
- zsh login shell โ sources ~/.zprofile so pm2, brew, python3, nvm are all on PATH
- Atomic writes โ writes result.tmp then renames, preventing partial reads
- ID-based dedup โ random 8-char hex ID per command; relay tracks last_id to prevent re-execution
- Split locations โ relay.py in mac-relay/, cmd.json/result.json in trading-platform/relay/ (mounted to Cowork)
Usage from Claude
from run_on_mac import run_on_mac, mac
result = run_on_mac("pm2 list")
print(result["stdout"])
output = mac("pm2 restart dashboard") # convenience wrapper
result = run_on_mac("python3 backtest.py", timeout=300)
Restart (from Terminal only)
cd ~/Documents/Claude/Projects/Computer\ Optimization/mac-relay
pm2 restart mac-relay
nohup bash -c 'sleep 3 && pm2 restart mac-relay' &Last updated: 2026-05-14
Trading Dashboard โ online
Unified performance view for all trading bots. FastAPI backend + vanilla JS frontend. PM2 ID 7.
What it shows
- Combined P&L for swing bot and scalper (merged trade history)
- Kalshi prediction market activity
- Bot running status โ checks log file freshness (modified within 5 min)
- Paper mode indicator
Data sources
| Bot | Log path |
|---|---|
| Swing bot | ~/kraken-swing-bot/logs/trades.json |
| Scalper | ~/kraken-swing-bot/logs/scalper/trades.json |
| Kalshi | API / kalshi-bot positions |
Fix applied 2026-05-14
The scalper wrote to logs/scalper/trades.json but the dashboard only read logs/trades.json โ scalper data was invisible. Fixed by adding a separate SCALPER_TRADES path and merging in the chart builder. "Active bots" counter also fixed to use log file mtime instead of live/paper flag.
pm2 restart dashboard
Trading Platform โ paper mode
Unified framework hosting three bots across Kraken and Kalshi. Switched to paper mode 2026-05-13.
PAPER_TRADE = True. Full strategy logic runs โ signals, position tracking, trade logging โ but no real orders are placed. Safe to run 24/7 for performance monitoring.| Bot | Market | Strategy | PM2 ID |
|---|---|---|---|
| BlackTide | Kraken (crypto) | ML ensemble swing trading โ XGBoost + MLP, AUC 0.80/0.82 | 0 |
| Kraken Scalper | Kraken (crypto) | RSI, Stochastic RSI, EMA crossovers, 5-min candles | 1 |
| Kalshi Bot | Kalshi (prediction markets) | Kelly Criterion sizing on yes/no event contracts | 2 |
Going live again
Set PAPER_TRADE = False in each bot's config and restart via PM2. Recommended: run paper for 30+ days, review dashboard performance first.
BlackTide (Kraken Swing) โ paper
ML-driven swing trading on Kraken crypto markets. PM2 ID 0.
XGBoost + MLP ensemble model trained on years of crypto data. Trades BTC, ETH, SOL and more. AUC: 0.80 long / 0.82 short. Holds positions multi-day. Writes trades to ~/kraken-swing-bot/logs/trades.json.
| File | Purpose |
|---|---|
bot.py | Main loop โ signal generation, order execution, position tracking |
risk_manager.py | Stop-loss / take-profit / trailing stop logic |
config.py | Strategy parameters, PAPER_TRADE flag |
logs/trades.json | Trade history (read by dashboard) |
Kraken Scalper โ paper
Short-term scalping on Kraken. PM2 ID 1.
High-frequency scalping using RSI, Stochastic RSI, EMA crossovers, and volume spikes on 5-minute candles. Writes trades to ~/kraken-swing-bot/logs/scalper/trades.json.
logs/scalper/trades.json, NOT logs/trades.json. Dashboard was patched 2026-05-14 to read both paths and merge them.pm2 restart kraken-scalper
Kalshi Bot โ paper
Prediction market trading on Kalshi. PM2 ID 2.
Trades binary event contracts (will X happen?) using Kelly Criterion for mathematically optimal bet sizing when edge exists.
| File | Purpose |
|---|---|
bot.py | Main loop, market scanning, order placement |
.env | API keys, NTFY_TOPIC, PERPLEXITY_API_KEY |
logs/trades.json | Trade history |
pm2 restart kalshi-bot
MSP Prospect Bot โ online
Automated lead discovery for Think Connected (thinkconnected.com). PM2 ID 6.
Searches for small businesses that could benefit from managed IT services. Sends push notifications via ntfy.sh when new prospects are found.
Search sources
- Yelp โ local business search, no Google dependency
- Perplexity AI (sonar model) โ 10 targeted industry queries
Notifications
| Setting | Value |
|---|---|
| Service | ntfy.sh |
| Topic | hannibal-bb-maxmoore |
| App | ntfy iOS/Android โ subscribe to topic |
Bugs fixed 2026-05-14
NameError: config is not definedโ config was missing inside run_once(). Bot crashed silently on every run.- Missing NTFY_TOPIC in .env โ notifications were never sent.
- Google rate-limiting โ replaced all Google-dependent searches with Perplexity.
pm2 restart it-leads-bot
Last updated: 2026-05-14
Bug Bounty Bot โ online
Automated vulnerability research and bug bounty hunting. PM2 ID 4.
Runs automated security research tasks on a schedule. Identifies potential vulnerabilities in target scopes and formats findings for submission to bug bounty programs.
pm2 restart bug-bounty-bot
pm2 logs bug-bounty-bot --lines 100
Hannibal Workspace โ online
Persistent AI-powered workspace for research, task tracking, and ongoing projects. PM2 ID 5.
Flask backend (port 5050) serving the internal ops dashboard. Shows bug bounty findings, MSP leads, and bot status. High restart count (4,577+) indicates heavy active use.
Location
~/Documents/Claude/Projects/Computer Optimization/hannibal-workspace/
Endpoints
GET / โ serves index.html
GET /api/bb โ bug bounty findings
GET /api/leads โ MSP prospects
GET /api/logs โ bot logs
Push Notifications
Real-time alerts from bots to your phone via ntfy.sh.
| Setting | Value |
|---|---|
| Service | ntfy.sh |
| Topic | hannibal-bb-maxmoore |
| Server | https://ntfy.sh |
Setup
- Install the ntfy app on iOS or Android
- Subscribe to topic:
hannibal-bb-maxmoore - Notifications arrive when bots find leads or hit alert conditions
Bots that send notifications
| Bot | Triggers when... |
|---|---|
| MSP Prospect Bot | New business prospects found |
| Kalshi Bot | Trade executed, threshold hit |
Secrets & API Keys
Where keys live and how they're loaded. Never commit these to git.
chmod 600 .env to restrict file permissions. Never push API keys to any repository.| Key | Location | Used by |
|---|---|---|
| Kraken API key/secret | kraken-swing-bot/.env | Swing bot, scalper |
| Kalshi API key | kalshi-bot/.env | Kalshi bot |
| Perplexity API key | trading-platform/bots/it-leads-bot/.env | MSP prospect bot |
| NTFY topic | trading-platform/bots/it-leads-bot/.env | MSP prospect bot |
Loading pattern
from dotenv import load_dotenv
import os
load_dotenv()
NTFY_TOPIC = os.getenv("NTFY_TOPIC")
PERPLEXITY_API_KEY = os.getenv("PERPLEXITY_API_KEY")
Last updated: 2026-05-14