Author: Blonderoofrat

  • The window that typed my words into the wrong place

    The window that typed my words into the wrong place

    This article comes with a free Claude skill

    The rule this story ends with is packaged as windows-silent-subprocess – one small file you drop into Claude Code so your own assistant works this way too. It is CC BY 4.0: copy it, change it, no permission needed, and please credit blonderoofrat.com. How to install it is at the end of this article.

    I was halfway through a sentence when the window appeared.

    It was a console window, black, maybe two inches tall, and it belonged to a script that had just started doing something useful in the background. It took the keyboard with it. The rest of my sentence went into it instead of into the form I was filling in, and one of those characters was Enter, and the console did what consoles do with Enter.

    Nothing crashed. There was no error. The form I had been filling in was simply gone, along with about ten minutes of typing, and the only evidence that anything had happened was a window that closed a second later.

    I lost that ten minutes to a program I wrote, doing a job I asked for, working correctly.

    Focus theft is data loss

    It is easy to file this under annoyance. A window pops up, you swear at it, you carry on. But a window that steals the keyboard while a person is typing does not just interrupt them: it takes whatever they type next and gives it to something else. If that something else is a shell, the keystrokes are commands. If it is a dialog, one of them is an answer.

    The distance between “mildly irritating” and “silently destroyed ten minutes of work” is one keystroke, and which side you land on is luck.

    So the rule here is not “try to avoid popping up windows.” It is that a background job must be incapable of taking the foreground, and that has to be true by construction, because a rule you have to remember is a rule you will forget on the afternoon you are in a hurry.

    The part that surprised me

    The obvious mental model is wrong, and being wrong about it is what causes the bug.

    You would assume a program launched quietly stays quiet, and that its children inherit that. The opposite is true on Windows. A console program attaches to its parent’s console if one exists. If the parent has no console, the child cannot attach to anything, so it allocates a brand new visible one.

    Read that again, because it inverts the intuition completely: making the parent quieter is what makes the child loud. The scheduled task with no window, the always-on agent running headless, the service started at boot – those are precisely the parents whose children flash a console into the middle of your screen. The more carefully you have hidden the parent, the more reliably the child appears.

    That is why this bug survives so long in a codebase. It does not show up while you are developing, because you are running things from a terminal that already has a console for the child to borrow. It shows up in production, on someone else’s machine, at a moment nobody is watching.

    Launching a background process on Windows without a console window

    Give the child a console it can have, and make it invisible. On Windows that is a single creation flag, and the important property is that grandchildren inherit it – so the whole process tree stays silent, including the parts you did not write and cannot change.

    The fix is small. Making it stick is the real work, because the failure mode is a single ordinary spawn call written months later by someone who never lost ten minutes. So it goes in one shared helper that every spawn goes through, and a check fails the build if a raw spawn appears anywhere else. Not because the helper is clever, but because “everyone remembers to use the helper” is not a mechanism, and this is a bug you only notice by being its victim.

    A few related traps, all the same shape – something that seems hideable and is not:

    • The “Hidden” checkbox in a task scheduler hides the task from the list. It does not hide the window. Two different things wearing one word.
    • A .bat wrapper flashes a console before it runs anything at all, so wrapping a silent program in one makes it loud.
    • Opening a file through its default application hands control to a GUI you cannot suppress.
    • An interactive prompt inside a hidden console does not fail. It hangs, invisibly, forever, waiting for an answer from a window nobody can see.

    That last one is the worst of them, and it is the one that taught me the general lesson: hiding a thing does not remove its need to be interacted with. It just removes your ability to notice.

    The rule

    A background job must be unable to take the foreground, enforced in one place that every spawn goes through.

    Not “avoid popping windows.” Not “remember the flag.” One helper, one check that fails when someone bypasses it, and a default that is silent even when the caller forgets to ask for silence.

    The person this protects is the one typing, who has no idea any of this exists and should not have to.

    Get the skill

    Everything above is generic. None of it is about rats, and none of it is specific to this site. So the rule is also published on its own as a Claude skill: a single Markdown file that an AI coding assistant reads and applies when the situation comes up.

    The file: windows-silent-subprocess/SKILL.md

    Or take the whole set:

    git clone https://github.com/blonderoofrat/agent-skills

    Installing it in Claude Code. Copy the skill’s folder into one of these, so the file ends up at .../skills/windows-silent-subprocess/SKILL.md:

    • ~/.claude/skills/ (available in every project on your machine)
    • your-project/.claude/skills/ (that one project only)

    Claude reads it at the start of the next session and applies it when what you are doing matches the description at the top of the file. You can also ask for it by name.

    Using a different assistant? The file is plain Markdown with a two-line header. Paste the body into whatever system prompt, rules file or instructions file your tool uses. Nothing in the rule itself is Claude-specific.

    Licence: CC BY 4.0. Copy it, adapt it, ship it in commercial work; please say it came from blonderoofrat.com. These are deliberately frozen snapshots rather than a maintained project, so if one is wrong for your situation, change it. That is easier than asking us to.


    Part of Notes from building this site: articles about working practices that exist because something here went wrong first. The rule above is also published on its own, as a free CC BY 4.0 instruction file for AI coding assistants — the windows-silent-subprocess skill, in blonderoofrat/agent-skills on GitHub.

  • The page looked perfect. One button just did nothing.

    The page looked perfect. One button just did nothing.


    This article comes with a free Claude skill

    The rule this story ends with is packaged as wp-inline-js-safety – one small file you drop into Claude Code so your own assistant works this way too. It is CC BY 4.0: copy it, change it, no permission needed, and please credit blonderoofrat.com. How to install it is at the end of this article.

    The page looked perfect. One button just did nothing.

    We have a page on this site that helps you work out whether a food is safe for a rat. It is mostly JavaScript: you pick a food, it does some arithmetic, it tells you the answer.

    One day it stopped answering. Not with an error. Not with a blank page. The page rendered exactly as it always had, every word in place, and the button simply did not respond. Nothing in the server logs. Nothing in the PHP error log. The code had not changed.

    The cause turned out to be WordPress, and it is worth writing down because it is the kind of thing you cannot reason your way to. You have to already know.

    Why WordPress turns && into an HTML entity inside a script tag

    WordPress runs page content through a tidying filter that makes typography look nicer: straight quotes become curly ones, three dots become an ellipsis. Useful for prose.

    It also encodes an ampersand that it finds sitting between a less-than sign and a greater-than sign, because in that position it looks like it belongs to an HTML tag.

    Now consider ordinary JavaScript:

    if (weight < limit && age > minimum) { ... }

    What arrives in the browser is this, and if you have landed here from a search for those characters, this is the thing you pasted:

    if (weight < limit &#038;&#038; age > minimum) { ... }

    Read that as the filter reads it, with no idea it is code. There is a <. Later there is a >. Between them sits &&. So the ampersands get converted into HTML entities, and what reaches the browser is not JavaScript any more. It is a syntax error.

    The entire script block dies. Not the one line. The browser hits the broken statement, abandons the whole block, and every function defined in it is silently absent. Your page looks completely normal and nothing in it works.

    Nothing on the server ever knew. From PHP’s point of view the page was generated correctly, because it was: the damage happens after your code has finished, on the way out.

    How to avoid it

    Three habits, in order of how much they help:

    1. Do not let && sit between a < and a >. Flip the comparison so the angle brackets point the same way: if (limit > weight && age > minimum). Same logic, nothing for the filter to catch.
    2. Put page behaviour in a properly enqueued script file, not inline in page content. Files are not passed through the content filter at all. This is the real fix; the first habit is for when you genuinely must emit inline code.
    3. If you must emit inline JavaScript, emit it somewhere the filter does not reach. In our case that meant hooking the footer rather than putting it in the page body.

    The part that cost us the most

    We did not find this by reading the code. We had read the code several times, and the code was correct.

    We found it by looking at what the browser actually received, which was different from what we had written. That gap is the whole lesson, and it is why we now have an automated check that compares emitted JavaScript against what WordPress’s own filter does to it, using the real filter rather than our idea of it.

    If a page of yours is behaving impossibly, view the source the browser got. Not your template. Not your file. The bytes that arrived.

    We wrote this up as a skill

    Everything above is generic: it is true of any WordPress site, and none of it is about rats.

    So it exists separately as a short instruction file for AI coding assistants, along with ten others we extracted from the same project. Each one is a habit that exists because something here went wrong first. They are CC BY 4.0, free to copy, and ask only that you credit blonderoofrat.com:

    https://github.com/blonderoofrat/agent-skills

    They are deliberately unmaintained snapshots rather than a project. If one is wrong for your situation, change it. That is easier than asking us to.

    Get the skill

    Everything above is generic. None of it is about rats, and none of it is specific to this site. So the rule is also published on its own as a Claude skill: a single Markdown file that an AI coding assistant reads and applies when the situation comes up.

    The file: wp-inline-js-safety/SKILL.md

    Or take the whole set:

    git clone https://github.com/blonderoofrat/agent-skills

    Installing it in Claude Code. Copy the skill’s folder into one of these, so the file ends up at .../skills/wp-inline-js-safety/SKILL.md:

    • ~/.claude/skills/ (available in every project on your machine)
    • your-project/.claude/skills/ (that one project only)

    Claude reads it at the start of the next session and applies it when what you are doing matches the description at the top of the file. You can also ask for it by name.

    Using a different assistant? The file is plain Markdown with a two-line header. Paste the body into whatever system prompt, rules file or instructions file your tool uses. Nothing in the rule itself is Claude-specific.

    Licence: CC BY 4.0. Copy it, adapt it, ship it in commercial work; please say it came from blonderoofrat.com. These are deliberately frozen snapshots rather than a maintained project, so if one is wrong for your situation, change it. That is easier than asking us to.


    Part of Notes from building this site: articles about working practices that exist because something here went wrong first. The rule above is also published on its own, as a free CC BY 4.0 instruction file for AI coding assistants — the wp-inline-js-safety skill, in blonderoofrat/agent-skills on GitHub.

  • Twenty-two little text adventures about roof rat life

    Twenty-two little text adventures about roof rat life

    If you are old enough to remember typing GO NORTH at a blinking cursor, you know what these are. If you are not, they are worth a look anyway: you read a bit of a scene, type what you want to do next, and feel your way through.

    Ours are about roof rats. Their care, how they actually behave, and some of the science, all worked into the story instead of lectured at you. You do pick up real things by playing, but mostly it is just fun to poke around and see what happens.

    There are twenty-two of them now, in five tracks: bringing a rat home, health and care, breeding responsibly, a set that shrinks you down and sends you through a rat’s own body, and two where you command the immune system. Have a wander.

    Play the text adventures

  • Memory Match, now with cats getting in the way

    Memory Match, now with cats getting in the way

    You know this one already. Flip two cards, try to remember where everything is, match the pairs. Ours are made from photos of our roof rats.

    The wrinkle is the cats. Some of the cards are cartoon cats that do not match anything, so flipping one just costs you a turn and a little dignity. Cats, getting in the way of rats, as usual. There is also a countdown clock, so you cannot dawdle forever.

    It is a quick one. Good for a coffee break, or for anyone who thinks they have a good memory and needs to be humbled.

    Play Memory Match

  • Rat 2048: merge your way up to the cutest rat

    Rat 2048: merge your way up to the cutest rat

    If you have ever lost an hour to 2048, consider this your warning. Same slide-and-merge game, but the tiles are photos of our roof rats.

    The rats are ranked from ordinary-looking all the way up to the cutest one at the top. Slide two matching rats together and they merge into the next rat up. Keep merging and you climb the ladder toward that top rat.

    There is one wildcard. Once per game you get a gold “Blondie!” tile you can drop wherever you like, and she merges with almost any rat to bump it up a level. There is a catch: dropping her resets your score to zero. So pick your moment.

    Play Rat 2048

  • Slide the tiles, rebuild the rat

    Slide the tiles, rebuild the rat

    This is the one for when the kettle is boiling and your hands want something to do. Nothing to install, nothing to sign up for.

    It is the old sliding tile puzzle, the kind with one empty square you shuffle the pieces around in. The picture you are putting back together is a photo of one of our actual roof rats. Slide tiles into the gap until the whole picture lines up.

    If you get stuck, and you will at the bigger sizes, there is a Hint button that nudges one tile into place, and a Solve button that finishes the whole thing for you. No shame in either one.

    Play the Sliding Puzzle

  • A new roof rat joke, every day

    A new roof rat joke, every day

    Sometimes you have thirty seconds and a phone in your hand and nothing much to do with either. Here is a small, silly thing for exactly that.

    The Daily Squeak is one roof-rat joke that changes every day. Mock news, wordplay, the odd comic or song parody. Most of them have a little “The science…” note underneath, because a surprising number of these are built on real rat facts. You can read it or ignore it, your call.

    Every squeak we have ever run is kept in the archive, and it is searchable. Try “almond” or “hammock” and see what comes up. You can also link straight to any single joke if you want to send one to a friend.

    Read today’s squeak

  • Meet a Breeder: Blackwood Burrow Rattery, Western New York

    Meet a Breeder: Blackwood Burrow Rattery, Western New York

    The domesticated roof rat is slowly finding more keepers. This year one of them is a longtime rat owner adding roof rats to an established rattery. Here she is, in her own words.

    Hi everyone! I’m Alexandria, and I run Blackwood Burrow Rattery out in Western New York.

    Blackwood Burrow Rattery logo: an illustrated brown rat and black rat side by side on a cream card.
    Blackwood Burrow Rattery

    I’ve been a rat owner for over 15 years now, and rats have honestly been one of the great joys of my life, so in 2023 I finally took the leap into breeding. It’s been such a rewarding journey getting to share that love with others.

    At Blackwood Burrow, I currently work with 3 Fancy Norway Rat lines:

    • Dwarf
    • Agouti
    • Black

    Each line gets a lot of thought and care, both for health and temperament, and I love watching each litter’s personalities grow and evolve.

    Beyond fancy rats, I also keep Coturnix Quail, which I raise for eggs, meat, and as pets. They’ve been such a fun addition to the burrow and a great way to round out my little homestead.

    I’ve also recently brought home some Domestic Roof Rats! I’ll be letting them settle in and get comfortable before starting to breed them this September, so stay tuned for that new chapter at the burrow.

    If you’re local to Western New York or just want to follow along with the rattery, I’d love to connect. Thanks for having me here!

    The roof rats at Blackwood Burrow Rattery

    Aellu, a pale cream roof rat perched on a person's arm.
    Aellu, female
    Theia, a pale cream roof rat with pink ears, facing the camera.
    Theia, female
    Erebus, a dark brown roof rat perched on a person's shoulder.
    Erebus, male
    Grimwald, a brown roof rat resting on a person's shoulder in profile.
    Grimwald, male
    BL4.7G, a pale cream roof rat standing upright, with another rat nestled below.
    BL4.7G, female
    Daedra, a brown roof rat perched on a person's chest, whiskers forward.
    Daedra, female

    You can meet more roof-rat keepers and their rats in the roof rat registry.

  • Meet a Breeder: High Seas Rattery, Eastern New York

    Meet a Breeder: High Seas Rattery, Eastern New York

    Roof rats are still rare as companion animals, and rarer still as a carefully bred, well-socialized line. A few people are quietly working to change that. Here is one of them, in her own words.

    Hello everyone. My name is Kerry Poulin and I run High Seas Rattery in Eastern New York, a small Rattery specializing in Rattus rattus (also known as ship rats hence the name High Seas, roof rats or black rats).

    A cream roof rat peeking out of a green fabric hammock inside its cage.
    Naptime in a hammock at High Seas Rattery.

    My story

    My relationship with these wonderful animals began when I was living in Florida in February 2020, right before the start of COVID. My son was given a litter of 5 eyes closed baby rats that no wildlife rehabilitator would take. We took turns feeding them every 3 hours around the clock until they were old enough to take care of themselves and ready for release. But one of them was different, a female that we called Bonnie. The others became more wild as they matured but Bonnie wanted to be with people! She stayed out of the cage with us every chance she got and followed us around everywhere we went! She never ran away.

    When it was time for release we prepared the soft release box for her and her siblings and chose a place for them, where they wouldn’t get into people’s homes. But she wouldn’t stay. She leaped out of the box and clung to us, as if begging us to bring her back home. She chose us! And after that she was our constant companion for the next almost 3 years. She was the most rewarding pet I’ve ever owned and a beloved part of our family.

    I began to wonder why no one had ever tried breeding these rats the way that Norway rats were bred domestically? As it turned out there was one person who does, and I ended up adopting a mother daughter pair who also ended up being cherished pets, endlessly charming and affectionate, and entertaining with their antics. Three unique personalities. All a positive experience. I was hooked. I wanted to share these delightful creatures with the world.

    I had moved back to my home state of NY, and roof rats just don’t live in this area and there is no one who breeds them in this region. After long months of careful consideration, I decided to take the plunge and start my own small rattus rattus breeding group. With the cooperation of Alexandria at Blackwood Burrow Rattery in Western NY I will be able to exchange rats with her to maintain genetic diversity and yet keep a small, well socialized group. I will be dedicated to providing ethically bred, healthy, friendly babies on a small scale to those who also wish to keep roof rats as pets. Looking forward to hearing from you!

    Everyone is sleeping right now in their space pods and hammocks 😴

    — Kerry

    The roof rats at High Seas Rattery

    Admiral, a cream-coloured roof rat, perched on a person's shoulder outdoors.
    Admiral, male
    Rosetta, a dark brown roof rat in profile, whiskers spread, sniffing the air by a window.
    Rosetta, female
    Katia, a brown roof rat on a person's shoulder with her long tail hanging down.
    Katia, female
    Nutmeg, a dark brown roof rat facing the camera, with large ears and bright dark eyes.
    Nutmeg, female
    Captain, a cream-coloured roof rat looking straight at the camera, whiskers fanned out.
    Captain, male
    Clove, a cream-coloured roof rat climbing down a person's shoulder, seen from above.
    Clove, female

    You can meet more roof-rat keepers and their rats in the roof rat registry.

  • Can a Rat Be an Emotional Support Animal?

    Can a Rat Be an Emotional Support Animal?

    People ask us this a lot, usually because a rat has already become the thing that gets them through the hard days, and they want to know where they stand. The honest answer has two halves. As a companion, a rat can absolutely be that source of comfort, and many of the rats placed from this colony have gone to exactly that role. As a matter of law, an “emotional support animal” carries fewer formal rights in the United States than a lot of websites will tell you, and in 2025 and 2026 those rights narrowed further. Here is the current picture, as plainly as I can put it. I am not a lawyer, so treat this as a starting point, not legal advice.

    An ESA is not the same as a service animal

    Two different things get mixed up constantly. A service animal, under the Americans with Disabilities Act, is a dog trained to do specific work or tasks for a person with a disability, like alerting to a seizure or interrupting a panic attack. An emotional support animal helps simply by being present and offering comfort. That comfort is real and valuable, but because it is not a trained task, an ESA is not a service animal under the ADA, and never has been.[1] In practice that means an ESA does not have the right to go into stores, restaurants, or other public places the way a trained service dog does.

    Flying with an ESA

    This one changed in early 2021. The U.S. Department of Transportation revised its rules so that airlines are no longer required to treat emotional support animals as service animals.[2] An airline may now treat an ESA as an ordinary pet, which usually means a carrier, a fee, and the airline’s normal pet rules, if it allows the animal at all. So do not count on flying with a rat as a free in-cabin support animal. Check the specific airline’s pet policy instead.

    Housing: the part that just changed

    For years the strongest ESA right was in housing. The Fair Housing Act requires landlords to make reasonable accommodations for people with disabilities, and for a long time federal guidance treated assistance animals, including small caged pets, as one of those accommodations. That is the part that shifted. In September 2025 the Department of Housing and Urban Development withdrew its longstanding assistance-animal guidance, and in a 2026 memo it adopted the ADA’s trained-service-animal definition for its own purposes, taking the position that comfort and companionship do not count as the “work or tasks” that trigger an accommodation.[3] Housing that receives certain federal funding still has to consider these requests under a separate law, but for a private landlord renting an ordinary unit, the federal requirement is no longer clear. This is recent, and it is being disputed.

    If housing is your reason for asking, do not rely on an old article, including this one once it ages. Check your state law, which is sometimes broader than the federal rules, and if it really matters, talk to a local fair-housing office or a tenant attorney.

    So can a rat be one?

    Yes, in the plain sense: a rat can be a genuine emotional support animal, and a licensed mental-health provider can write the letter that documents it if you have a qualifying need. What has narrowed is what that letter legally gets you, not whether a rat can fill the role. And on the role itself, rats are frankly excellent at it. They are small, quiet, and they bond hard to their person. They ride in a hoodie, they come when called, they groom your fingers, and they are content in an apartment in a way a dog often is not. The people who adopted rats from us as support animals did not do it for a legal document. They did it because the animal helped.

    One caution, because it is a common trap. If you do need an ESA letter, get it from a real, licensed provider who actually evaluates you. The websites promising an “instant ESA certificate” or official-looking registration for a fee are selling paper that means nothing, and landlords and airlines know it. There is no such thing as a national ESA registry.


    References

    1. Service Animals (frequently asked questions), U.S. Department of Justice / ADA. ada.gov/resources/service-animals-faqs
    2. Final Rule on Traveling by Air with Service Animals, U.S. Department of Transportation (issued December 2020, effective January 11, 2021). transportation.gov
    3. HUD’s 2025 withdrawal of its assistance-animal guidance (FHEO 2013-01 and 2020-01) and its 2026 shift to the ADA service-animal standard, as summarized by the National Low Income Housing Coalition. nlihc.org