Memention

A bigger scratchpad

I spend a lot of time in the terminal, and one of the windows is usually just a scratchpad. A place to dump text I need now and then, a snippet, a token, half a command, a phone number someone read out loud. Nothing precious, just stuff that needs to sit somewhere for a while.

The way I do it is silly. I start cat > /dev/null and then throw whatever at it:

cat > /dev/null

And if I’m really lazy it’s just cat, and then I have to live with every line echoed back at me, doubled. Which is fine. It’s a scratchpad, not a cathedral.

But you know how it goes. You look at a little habit you’ve had for years and think, what would the slightly better version of this be? And then you don’t build the slightly better version. You build something way more than needed.

So now I have terminal_pad. A text pad in the terminal, but over an infinite 2D canvas. You write anywhere, in any direction, you pan around, you drag to select a rectangle, copy it, paste it somewhere else on the plane. Nine bookmarks if you want to jump between spots. And when you lose track of where everything is, Ctrl+Z zooms out to a little density minimap with a box showing where you’re looking. For a scratchpad. I know.

It’s built in Rust, with ratatui doing the drawing and crossterm handling the keys. A .tpad file is just JSON (the written cells, the bookmarks, the cursor), and only the cells you actually wrote take up any space. Ships as one binary.

The reason I could even justify this is the AI side. This is the cards thing in practice. The project is feature-first, every feature a small module with its own little contract file, so the agent can extend one part without reading the whole thing. And I’ve slimmed the bootstrapping down to almost nothing, and to start a project from scratch I just tell Claude:

Apply https://ai.memention.net/setup

One line at the prompt, and the project lays itself out

and the skeleton, the cards, the layout, it all gets laid out before I write a line. I must say it works pretty good. The rocket is on the pad before the agent gets the task.

Oh, and that colored title bar in the picture. I have a lot of terminals open, all running Claude in different projects, and they all look the same. So I wrap claude in a little shell function that hashes the directory name into a color and paints the iTerm2 tab with it. Same project, same color, every time. Nothing clever, just enough to tell them apart at a glance.

claude() {
    # iTerm2 tab color, hashed from the directory name
    local hash=$(echo -n "$PWD" | md5 | cut -c1-6)
    local r=$((16#${hash[1,2]}))
    local g=$((16#${hash[3,4]}))
    local b=$((16#${hash[5,6]}))
    echo -ne "\033]6;1;bg;red;brightness;${r}\a"
    echo -ne "\033]6;1;bg;green;brightness;${g}\a"
    echo -ne "\033]6;1;bg;blue;brightness;${b}\a"

    command claude "$@"          # pass everything through

    echo -ne "\033]6;1;bg;*;default\a"   # reset on exit
}

Anyway, back to the pad. Installing it is one command:

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/epatel/terminal_pad/releases/latest/download/terminal_pad-installer.sh | sh

and then terminal_pad --name notes gives you a central pad you can reach from any directory. Which, I’ll admit, is a lot of machinery for a thing that used to be cat > /dev/null.

Grab it at github.com/epatel/terminal_pad if you want to play with it. Was it needed? No. Did it make me smile? Yes…

· · ·