ai newsDi., 1. Dez.
EilmeldungThe Model Proposes, Your Code Disposes: A Tool-Calling Agent Loop for Android with Gemini Nano

Your AI Is a Goldfish. Stop Overfilling Its Bowl.

Imagine your AI is a goldfish. You've heard the line: a goldfish has a 15-second memory. Every lap of the bowl is a brand-new world. Here's the funny part. It isn't true. Researchers have trained goldfish to respond to sounds and feeding cues, and the fish remember those for months. Goldfish are fi

dev.toSonntag 13:58 · 29.11.7 Min. Lesezeit
Bild: dev.to

You've heard the line: a goldfish has a 15-second memory. Every lap of the bowl is a brand-new world.

Here's the funny part. It isn't true. Researchers have trained goldfish to respond to sounds and feeding cues, and the fish remember those for months. Goldfish are fine.

Your coding agent is the one with the 15-second memory.

Every session starts empty. It doesn't remember yesterday, the bug you fixed in March, or the approach you rejected last Tuesday. All it has is the bowl, the context window, and whatever you put in it before it starts swimming.

And most of us fill that bowl before we even say good morning.

6:59. The goldfish is asleep. Bubbles. Quiet. Context: empty. Ready for anything.

7:00. One eye opens. Before you've typed a word, it has already loaded a 400-line CLAUDE.md, AGENTS.md, rules.md, a skill catalog and an mcp.json worth of servers.

7:00 and one second. Both eyes open. Plugin lists. MCP tool schemas. "Always use tabs." "Never use tabs in YAML." A rule about TDD, copy-pasted into this repo the same way it was copy-pasted into the last eleven.

7:01. You tap the glass: "Good morning! Can we fix the bug in ticket 4182?"

7:01 and two seconds. Then you drop fifty lines of stack trace and a Jira paste into the bowl. Splash.

7:02. Now watch the goldfish sweat. "Let me recheck what this whole project does... reading files... finding the root cause... how do I test this... the DB isn't connected, can I spin it up?" It rereads the whole project like it has never met you. Because it hasn't.

7:03. You type "yes". The bowl is nearly full. Older parts of the conversation start getting summarized or dropped. The goldfish is about to forget its own name.

The percentages in my video version of this (40%, 65%, 92%) are cartoon numbers. Your real ones depend on your rule files, your MCP servers and your client. In Claude Code, run /context and look at what's already in the bowl before your first message. It's worth a minute.

Context windows are big now. That doesn't make the space free. Everything loaded at session start:

The usual answer is "put it in CLAUDE.md". So the instruction file grows. It picks up the test command, the architecture overview, three postmortems, a style guide, a rule from a tool you uninstalled in August, and the same block pasted into the global file and the project file.

I'm not judging. I found that last one on my own machine today: a block of instructions for a CLI tool that wasn't even installed anymore, sitting in both my global and my project CLAUDE.md, plus 113 permission rules for it in my Codex config. Every session loaded it twice and couldn't use any of it.

~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, Cursor's global rules. These load into every session in every project, for certain. That guarantee is exactly why they should be short.

Put things here only if they're true in every project and must hold even if nothing else loads.

If you do TDD everywhere, why is "use TDD" in your project file? Write it once, globally. If you only do TDD in one repo, it belongs in that repo's file and nowhere else. If it's in both, you pay for it twice and they'll drift apart the first time you edit one of them.

CLAUDE.md or AGENTS.md in the repo. It also serves people and tools that don't have your memory: contributors, CI agents, a teammate's fresh checkout.

Keep it to what every task in this repo needs. Here's the whole project CLAUDE.md for Palace itself:

Use `palace mcp` to expose this repository as an MCP server. Development commands: cargo fmt cargo clippy --all-targets --all-features -- -D warnings cargo test --all-features cargo audit Releases: bump `version` in `plugin/.claude-plugin/plugin.json` to the new `Cargo.toml` version in the same release commit. Enter fullscreen mode Exit fullscreen mode That's it. How to build, how to check, and the one mistake that has actually happened more than once.

What doesn't belong here: why we chose SQLite, what broke in the last migration, which approach we tried and dropped. That's history, and history grows every day. If it lives in an always-loaded file, the bowl fills up a little more every week.

Skills and MCP servers are tools, not memory. Many clients now load them lazily: a skill shows only its description until it's used, and Claude Code can hide MCP tool schemas behind a tool search. Even so, every server you've connected still adds names and instructions to the bowl. If a project never touches Jira, the goldfish doesn't need to know Jira exists.

Decisions and the reasons behind them. What broke last time and how you fixed it. The command that finally worked. Preferences you stated once and are tired of repeating.

None of this needs to be in the bowl at 7:00. It needs to be there when the question comes up, and only the part that answers it.

Palace is local-first memory for coding agents. One Rust binary, one SQLite file on your machine, no API keys, no cloud. It works with Claude Code, Codex, Cursor, Gemini CLI, VS Code, OpenCode, Cline, Zed, Goose, Windsurf, Antigravity and Claude Desktop, and they all share the same memory.

It stores text verbatim: code, notes, conversations and the agent's own diary, exactly as written. No LLM rewrites them into summaries. Search is hybrid (BM25 keywords plus local embeddings on your CPU), and every result carries a receipt: wing, room, source file, drawer id and a score breakdown.

The important part for the goldfish is how it gets into the bowl. palace install registers hooks, and every hook has a hard limit.

The whole block is held under 9,000 bytes. That number isn't arbitrary. Claude Code saves hook output over 10,000 characters to a file and gives the agent only a preview, so anything past that limit would never reach the fish anyway.

Memories from your other projects stay out. The goldfish working on your API doesn't wake up thinking about your side-project game.

When you ask something, the prompt hook searches Palace with your actual question and injects up to 3 matching memories, and only if they clear a relevance threshold. If nothing is relevant, nothing is added.

Prompts under three words aren't searched at all. The "yes" you typed at 7:03 costs you nothing.

While the agent greps and reads files, the post-tool hook surfaces memory related to what it's looking at. That's how "we tried this in October and it broke the seed script" shows up before the agent tries it again, without anyone asking.

The stop hook closes the loop. If the session did real work but saved nothing, it asks the agent once to write a diary entry and record any decisions before it finishes. Memory only works if something gets written, and today's fix becomes tomorrow's recall.

Every hook fails open. If the palace is missing or broken, your agent works exactly as before.

Rewind. 7:00. The goldfish wakes up in a suit and tie. There's a small Palace badge on the bowl.

The bowl holds the short global rules, the repo's build commands, your standing preferences, and yesterday's diary entry for this project. That's all.

Ticket 4182 arrives. Before the goldfish starts rereading the whole project, one memory comes up, with a receipt:

[palace → wing my_api, room decisions, diary 2026-03-14] Same symptom fixed in March: the DB seed script ran before the migration. Fix and test command are in the same entry. Enter fullscreen mode Exit fullscreen mode (Illustrative example. Your receipts will point at your own drawers.)

No full reread. No "can I spin up the DB?" detour. The goldfish fixes the bug, writes one diary line, and gives you a little fin-five.

It can. That's exactly why hard rules stay in always-loaded files: they're guaranteed, and retrieval isn't. Palace is for history, not for the three rules that must never be broken.

How often does it miss? The numbers are public and reproducible:

Method, splits and the failures are in docs/benchmarks.md. The 1.3% is the whole argument of this post in one number: the goldfish doesn't need the whole ocean. It needs the right spoonful.

And palace gain shows what it's doing in your sessions: hit rate, precision, repeat questions avoided, estimated tokens saved and p95 latency, computed from your local database.

# macOS / Linux curl -fsSL https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.sh | sh # Windows (PowerShell) irm https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.ps1 | iex palace install # wires up every agent on this machine palace doctor # checks each one is connected Enter fullscreen mode Exit fullscreen mode Free, open source, MIT licensed. Everything runs on your machine.

Your goldfish has a small bowl, and that space is precious. Keep the rules short. Give it the rest when it matters.

Quelle: dev.to (dev.to). Original öffnen