{
  "markdown": "# Dopamine 🧠⚡\n\n**Watch Shorts while Claude works. Read articles while Claude codes.**\n\nA Claude Code hook that opens entertainment or educational content while AI handles your tasks — and closes it when the work is done.\n\n## Two Modes\n\n### 📉 Degrade Mode\nOpens YouTube Shorts or Instagram Reels in a compact window next to your terminal. Auto-closes when Claude finishes. Pure dopamine, zero guilt — the AI is doing the work anyway.\n\n### 📈 Progress Mode\nOpens a relevant article based on what Claude is currently working on. Building a React component? Here's a React best practices article. Writing Python? Here's a Python tutorial. The window stays open so you can keep reading.\n\n## How It Works\n\n```\nYou ask Claude to do something\n  → Claude starts using tools\n    → Dopamine opens a browser window next to your terminal\n      → You watch/read while Claude works\n        → Claude finishes\n          → Degrade: window closes automatically\n          → Progress: window stays open for reading\n```\n\n## Install\n\n### As a Claude Code Plugin (recommended)\n\n```bash\n# 1. Add the marketplace\n/plugin marketplace add Teese999/Dopamine\n\n# 2. Install the plugin\n/plugin install dopamine\n```\n\n### Manual Install\n\n```bash\n# 1. Copy the hook script\nmkdir -p ~/.claude/hooks\ncp entertainment.py ~/.claude/hooks/entertainment.py\n\n# 2. Add hooks to ~/.claude/settings.json\n# (merge with your existing settings)\n```\n\nAdd to your `~/.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 ~/.claude/hooks/entertainment.py\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 ~/.claude/hooks/entertainment.py\"\n          }\n        ]\n      }\n    ],\n    \"SessionEnd\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python3 ~/.claude/hooks/entertainment.py\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n```bash\n# 3. (Optional) Log in to YouTube / Instagram\npython3 ~/.claude/hooks/entertainment.py login\n```\n\n## Usage\n\n### Slash Commands (plugin install)\n\n```\n/dopamine degrade     # 📉 Shorts/Reels\n/dopamine progress    # 📈 Useful articles\n/dopamine shorts      # Set source: YouTube Shorts\n/dopamine reels       # Set source: Instagram Reels\n/dopamine login       # Log in to YouTube & Instagram\n/dopamine             # Show current settings\n```\n\n### CLI (manual install)\n\n```bash\npython3 ~/.claude/hooks/entertainment.py mode degrade\npython3 ~/.claude/hooks/entertainment.py mode progress\npython3 ~/.claude/hooks/entertainment.py setup shorts\npython3 ~/.claude/hooks/entertainment.py setup reels\npython3 ~/.claude/hooks/entertainment.py login\n```\n\n## Features\n\n- **Cross-platform** — macOS, Windows, Linux\n- **Smart window placement** — opens next to your terminal, sized for vertical video (degrade) or comfortable reading (progress)\n- **Topic detection** — in progress mode, extracts tech keywords from Claude's current task (file paths, frameworks, languages) and finds a relevant article\n- **One window per session** — doesn't spam browser windows on every tool call\n- **Auto-cleanup** — degrade mode closes the window when Claude stops; progress mode keeps it open\n\n## Browser Support\n\n| OS | Browsers |\n|----|----------|\n| macOS | Chrome, Safari, Firefox, Arc |\n| Windows | Chrome, Edge, Firefox |\n| Linux | Chrome, Chromium, Firefox |\n\nWindow positioning and auto-close work best on macOS (via AppleScript). On Windows/Linux it's best-effort.\n\n## Requirements\n\n- Python 3.6+\n- [Claude Code](https://claude.ai/code)\n- A browser\n- Questionable life choices (degrade mode) or self-improvement ambitions (progress mode)\n\n## How Topic Detection Works (Progress Mode)\n\nDopamine reads the tool input that Claude is currently processing and extracts:\n\n- **File extensions** → `.tsx` = React + TypeScript, `.py` = Python, etc.\n- **Framework keywords** → React, Vue, Django, Express, Prisma, etc.\n- **Path segments** → meaningful directory/file names\n\nThen opens the top DuckDuckGo result for `\"{topic} best practices tutorial\"`.\n\n## Support the Project\n\nIf Dopamine made your coding sessions more fun (or more productive), consider buying me a coffee:\n\n| BTC | ETH (ERC-20) | USDT (TRC-20) |\n|:---:|:---:|:---:|\n| <img src=\"assets/qr_btc.png\" width=\"150\"> | <img src=\"assets/qr_eth.png\" width=\"150\"> | <img src=\"assets/qr_usdt_trc20.png\" width=\"150\"> |\n| `15FgAxLWXSQimGUVyH2eGzDpLzZHHmLhWG` | `0xa6ba31dd11cd5943c5ca4a7d7aaf433a0892d7e6` | `THJfpf9MmsNqjr8AWvp5gu88gSS6SawrZU` |\n\n## License\n\nMIT\n",
  "bytes": 4647,
  "sha": "62e5d0612bd30881630032babadab7920696dbdea4a6bd91c3b5fadd25deefea",
  "repo_slug": "teese999/dopamine",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_teese999_dopamine_dopamine_dee4ff87/readme"
}