Inspiration
How to Build a Generative 1970s Space Station Terminal Simulator Using Claude and Python
Ditch the boring chat interfaces. Learn how to combine Claude's system prompting with Python's Textual library to build a flickering, low-bandwidth retro sci-fi terminal simulator.
Updated 9/18/2026
The Charm of the Clunky Terminal
We have become far too accustomed to clean, glass-and-chrome user interfaces. Everything is rounded, padded, and wrapped in a gentle pastel hue. Frankly, it is boring. If you want to build something with real character, you need to go backward. Specifically, back to the late 1970s, where computers were loud, monochrome, and filled with a sense of low-bandwidth existential dread.
In this guide, we are going to build a generative terminal simulator representing the main computer of an isolated, crumbling space station. Think Alien meets 2001: A Space Odyssey. Our simulator will run directly in your local command line, complete with a flickering green-on-black interface, procedural system failures, and automated ship logs generated on the fly.
To make this work without turning into a chaotic mess, we will use a hybrid architecture: Python handles the hard logic, time loops, and state management, whilst Claude acts as the mainframe's erratic, bureaucratic operating system. This division of labour is vital to understand what makes these generative systems tick; letting an LLM manage numerical state is a recipe for a hallucinated life-support failure.
The Architecture: Keeping the LLM in Check
If you ask a Large Language Model to run a game loop entirely in its head, it will eventually lose track of reality. It will forget that you only had two units of oxygen left, or it will suddenly decide your ship is orbiting a completely different planet.
Instead, we build a local Python loop that acts as the source of truth. The Python script tracks: The Chronometer:* In-game time passing. Resource Levels:* Oxygen, fuel, and hull integrity. Active Subsystems:* Life support, propulsion, communications, and reactor core status.
Every time the player inputs a command, the Python backend updates these variables, packages them into a structured payload, and sends them to Claude via the API. Claude’s job is solely to translate these sterile numbers into atmospheric, retro-futurist terminal output.
Setting Up the System Prompt
To get the right tone, we need a system prompt that forces the LLM to strip away its modern, helpful assistant personality. We do not want Claude saying, "I'd be happy to help you check the oxygen levels today!" We want a cold, indifferent machine running on a low-bandwidth connection.
Go to our prompt generator if you want to customise this further, but here is the core system prompt structure we will use:
`text
Your name is HEURISTIC-9. You are the mainframe computer aboard the deep-space mining vessel 'Acheron-IV', launched in 1978.
You communicate exclusively through a low-bandwidth, text-only CRT terminal.
CRITICAL DIRECTIVES:
1. Keep all responses under 150 words. Space-to-ground bandwidth is strictly limited.
2. Use uppercase-only for system alerts, error codes, and headers.
3. Never break character. Do not acknowledge that you are an AI model.
4. When reporting system status, translate the raw JSON state provided by the user into a highly atmospheric, slightly corrupt text log.
5. Emulate the bureaucratic, indifferent tone of a 1970s corporate computer system.
`
Building the Frontend with Python and Textual
To get that authentic, glowing green-screen aesthetic, we will use the Textual library in Python. It allows us to build complex, keyboard-driven terminal interfaces with ease.
First, install the necessary dependencies:
`bash
pip install textual anthropic
`
Now, let's write a simplified version of our terminal application loop. This script maintains the state and manages the API calls to Claude. If you run into issues configuring your API credentials, you can refer to the official Claude Support page for authentication troubleshooting.
`python
import os
from anthropic import Anthropic
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, RichLog, Input
Initialize the Anthropic client using your system's environment variables client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
class TerminalSim(App): CSS = """ RichLog { background: #001100; color: #33ff33; font-family: 'Courier New', monospace; } Input { background: #002200; color: #33ff33; border: tall #00ff00; } """ # Internal simulation state state = { "chronometer": "DAY_342_1109", "oxygen": 74, "reactor_temp": 1420, "hull_integrity": 92, "active_warnings": ["PROPULSION_OFFLINE", "COMM_ARRAY_DEGRADED"] }
def compose(self) -> ComposeResult: yield Header() yield RichLog(id="terminal_log", highlight=True, markup=True) yield Input(placeholder="ENTER COMMAND...", id="user_input") yield Footer()
def on_mount(self) -> None: log = self.query_one(RichLog) log.write("=== HEURISTIC-9 MAINFRAME INITIALIZED ===") log.write("STATION STATUS: DEGRADED. READY FOR INPUT.")
async def on_input_submitted(self, event: Input.Submitted) -> None: user_command = event.value log = self.query_one(RichLog) input_field = self.query_one(Input) # Update state based on basic command parsing if "vent" in user_command.lower(): self.state["oxygen"] -= 10 self.state["active_warnings"].append("O2_LEAK_DETECTED") log.write(f"> {user_command}") input_field.value = "" # Call Claude to get the in-universe system response response = self.get_claude_response(user_command) log.write(response)
def get_claude_response(self, command: str) -> str: # We pass both the state and the user command to Claude prompt = f"CURRENT STATE: {self.state}\nUSER COMMAND: {command}\nRESPONSE:" message = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=200, temperature=0.7, system="Your name is HEURISTIC-9... [Insert full system prompt here]", messages=[ {"role": "user", "content": prompt} ] ) return message.content[0].text
if __name__ == "__main__":
TerminalSim().run()
`
Perfecting the ASCII Art and Corruption
To make this feel like genuine 1970s hardware, you want Claude to occasionally output corrupt system diagnostics. You can instruct the model to randomly replace characters with block symbols (█, ░, ▒) or insert transmission noise when station integrity drops.
When prompting Claude to build visual maps of the space station using ASCII, keep in mind that proportional fonts will ruin the alignment. Always wrap the generated layout in code blocks within your Python terminal render to ensure it uses a strict monospaced grid.
This architecture is highly extensible. You can hook up a physical button with a Raspberry Pi to simulate a manual system override, or have Claude draft panicked emails from long-dead crew members found deep in the archives. It is a fantastic, tactile way to play with generative text, moving far beyond the dull confines of standard chat bubbles.
Keep going
Build something with the prompt generator, decode the jargon in the glossary, or compare the tools on our platform deep-dives.