https://gravatar.com/userimage/16926726/2de44cb9918f08ff7f430244b10bf37b.jpeg?size=256

gowinder's Blog

Away From the Desk: I Gave My Mac Agents a Phone Entrance, and Why "Yes, Merge It" on a Phone Doesn't Count

The last post was about the result file, how the coordinator and the executor hand work over. That setup works, but I skipped past a precondition at the time: the executor runs on my machine, so the human has to be at my machine too. Later I moved the heavy work back onto my own laptop, and that precondition turned into a daily problem — the work lives on the Mac, and I am often not in front of the Mac.

Grok Bot, Claude Code, and DeepSeek Harness: one result file that saves most of the tokens

I keep a handful of Grok bots across a few projects: a game, some small SEO sites, a few MCP tools of my own. They plan and schedule. The actual work, writing code, running tests, clicking through a browser, goes to two agents on my Mac: dsh in a sandbox, and Claude Code via claude -p.

Heavy work on the laptop, coordination in the cloud. The seam between them was the problem. Bots bill by the token, and a long context is both expensive and dumber. The first version of the handoff was me copy-pasting: I would run dsh or Claude Code myself and paste the terminal output back into the chat. The delay was tolerable. The cost was not. That block of output sat in every later turn, and the bot would read logs and think and slowly lose track of what it had said ten minutes earlier.

Batch renaming files from an Excel or CSV list: three approaches that actually work

Batch renaming files from an Excel or CSV list

If you are cleaning up photos, scans, lecture videos or invoices, the situation is usually the same: you already have a table. Column A is the current filename, column B is what you want it to be, maybe column C is a capture date and D is a client code. The hard part is not inventing new names. It is turning that table into actual renames on disk.

Two small sites went live: an Old English dictionary and a batch renamer

Two small sites went live: an Old English dictionary and a batch renamer

I wanted to test one question: can one person, with no budget and no ads, get anywhere by taking a very narrow need all the way to the end?

Rather than argue about it, I built two things. They sit at opposite ends of the spectrum — one is pure content, one is a pure tool — which makes them a clean control group.

Building and Deploying a Web App on Cloudflare Pages with Next.js, Hono.js, Drizzle and shadcn/ui

Building and Deploying a Web App on Cloudflare Pages with Next.js, Hono.js, Drizzle and shadcn/ui

Lately I’ve been taking advantage of Cloudflare’s free offerings—both Workers and Pages. After tinkering with a few small projects and getting through the initial exploration phase, I’d like to share the process of quickly building a Web App deployed on Cloudflare Pages using these open-source libraries.

If you don’t want to read through the process, you can skip straight to the end. I’ve shared the project address; just fork my example project and you can use it right away.

useQuery Error When Using the honojs Client Directly: TypeError: Cannot read properties of undefined (reading 'replace')

useQuery Error When Using the honojs Client Directly: TypeError: Cannot read properties of undefined (reading ‘replace’)

Recently I developed a project using nextjs, honojs, and drizzle-orm, deployed on cloudflare pages. I chose honojs because it is friendly to edge computing.

honojs Query Endpoint Definition

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
export const runtime = 'edge';

type Bindings = {
    DB: D1Database;
};

const app = new Hono<{ Bindings: Bindings }>()
  .get('/', async (c) => {
    try {
      const conditions: Record<string, any> = {};
      const results = await getDb().query.someTable.findMany({});
      return c.json(results);
      // return c.json(resultData);
    } catch (error: Error | any) {
      console.error(error);
      return c.json(error);
    }
  });

export default app;

Route Setup for the hono app

1
2
3
4
5
6
7
const app = new Hono<{ Bindings: Bindings }>().basePath('/api');
const routes = app.route('/sometable', someTable);

export const GET = handle(app);
export const POST = handle(app);

export type AppType = typeof routes;

Calling with useQuery

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
export const useGetSomeTable = () => {
  const query = useQuery({
    queryKey: ['someTable'], // Use filters as the query key
    queryFn: async () => {
      const response = await client.api.someTable.$get();
      console.log('API Response: ', response);
      if (!response.ok) {
        throw new Error('Failed to fetch sometable');
      }
      return response.json();
    },
    throwOnError: true,
      refetchOnWindowFocus: false,
      staleTime: 1000 * 60 * 5,
  });

  return query;
};

The Error When Calling

1
TypeError: Cannot read properties of undefined (reading 'replace')

The problem was here: const response = await client.api.someTable.$get(); I debugged it for two days, asked chatgpt, asked gemini pro, tried many methods, with no result.