« Back to Applications

PPC Claude Agent

PowerPC Mac (Tiger) 向け

A personal project that keeps a 20-year-old PowerPC Mac useful as a real AI coding assistant. The official Claude Code CLI needs Node.js 18+, which can't run on Tiger's old PowerPC hardware, so this is a self-contained agent written in Perl that talks directly to an AI API over curl — Claude (Anthropic) or Gemini (Google, free tier, no credit card needed) — no Node.js, no compiling on your side required.

Why I Made This

"Build apps that still work properly on old Macs, and have a bit more fun doing it — they don't break easily, and honestly, they still look cool." That's the reason behind pretty much everything else on this site. This one's a little different.

I bought an iBook as a student, stretching further than I really could afford. My father was a branch manager at a major company, spending most of his time on golf, driving a brand-new BMW instead of a Toyota or even a Lexus — and later traded it in for an even more extravagant Nissan GT-R. And yet he never spent a single yen on me. I ended up dropping out of a science university and working as a photo studio assistant, juggling that with whatever else I could find. Shooting notes, lighting characteristics, all of it — I wrote it all on that iBook.

So I decided to turn that old iBook into a good advisor. Something you'd consult like a soft-spoken professor. Something that could quietly add a line or two to those same worn-out notes I used to keep on it. It can't handle anything heavy — Photoshop's obviously out of the question — but that's fine. That's actually the point.

The reason this runs on Claude (Anthropic) specifically is simple: it's just really good at being a coding agent. Hand it the concept, even without writing a line of code yourself, and it gets built properly. It'll listen to old stories too, and actually talk things through with you. That old iBook has a job title now: advisor.

Download ppc-claude-agent.zip
Downloads so far: 69
Last updated: 2026-08-28 (v1.2.1)
Note: Tiger's stock Safari/curl can't verify today's HTTPS certificates, so downloading here directly can fail. We recommend Aquafox — the PowerPC-era browser we make a Japanese language pack for — which handles modern HTTPS fine. Failing that, fetch the file on a modern machine and copy it over, or use a modern curl via Tigerbrew/MacPorts.

Changelog

  • 2026-08-28 — Added Gemini (Google) support alongside Anthropic (Claude) — Gemini has a free tier with no credit card required. Choose which one to use during setup
  • 2026-08-28 — Renamed the command from claude to advisor (not tied to one AI brand). Typing /claude or /gemini mid-conversation now switches providers on the fly, carrying the conversation over
  • 2026-08-28 — Fixed Gemini responses taking ~30 seconds on real hardware, down to roughly 3 seconds (varies by device) — Gemini 3 models default to maximum internal reasoning ("HIGH") unless told otherwise. Now defaults to "LOW" for snappier answers on casual questions (override with CLAUDE_GEMINI_THINKING=high)
  • 2026-08-28 — Brought the distributed double-click installer (Install.command) up to date — it still only knew about Anthropic; now offers the same Anthropic/Gemini choice and advisor command as setup.sh
  • 2026-08-28 — Changed the default Gemini model from gemini-3.6-flash to gemini-3.5-flash-lite — found on real hardware that gemini-3.6-flash's free tier allows only 20 requests per day, while flash-lite has a much larger free daily allowance
  • 2026-08-22 — Fixed Japanese IME input getting corrupted by a stray 0x16 byte
  • 2026-08-22 — Fixed Install.command's misleading "Press Enter to close this window" message
  • 2026-08-22 — Fixed Enter sometimes being silently swallowed right after certain input
  • 2026-08-22 — Fixed every keystroke pushing the terminal down a new line instead of editing in place
  • 2026-08-22 — Fixed Japanese input filling the screen with garbled "◆" characters
  • 2026-08-22 — Fixed the installer prompting to re-enter the Anthropic API key when re-run for an upgrade
  • 2026-08-22 — Fixed arrow keys inserting garbage characters instead of moving the cursor

What's Inside

  • curl — a prebuilt, TLS 1.2/1.3-capable curl for PowerPC/Tiger (the stock curl on Tiger can't reach today's HTTPS servers)
  • cacert.pem — a current CA certificate bundle
  • claude-agent.pl — the agent itself, a single Perl file with zero external CPAN dependencies
  • Install.command — the installer you double-click

Main Features

  • Runs on Tiger's stock Perl 5.8.6 alone — no build tools needed on the target Mac
  • Implements four tools: read_file / write_file / list_dir / run_shell
  • File writes and shell commands prompt for confirmation before running, to avoid accidents
  • HTTP is handled by shelling out to the bundled curl, keeping TLS entirely out of the Perl code
  • Replies automatically switch between Japanese, English, and other languages to match whatever you type — no client-side language setting needed

Installation

  1. Unzip ppc-claude-agent.zip and copy the whole folder onto your PowerPC Mac (USB stick, file sharing, etc.).
  2. Double-click Install.command. A Terminal window opens.
  3. It first asks which AI to use: Claude (Anthropic, most capable, needs a paid API key) or Gemini (Google, free tier, no credit card needed). Follow the prompts — the installer explains how to get whichever key you need.
  4. When it says "Setup complete!", open a new Terminal window and type advisor to start.

No compiling, no MacPorts, no Xcode required. The command is called advisor rather than something tied to one AI's name — if you add both keys during setup, you can type /claude or /gemini inside a conversation to switch any time, carrying the conversation over.

About the API Key (billing)

This project (the agent and installer) is free to use, but actually talking to an AI requires your own API key for whichever provider you pick. Claude's key is billed pay-as-you-go at console.anthropic.com — a different site and a different billing system from a claude.ai subscription. Gemini's key is free to create at aistudio.google.com, with a free tier that needs no credit card at all. No API key is embedded in the code anywhere; claude-agent.pl only reads it from an environment variable, so sharing this project never exposes anyone's key or billing to anyone else. The installer walks you through creating whichever key you chose.

Supported Environments

EnvironmentPowerPC Mac / Mac OS X 10.4 (Tiger)
Verified hardwareiBook G4 (PowerBook6,5)
NotesThe bundled curl was built without CPU-specific optimizations, so other PowerPC Tiger machines should work too, though not every model has been tested.

A personal hobby project provided with no warranty. If curl doesn't run on your machine, the full project (build scripts included) shows how to build the TLS toolchain from source instead.

PPC Claude Agent is basically a single Perl file that talks straight to an AI API over curl — Anthropic or Gemini. The official Claude Code CLI needs Node.js 18+, and V8 dropped PowerPC support years ago, so this is a completely separate route built from scratch that doesn't touch Node.js at all. Here's what actually got in the way, and how each one got solved.

The real wall was TLS 1.2

Anthropic's API requires TLS 1.2 or newer, and Tiger's stock OpenSSL (0.9.7l) doesn't even reach TLS 1.0. Bumping the Python version or whatever doesn't fix that — OpenSSL and curl themselves need rebuilding from source. And trying to get there via Tigerbrew or MacPorts runs into a chicken-and-egg problem, since fetching packages from GitHub needs TLS 1.2 over HTTPS in the first place. Worked around that by downloading the source tarballs on a modern machine, scp-ing them to the iBook, and doing the actual build right there on the iBook itself. The heavy lifting is still genuinely done by the G4, so the "runs standalone on the G4" goal holds up.

The linker kept grabbing the wrong library

Once it came time to build curl, fairly recent symbols like EVP_sha256 kept coming up "undefined," crashing at runtime with dyld: Symbol not found — a confusing failure that looks like a TLS problem but isn't. Turned out Darwin's ld was preferring the system's /usr/lib/libssl.dylib (Tiger's old OpenSSL 0.9.7l) over the freshly built one, even with -L pointing at the right place. Adding -Wl,-search_paths_first to LDFLAGS forced it to check the given path first, and that fixed it.

A Perl agent with zero external dependencies

claude-agent.pl runs on nothing but Tiger's stock Perl 5.8.6 — no external CPAN modules at all. JSON encoding/decoding is a small hand-written recursive-descent parser, just enough to handle the Claude and Gemini APIs' message formats. HTTP is handled entirely by shelling out to the curl binary that got built, so the only two things that actually need compiling are OpenSSL and curl.

Adding Gemini without touching most of the file

Conversation history is kept internally in Anthropic's Messages-API shape no matter which provider is active; when talking to Gemini, that gets translated to and from Gemini's contents/parts/functionCall shape only at the moment of the API call, and translated straight back on the way in. call_api itself ended up as a completely generic "POST this JSON, get JSON back" function once the URL and headers moved to being passed in instead of hardcoded. The upshot: the terminal input handling and the tool execution code (read_file/write_file/list_dir/run_shell), easily the bulk of this file, needed zero changes to support a second provider.

Gemini 3 quietly requires echoing back a thoughtSignature on tool calls. When Gemini returns a functionCall part, it comes with an opaque thoughtSignature attached. Send the next turn back without that exact signature riding along on that same part, and the call 400s — this was optional on Gemini 2.5 but became a hard requirement on 3, with no obvious announcement. Found it by watching a real multi-step tool-calling conversation (list_dir → run_shell → run_shell → list_dir) fail partway through on real iBook hardware. Now carried along on the internal tool_use block and reattached whenever it's re-serialized back to Gemini.
The API response itself could corrupt Japanese text. Same root cause as the STDIN bug further down: Perl 5.8.6's PerlIO :encoding(UTF-8) layer can split a multibyte character across a buffer boundary and throw utf8 "\xXX" does not map to Unicode — just showing up on the response-reading side this time, once a run_shell result happened to contain a folder named “ダウンロード”. Fixed the same way: read the response as raw bytes, decode the whole thing at once afterward.

A pile of terminal-input bugs

Actually using this thing on real hardware turned up one terminal quirk after another.

Arrow keys typed as literal characters. The first version just read from STDIN, which has no concept of cursor movement, so an arrow key's raw escape sequence (ESC [ C, etc.) landed in the input as text. Fixed by writing a small stty-raw-mode line editor from scratch.
Japanese input filling the screen with "◆". The line editor read one raw byte at a time and redrew after every byte, so a 3-byte Japanese character would briefly exist as an incomplete sequence that got decoded into a "◆" placeholder — once per byte. Fixed by waiting for a full character's bytes before adding it to the buffer.
Every keystroke pushing the line down instead of editing in place. The redraw logic reprinted the entire prompt string on every keystroke, and that string happened to start with a literal newline — so a real newline got sent to the terminal on every single character typed. Fixed by only including that leading newline the first time the prompt is printed.
Enter occasionally getting swallowed. The multi-byte continuation-byte handling trusted that whatever came after a UTF-8 lead byte was a real continuation byte, without checking. When the actual input stream had something unexpected in it, whatever came right after — including an Enter keypress — got consumed as if it were part of that character. Fixed by validating continuation bytes and pushing back anything that doesn't look right, so it gets read again as its own keystroke.
Terminal.app prefixing 0x16 onto every byte of Japanese input. This was the actual root cause behind Japanese still being garbled after all the fixes above — turns out Terminal.app on this iBook sends IME-committed text with a literal 0x16 (the old Unix "LNEXT" signal) in front of every byte. Found it by adding a temporary debug-logging mode and capturing the real byte stream from an actual session. Fixed by stripping each 0x16 and treating the following byte as the real one.

What's next / a note on distributing this

The agent itself is free to share, but actually using it requires each person to get their own API key for whichever provider they pick. With Gemini's free tier, that's a genuinely zero-cost start — no credit card, no billing setup. No API key is ever embedded in the code, so sharing this never exposes anyone's billing to anyone else.

Full source code is on GitHub.