Watch Your Claude Code Context Turn Into a Growing Black Hole in the Terminal
This article explains how the ghostty-blackhole plugin visualizes Claude Code's context window as a real‑time ray‑traced black hole that expands as the session fills, and provides step‑by‑step instructions to install the shader, configure Ghostty, and integrate the Claude token script.
When browsing X, the author saw an animated GIF of a black hole drifting in the Ghostty terminal, gradually enlarging and swallowing on‑screen text. The black hole’s appetite represents Claude Code’s context window: as the conversation approaches its limit, Claude automatically compacts, causing earlier project details to fade.
The open‑source project ghostty-blackhole implements this visual metaphor as a Ghostty terminal plugin. Ghostty is a popular open‑source terminal with over 50 k stars on GitHub, and since version 1.0 it offers a custom shader interface that lets users write GLSL code to process the terminal display. The plugin uses this interface to render a real‑time, ray‑traced black hole, inspired by Eric Bruneton’s black‑hole shader that combines pre‑computed lookup tables with ray tracing.
Every frame and pixel is computed on the GPU, so the black hole’s appearance emerges from physical formulas rather than being hand‑drawn. As the Claude Code context fills, the black hole grows from a tiny speck (≈0.06 % of screen area) in the upper‑right corner to eventually covering the whole screen when the context is full, visibly distorting nearby text into “spaghetti”‑like shapes.
Ghostty Blackhole puts a real, ray‑traced black hole inside your terminal. It grows as Claude Code's context window fills up, live.
The visual effect is not a static overlay; the photon ring, accretion disc, and gravitational lensing are all computed on the GPU, making the black hole’s size directly reflect the amount of context stored.
Installation and usage :
Clone the repository:
git clone https://github.com/s0xDk/ghostty-blackholeAdd the shader to Ghostty’s configuration (macOS path: ~/Library/Application Support/com.mitchellh.ghostty/config)
custom-shader = /path/to/blackhole.glsl
custom-shader-animation = trueIntegrate the claude-token.py script with Claude Code by editing ~/.claude/settings.json to add a statusLine command and hooks for SessionStart and SessionEnd that invoke the script.
Reload Ghostty (cmd+shift+, on macOS) or open a new window; the black hole appears as a tiny dot in the corner.
Start a new Claude Code session; the cursor turns amber and the black hole expands as the context grows. When the context reaches 100 %, the black hole can consume the entire screen. Running /compact or starting a new session instantly shrinks the black hole back to a normal terminal.
By following these steps, users can visually monitor Claude Code’s context consumption directly within their terminal.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
