Skip to content

pj4533/NetHackPlayer

Repository files navigation

NetHackPlayer

Platform: macOS Swift Python License: MIT

A macOS app that watches Claude play NetHack autonomously using the Claude Agent SDK.

NetHackPlayer demo

Quick Start

# Install dependencies
brew install tmux nethack

# Set up Python environment
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

# Authenticate Claude Code
claude login

Open NetHackPlayer.xcodeproj in Xcode and run (Cmd+R).

How It Works

NetHackPlayer spawns a Claude Code session via the Agent SDK that plays NetHack through tmux. The app displays the live game via SwiftTerm and shows Claude's reasoning and actions in a chat panel below.

+------------------------------------------+
|  NetHackPlayer.app                       |
|  +------------------------------------+  |
|  |  Terminal View (SwiftTerm)         |  |
|  |  tmux attach -t nethack -r        |  |
|  +------------------------------------+  |
|  +------------------------------------+  |
|  |  Chat View                         |  |
|  |  Claude's reasoning + actions      |  |
|  +------------------------------------+  |
+------------------+-----------------------+
                   | JSON lines (stdin/stdout)
        +----------+-----------+
        |  Python Bridge       |
        |  (ClaudeSDKClient)   |
        +----------+-----------+
                   |
        +----------+-----------+
        |  Claude Code CLI     |
        |  Bash: tmux commands |
        +-----------+----------+
                    |
              +-----+-----+
              |   tmux    |
              | "nethack" |
              +-----------+

Features

  • Autonomous play — Claude explores, fights, loots, and descends through the dungeon
  • Live terminal — Watch the game in real-time via embedded SwiftTerm
  • Chat interface — See Claude's reasoning and send messages to guide play
  • Skill system — Loads strategy knowledge from ~/.claude/skills/nethack/

Requirements

  • macOS 15.0+, Xcode 26+
  • Homebrew with tmux and nethack
  • Python 3.10+ with Claude Agent SDK
  • Claude Code authentication (claude login)

About

A macOS app that watches Claude play NetHack autonomously using the Agent SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors