Skip to content

Bread-Technologies/Pain-Hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pain Hunter

Automatically find Reddit comments that match your startup's pain point using Claude and multi-armed bandit optimization.

Pain Hunter crawls Reddit to discover people expressing frustrations that your product solves. It uses Claude to intelligently filter comments, a Softmax bandit to focus on the highest-yield subreddits over time, and generates suggested responses for each match — giving you a stream of warm leads without manual searching.

How It Works

  1. Discovery — Claude generates search terms from your pain point description and discovers hundreds of relevant subreddits via Reddit's API.
  2. Training — The system surfaces early matches for your review. You confirm or reject the first few, teaching Claude what a real match looks like for your specific use case.
  3. Production Hunting — Once calibrated, Pain Hunter runs autonomously: a Softmax bandit selects subreddits, Claude scores posts by potential, analyzes comment batches, and auto-saves matches with suggested responses.

Features

  • Claude Sonnet 4 for intelligent comment analysis and response generation
  • Softmax (Boltzmann) bandit with temperature annealing for subreddit selection
  • Hot/cold scoring — when no match is found, Claude rates subreddit potential so the bandit still learns
  • Post ranking — Claude pre-scores posts by relevance before fetching comments
  • Session resume — stop and restart without losing progress (state persisted to JSONL + JSON)
  • Duplicate prevention — tracks analyzed posts and individual comment IDs
  • 2x growth re-analysis — revisits posts whose comment count has doubled since last analysis
  • Rate limiting — exponential backoff with retries for Reddit's API

Setup

Prerequisites

Installation

git clone https://github.com/YOUR_USERNAME/pain_hunter.git
cd pain_hunter
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Configuration

  1. Set your API key — copy the example env file and add your key:
cp .env.example .env
# Edit .env and set your Anthropic API key
  1. Describe your pain point in pain_point.md. Be specific about the problem your product solves — this is what Claude uses to evaluate every comment. See pain_point.example.md for a template.

Run

source venv/bin/activate
python3 pain_hunter_v2.py

During the training phase, you'll be prompted to confirm or reject the first few matches. After 3 confirmed positives, the system switches to fully autonomous mode.

Project Structure

pain_hunter/
├── pain_hunter_v2.py          # Main implementation
├── pain_point.md              # Your pain point description (not tracked in git)
├── pain_point.example.md      # Example pain point for reference
├── .env                       # Your API key (not tracked in git)
├── .env.example               # Example env file
├── requirements.txt           # Python dependencies
├── .gitignore
└── outputs/                   # Generated per session (not tracked in git)
    └── session_YYYYMMDD_HHMMSS/
        ├── match_001_HHMMSS.txt       # Individual match files
        ├── analyzed_posts.jsonl       # Post/comment tracking
        ├── bandit_stats.json          # Subreddit reward history
        ├── training_examples.json     # Confirmed positive/negative examples
        └── discovered_subreddits.md   # Subreddit list for this session

How the Bandit Works

Pain Hunter uses a Softmax (Boltzmann) exploration strategy to balance trying new subreddits with exploiting known good ones.

Temperature annealing:

  • Starts with a high temperature (more random exploration across subreddits)
  • As successful matches accumulate, the temperature decreases (shifts toward exploiting top performers)
  • Minimum temperature of 0.1 prevents total convergence

Reward signals:

Outcome Reward Effect
Confirmed match +10.0 Strong signal to revisit this subreddit
Hot/cold score (no match) -0.5 to +0.5 Claude estimates subreddit potential (0-100)
No posts available 0 Neutral
No feedback -0.001 Slight negative to avoid stalling

This means the bandit learns even from misses — a subreddit with no matches but a hot/cold score of 80 still gets a positive signal.

CLI Options

The PainHunterV2 constructor accepts several parameters:

# Default: new session, 1000 pulls, 100 max matches, training enabled
hunter = PainHunterV2(api_key)

# Longer run with higher limits
hunter = PainHunterV2(api_key, max_pulls=5000, max_total_matches=500)

# Resume a previous session
hunter = PainHunterV2(api_key, resume_from_dir="outputs/session_20250829_152635")

# Skip the interactive training phase
hunter = PainHunterV2(api_key, skip_training=True)

API Usage

Reddit: Uses Reddit's public JSON API (old.reddit.com/*.json) — no authentication required. Rate limited at ~100 requests/minute with built-in exponential backoff.

Anthropic: Claude is called for:

  • Search term generation (1 call)
  • Post ranking per subreddit (1 call per subreddit fetch)
  • Comment batch analysis (1 call per batch of up to 200 comments)
  • Response generation (1 call per match)

Important Notes

  • No automated posting — generates suggested responses for human review only
  • Respectful rate limiting — exponential backoff built into all Reddit API calls
  • Follow Reddit's ToS — this tool is for research and lead discovery, not spam
  • Privacy — your pain point description and API key stay local; only Reddit public data is read

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages