Bring Your Own Harness

Every so often, you access some random machine: the VM hosting a silly side project, the Raspberry Pi running a toy robot, a friend’s laptop.

Installing a coding agent there is certainly possible, and sometimes worthwhile. But should you really spend the time to install, log in, and manage your authentication once you are done with your task, just to ask Claude how to restart a system daemon? Maybe you shouldn’t. Maybe you should Bring Your Own Harness.

Just two loops

Coding agents, at their core, are quite trivial to implement: roughly two nested loops.

history = []
while prompt := input("> "):  # human → agent
  history.append({"role": "user", "content": prompt})
  while True:                 # agent ↔ tools
    reply = model(history, tools=TOOLS)
    history.append(reply)

    if reply.text:
      print(reply.text, end="")

    if not reply.tool_call:
      break                   # agent is done

    result = run_tool(reply.tool_call)
    history.append({
      "role": "tool",
      "tool_call_id": reply.tool_call.id,
      "content": result,
    })

Do you really need to install a 200 MB binary?

Casper 👻

Casper is a coding agent that fits into a single file. Given an API key you already have (OpenAI, Anthropic, or Google), you can run it with a single command:

curl -fsSL https://raw.githubusercontent.com/ziggy42/casper/main/casper.py | ANTHROPIC_API_KEY=... python3
Casper running in a terminal and using Bash commands to inspect and commit a repository
Casper in action.

Or avoid leaking the key in your shell history and provide it when Casper asks for it at runtime.

It does not support any “advanced” features, such as loading skills, confirming destructive commands, automatically compacting context, and many more. But you get a coding agent running in a couple of seconds: no installation, no nothing.

It will happily run commands, so use it only on machines where you are comfortable giving it that level of power.

I’ve ended up using this little thing far more than I expected.