Skip to main content

Desktop snake game that plays on a transparent overlay while opencode is processing

Project description

opensnake 🐍

The agent is thinking. You're doomscrolling. There's a better way.

GitHub Tag Lint Test PyPI - Version License: MIT Renovate

Demo

Agentic coding is magical. You describe what you want and the model explores, reasons, and returns with a solution that makes you wonder why you even have a keyboard.

Then the status bar says Thinking... and time grinds to a halt.

Suddenly you're three pages deep into a subreddit you don't care about. Twitter, again. An issue thread from 2019 about a bug in a framework you've never used. Anything to fill the forty seconds of silence while tokens appear one... by... one.

opensnake replaces that sad ritual with snake. Classic, shameless, deeply satisfying snake. It floats as a transparent overlay right over your editor — no alt-tab, no context switch, just arrow keys and a reptile with an eating disorder.

When the model starts thinking, the game opens. When it finishes, the game vanishes. You score points by eating the OPENCODE block letters scattered across the screen. Yes, you are literally consuming the name of the very thing you're waiting on. Cathartic or ironic? Your call.

opensnake is an independent project, not affiliated with or endorsed by the opencode team. We just like the tool and hate waiting.


Gameplay

You are A snake
You eat Big blocky OPENCODE letters
Worth 100 points and +3 length each
Letters spawn 10 at start, then 1 every 3 seconds (up to 100)
Controls Arrow keys to move, ESC to quit (or just lose, that works too)
Window Transparent overlay. Your coworkers will never know.

Installation

pip install opensnake
# or for the cool kids
uv tool install opensnake
# or from source if you enjoy build scripts
git clone https://github.com/hugobatista/opensnake
cd opensnake
uv sync

Then hook it in (one command, we promise):

opensnake install

Restart opencode. That's it. The daemon auto-starts — you never have to think about it. Which is fitting. The whole point is to think less.


Usage

opensnake once             # Quick game, no daemon. Just admit you want to play.
opensnake daemon           # Manual start (the plugin handles this normally)
opensnake status           # Everything nominal? Probably.
opensnake install          # Wire it into opencode
opensnake uninstall        # Why would you though
opensnake config           # Peek at or regenerate your config

Fancy mode

opensnake once --opacity 0.95 --tick-ms 50 --letter-count 200
# translation: "I want to die faster and in darker mode"

Configuration

~/.config/opensnake/config.json — your joy, your parameters:

{
  "opacity": 0.8,
  "tick_ms": 80,
  "cell_size": 32,
  "letter_count": 100,
  "initial_letters": 10,
  "spawn_interval_ms": 3000,
  "gray_map": {
    "O": [180, 220],
    "P": [160, 200],
    "E": [200, 240],
    "N": [140, 180],
    "C": [210, 250],
    "D": [170, 210]
  }
}
Field Default What it controls
opacity 0.8 Window transparency. 1.0 = "I forgot I'm at work."
tick_ms 80 Snake speed. Lower = faster = hubris.
cell_size 32 Grid cell size in pixels. Bigger = easier = boring.
letter_count 100 Max letters on screen. The GPU can handle it. Can you?
initial_letters 10 Letters at start. The calm.
spawn_interval_ms 3000 New letter every N ms. The storm.
gray_map per letter Fill/border colors. For people who care about aesthetics.

Under the hood

The plugin watches for the model state. When Thinking fires, it pings the daemon over a Unix socket. The daemon spawns a borderless Pygame window — XShape on Linux, NSWindow tricks on macOS — so the game floats transparently over everything. The snake moves on a grid, eats letters, grows. The game runs until ESC, death, or the agent finishes thinking. A 60-second watchdog keeps orphan windows from haunting your desktop.

Is this a productivity tool? It's literally a game that pops up when you're supposed to be working and disappears when it's time to pay attention again.

Well yes, it is.


Before opensnake: "I should really learn Rust while the model thinks." (opens Twitter)

After opensnake: "The snake is 47 segments long and I still haven't found the letter D."


Built (ironically) with opencode — because what better way to test a tool than making a game about waiting for it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opensnake-0.1.0.tar.gz (671.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opensnake-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file opensnake-0.1.0.tar.gz.

File metadata

  • Download URL: opensnake-0.1.0.tar.gz
  • Upload date:
  • Size: 671.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for opensnake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2cbd1b4cdaaf023acf8562a6302e659ca39354f0b0050e4ac8bcdc9826a7a9d4
MD5 233e3f232d600379dda1ce6971218683
BLAKE2b-256 4a567b422ed79af98b67bccfb8580e4069ba1736a7660ea2b296a46488281cc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensnake-0.1.0.tar.gz:

Publisher: pypi.yml on hugobatista/opensnake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opensnake-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opensnake-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for opensnake-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc58103c618270c4e25b0b792ed4edc37131ce8a025a656e2e3f69ce6b75adb4
MD5 cf191839cb51112f3db191fd03fda3cb
BLAKE2b-256 96d1ce3bb3556de7d5d796131e05a0cc7928f39291ede15bc222d92683ee5551

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensnake-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on hugobatista/opensnake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page