Ask

answers get noticeably worse past ~60k tokens even though the window is 200k

Costs nothing and helps a lot: commit constantly. Every time it does something you like, commit. Then when it drifts you reset to the last good point and restart the session, instead of trying to talk it back into a state it can't reconstruct.

I commit maybe 20 times a session and squash later. Cheap checkpoints are what make the restart strategy usable.

26 · in/ai-pair-coding ·

astro 5 getCollection returns an empty array after moving my blog to glob()

General technique for silent loaders: run astro sync, then look in .astro/ at the data store. If your entries aren't in there at all, it's a loading problem: path, pattern, extension. If they're in there but getCollection gives you nothing, it's a filter or a schema issue.

Also worth knowing that in 5.x a schema parse failure is loud, so "quiet and empty" almost always means the glob matched nothing.

44 · in/svelte-vue-astro ·

agent rewrote 340 lines to fix a two-line bug, third time this week

Smaller context helps more than people expect. Give it the whole file and it treats the whole file as in scope. Give it the function plus its test and the diff tends to stay inside the function.

I've started selecting the specific range rather than opening the file for small fixes. It sounds fussy and it measurably shrinks diffs.

61 · in/ai-pair-coding ·

svelte 5 throws state_unsafe_mutation when i set a count inside $derived

If the real computation is heavier than a filter and you really do want one pass producing two values, derive the object:

let result = $derived.by(() => {
  const out = [];
  let skipped = 0;
  for (const i of items) i.active ? out.push(i) : skipped++;
  return { out, skipped };
});

Then read result.out and result.skipped. One pass, no state writes. This is the pattern for anything expensive enough that you care.

61 · in/svelte-vue-astro ·

a service_role client in a shared db module returned another org's invoices

Different angle: your request path should not have credentials that can bypass RLS at all. Give the web process a role without BYPASSRLS and put the admin credential somewhere the web process cannot read it - a separate worker with its own environment.

Then "someone imports the wrong client" fails at connection time in development instead of succeeding quietly in production. Permissions you cannot accidentally hold are better than permissions you promise not to use.

34 · in/rls-and-policies ·

first month with an agent, is 40 tool calls for a one-file edit normal

Normal in the sense that everyone sees it, not in the sense that it's optimal. Things that reduce it a lot:

  • a project instructions file that says where things are. Directory layout, where schemas live, which commands to run. Saves the same six exploratory calls every single session
  • tell it not to run the full suite unless asked. Test runs are usually the most expensive calls and it'll do them reflexively
  • be specific about done: "add the field, don't run the suite, just typecheck"

31 · in/ai-pair-coding ·

Chuck roast for Sunday, 24 hours at 131F or 8 hours at 150F

Middle option nobody mentions: 12 hours at 140F. Slightly pink, sliceable, and the fibres have started to give. It suits chuck well and fits in a single day if you start early. Worth trying once you have done both extremes and know which direction you want to move.

197 · in/sous-vide ·