Hallows: A Haunted Terminal That Reads Your Shell History and Names the Deathly Hallow You're Chasing A developer built Hallows, an open-source terminal tool that reads a user's shell history locally and classifies it into one of three Harry Potter-inspired "Deathly Hallow" archetypes — Elder Wand (power commands like sudo and rm -rf), Resurrection Stone (git reflog and reset), and Invisibility Cloak (ssh, tmux, tor) — using Gemma 2 2B via Ollama with Kokoro-82M/Piper for voice, keeping all history on-device. The developer reports that an initial additive scorer rated a synthetic everyday-developer history as 85.7% Stone with "undeniable" confidence, while a baseline-subtracted scorer gave 72.3% Stone at "medium" confidence, and that bootstrap resampling (300 runs) across four synthetic personas was 100% stable for Wand, Stone and Cloak but only 55% for the balanced Master persona. Testing also found Gemma 2 2B copied a supplied hint exactly in 20 of 20 runs, including a deliberately wrong one, while blind scoring matched the rule-based verdict in 10 of 10 runs. This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine https://dev.to/challenges/hacktoberfest-week4-2026-10-26 Your shell history is the ghost in your machine. Every rm -rf you ran in frustration, every git reset --hard at 2 AM, every ssh into a server you hoped nobody noticed is still sitting in a plain text file in your home folder. Nobody reads it. I wanted to see what it says about you. Hallows is a terminal tool in two acts. It runs on your laptop with open models, and none of your history leaves your machine. It reads your history, hides your secrets, and decides which Deathly Hallow you are chasing. The three Hallows are three ways to cheat death, so each one maps to a way of using a terminal: The Elder Wand power : sudo , kill -9 , rm -rf , kubectl . You make the system obey. The Resurrection Stone the past : git reflog , git reset , git log --follow . You keep trying to bring something back. The Invisibility Cloak stealth : ssh , tmux , vpn , tor . You prefer to move unseen. The Master of Death: all three in balance. It should be rare. hallows ofrenda builds an altar for the tools you stopped using: commands you ran at least 10 times that have not appeared in your history for more than 60 days. Each one comes back for a night, with its last words the last command you typed . Hallows is for fun, not psychology. It counts what you typed and has an opinion about it. When I ran hallows scan on my own 2000 shell commands, it named me The Elder Wand 63.0% Wand, 29.6% Cloak, 7.4% Stone , and Gemma mocked my pip install habit: "I have seen fools who attempt to wield such mundane instruments as 'pip install', yet they believe themselves worthy of the title 'Master'." It is a joke in a spooky voice, not a horoscope, and my history has no timestamps, so it knows nothing about when I typed things. Being roasted by my own terminal still gave me chills. Local: Gemma 2 2B through Ollama, Kokoro-82M / Piper for the voice. Zero bytes of your command history touch the cloud. The first scorer was wrong: it just added up points. On a synthetic everyday-developer history git status , git log , git diff , grep , cat , pip install , python main.py , ls -la , repeated , the old scorer said STONE, 85.7% Stone, confidence: undeniable. With a baseline subtracted, the new scorer says STONE 72.3% Stone, 16.2% Wand, 11.6% Cloak , confidence: medium. Stability: bootstrap 300 resamples on my four synthetic personas gave Wand 100%, Stone 100%, Cloak 100%, Master 55%. The balanced persona is the least stable, as it should be. Gemma copies hints: on my own history the rule-based scores and Gemma were almost identical JS divergence 0.02 , and I now know why. Given a hint, Gemma 2 2B copied it exactly in 20 of 20 runs, including a deliberately wrong hint. Blind, it scored the same commands Wand in 10 of 10 runs mean 87.5 . Demo video: Hallows demo https://drive.google.com/file/d/1Hw-viMbFZjVbZ28z6dijpi5KbZ-T5pqk/view?usp=sharing https://dev.tourl Hallows verdict screen ~ ❯ python3 -m hallows.cli scan --speak Reading your shell history... Loaded 2000 commands 0 with timestamps, window: last 90 days Consulting Gemma gemma2:2b locally... Gemma is reasoning about your soul... Heuristic vs Gemma alignment JS Divergence: 0.02 The shade of Lord Voldemort peers into your history... | | | | | | | ╭────────────────────────────── ☽ Your Verdict ☽ ──────────────────────────────╮ │ │ │ The Elder Wand │ │ You do not seek power. You demand it. │ │ │ │ This soul's fascination with power and control is evident. The │ │ incessant upgrade of the very tool they use to manipulate others │ │ reveals a hunger for domination that borders on childish obsession. │ │ │ │ Confidence: HIGH │ │ Stability: Verdict held in 74% of bootstrap resamples │ │ │ ╰──────────────────────────── signal strength: 276 ────────────────────────────╯ | Elder Wand █████████████████░░░░░░░░░░░ 63.0% ○ Resurrection Stone ██░░░░░░░░░░░░░░░░░░░░░░░░░░ 7.4% △ Invisibility Cloak ████████░░░░░░░░░░░░░░░░░░░░ 29.6% Soul Timeline Sticky HMM : Commands 0–87 : The Elder Wand Commands 88–172: The Resurrection Stone Commands 173–361: The Elder Wand Commands 362–434: The Resurrection Stone Commands 435–466: The Elder Wand Commands 467–485: The Invisibility Cloak Commands 486–701: The Elder Wand Commands 702–738: The Invisibility Cloak Commands 739–1184: The Elder Wand Commands 1185–1681: The Resurrection Stone Commands 1682–1999: The Elder Wand ╭──────────────────────────────── he speaks... ────────────────────────────────╮ │ │ │ I have seen fools who attempt to wield such mundane instruments as │ │ 'pip install', yet they believe themselves worthy of the title 'Master'. │ │ Such arrogance is the mark of ignorance and weakness, not power. │ │ │ ╰──────────────────────────────────────────────────────────────────────────────╯ Summoning the voice... On my own history, hallows ofrenda printed "No timestamps found in your shell history", because zsh does not record timestamps unless you run setopt EXTENDED HISTORY . So this altar comes from simulations/ofrenda demo.txt , a synthetic extended zsh history I generated with abandoned tools vagrant , grunt , svn : ~ ❯ python3 -m hallows.cli ofrenda -f simulations/ofrenda demo.txt --speak 🕯️ ── OFRENDA: ALTAR OF ABANDONED COMMANDS ── 🕯️ Remembering the tools and workflows you left behind... ╭───────────────┬──────┬────────────┬────────────┬───────────┬─────────────────╮ │ │ │ │ │ │ Last Words │ │ Ghost Command │ Uses │ First Seen │ Last Seen │ Days Gone │ Sanitized │ ├───────────────┼──────┼────────────┼────────────┼───────────┼─────────────────┤ │ vagrant │ 12 │ 2024-05-06 │ 2024-05-06 │ 908d ago │ vagrant destroy │ │ │ │ │ │ │ -f │ │ grunt │ 11 │ 2024-05-18 │ 2024-05-18 │ 896d ago │ grunt deploy │ │ svn │ 11 │ 2024-05-29 │ 2024-05-29 │ 885d ago │ svn cleanup │ ╰───────────────┴──────┴────────────┴────────────┴───────────┴─────────────────╯ Rest in peace, vagrant. You served your master well before the darkness claimed you. ollama pull gemma2:2b git clone https://github.com/pushhpizzaaa/hallows && cd hallows pip install -e . hallows scan judge your own history hallows ofrenda needs timestamps: setopt EXTENDED HISTORY in zsh hallows install-hook --frequency 5 let it whisper after every 5 commands python3 test personas.py check the built-in test personas Your shell history reveals which Deathly Hallow your soul is chasing. A Halloween terminal tool powered by Gemma 2B running locally via Ollama . It reads your shell history, strips all secrets, and lets a local AI deliver a Voldemort-voiced verdict on your developer psychology — no internet required, nothing leaves your machine. Built for Hacktoberfest 2026, Week 4: Ghost in the Machine . | Hallow | Sigil | What it reveals | Command signals | |---|---|---|---| | The Elder Wand | \| | Power. Domination. Control. | sudo , kill -9 , rm -rf , chmod , docker run --privileged | | The Resurrection Stone | ○ | Obsession with the past. | git reset , git reflog , git log , history , tail -f | | The Invisibility Cloak | △ | Stealth. Disappearance. | ssh , tmux , history -c , nmap , vpn , unset HISTFILE | | The Master of Death | △○\| | Terrifying balance of all three. | All of the above | Shell history zsh / fish / bash / PowerShell ↓ Sanitizer: hides tokens, IPs, hostnames, home paths ↓ Feature extractor: 50+ word-bounded rules, command → Wand / Stone / Cloak points ↓ stats.py: decay, baseline, probabilities, entropy, HMM timeline, bootstrap ↓ Gemma 2 2B via Ollama: reads recent commands, gives its own scores and a monologue ↓ Verdict screen, soul timeline, ofrenda ↓ Kokoro-82M + sox: spoken verdict, locally My first scorer added up points per command and showed percentages. It passed my four test personas power user, git archaeologist, ghost operator, balanced developer . Then I fed it an everyday developer history and it came out as the Resurrection Stone, because git log , git diff , and cat all score as "the past". Almost everyone would have been the Stone. My personas are archetypes I wrote myself, so they prove the scorer handles obvious cases. They do not prove it is accurate on real people. What improved it is in stats.py , and it is all plain math. It is better but not solved : the everyday history still leans Stone 72.3% , just with medium confidence instead of undeniable. Time decay: a command's weight halves every 7 days: w = 0.5^ age days / 7 . My own history had no timestamps, so decay did not apply in that run. Baseline: I subtract the points a typical developer earns per command, so ordinary git use counts as zero evidence and only unusual behaviour counts. I estimated it from 5 synthetic histories I wrote: the four personas and an everyday developer. Because the everyday history is one of the five, the everyday test above is partly circular. Probabilities: the adjusted totals are divided by sqrt n before a softmax, so a long history is not automatically more certain than a short one. Entropy: the Master of Death appears when the three probabilities are nearly equal normalised Shannon entropy at or above 0.92 . Soul timeline: a sticky 3-state HMM decoded with Viterbi shows which Hallow you were chasing over time. It stays in a state with probability 0.95, and short flickers under 5 commands are merged. Bootstrap: I resample the commands 300 times to see if the verdict survives. A verdict that flips between resamples is shown as shaky. Gemma 2 2B reads the most recent commands that carry signal after sanitizing and returns its own three scores, a one-line reason, and a short monologue in character. To see what it adds, I ran it 10 times per mode on the same six Wand-heavy commands: blind, with a correct hint 70% Wand , and with a deliberately wrong hint 80% Cloak . | Mode | Runs parsed | Mean Wand / Stone / Cloak | Verdicts | |---|---|---|---| | Blind | 10 / 10 | Wand 87.5 85–95 , Stone 20.0 10–60 , Cloak 16.0 0–30 | WAND × 10 | | Right hint 70 / 15 / 15 | 10 / 10 | 70.0 / 15.0 / 15.0, identical every run | WAND × 10 | | Wrong hint 10 / 10 / 80 | 10 / 10 | 10.0 / 10.0 / 80.0, identical every run | CLOAK × 10 | With a hint, Gemma returned the hint's numbers exactly in all 20 runs, even when the hint was wrong: it called commands like sudo kill -9 and sudo iptables -F 80% Cloak because I told it to. Blind, it reached Wand on its own every time, with different numbers on each run. This is a small, easy test six obvious Wand commands, 10 runs per mode . It shows the anchoring clearly, and says little about hard cases. That is why the JS divergence on my own history was 0.02. The scan gives Gemma the rule scores as a hint, and Gemma copied them, so that number is copying, not agreement. In that mode its real contribution is the reasoning line and the monologue. A 2B model is a good narrator, and it can read command sequences, but I do not claim it classifies better than the rules. Blind mode is the only place its scores are independent. | Layer | Component | License | Role | |---|---|---|---| | Local LLM | Gemma 2 2B gemma2:2b | Gemma Terms open-weight | Scores, reasoning, monologue | | Model server | Ollama | MIT | Local inference on loopback, num ctx=2048 , keep alive=10m | | Voice | Kokoro-82M bm george | Apache 2.0 | Spoken verdict | | Fallback voice | Piper | MIT | Offline TTS | | Audio effects | sox | LGPL | Pitch, reverb, echo | | CLI | Rich and Typer | MIT | Terminal UI | The sanitizer and the scorer are my own code. Gemma is open-weight rather than open source, which is why the table says so. Your shell history is the most private file on your machine. It holds tokens, private IPs, internal hostnames and project names. My sanitizer hides what it can, but regex cannot promise to catch everything. Running the model locally is the safety net: whatever the sanitizer misses stays on your computer. Zero bytes of your history go to the internet. It costs nothing. No API key, no per-request bill, no account. You can swap the pieces. --model picks any Gemma build Ollama has. The voice has a fallback. If a closed API changed its pricing or its rules, a tool built on it would stop working. An open-weight model on your own disk keeps working. The tor rule gave Cloak points to editor , monitor and tutorial . It now matches whole words only \btor\b . My baseline did nothing at first. I was subtracting a per-command average from a total over hundreds of commands, so a synthetic everyday history still came out as Stone with near-total certainty. The baseline is now scaled to the history length with sqrt n damping. The sanitizer redacted mkdir -p projects/new as a password, mangled npm i lodash@4.17.21 , and leaked the last octet of 10.0.0.5 . It also missed ssh deploy@prod-db and left project folder names like ~/client-secret/ untouched. The history parser merged consecutive git stash commands into one, so repeated behaviour was invisible. If Gemma emitted bare JSON, the speech synthesis would try to read the raw brackets out loud. Redaction tokens like