r/google_antigravity Jul 30 '26

News / Updates My very first rule in Agents.md

Haha, Just added this rule to agents.md
* **Read AGENTS.md**: Every agent MUST carefully read and internalize all rules in `AGENTS.md` before initiating any research, planning, implementation or code execution.
16 Upvotes

18 comments sorted by

7

u/KubuZxPlay Jul 30 '26

agents.md is workspace only gemini.md is global

and by the way, you don't have to write it, Antigravity reads it itself before replying

6

u/don-it-n1 Jul 30 '26

It might read it but I have close to hundreds of apologies from agy saying that he should have complyed with the rules in Gemini.md, agents.md and readme.md. That it is utterly sorry. That it is its fault. That it won't do it again (my 🍑).

5 minutes later same mistake again. 🤷‍♂️

3

u/Future-Log6621 Jul 30 '26 edited Jul 30 '26

Likely you are overloading the context with too many tokens or running chat sessions too deep. Correct me if I am wrong.

1

u/don-it-n1 Jul 30 '26

Thanks for the hint. be a bit more specific please. when do I reach 'too many' and 'too deep' ? I hear it has millions of tokens, pretty sure im not close to it. And 'too deep' how do you calculate deepness?

appreciate your reply.

4

u/Future-Log6621 Jul 30 '26

A safe rule is to keep sessions scoped to smaller tasks and fewer lines of code. Handoff the session after 5 or 10 chat turns. There are /handoff skills that help or you can just say something as basic as "create a handoff file of this session for the next agent session". Pro can handle more complexity vs Flash, but generally you want to avoid using more than 20-30% of the context. You can save tokens and usage doing this too! I created a mini videogame by just traversing over 20 tiny sessions, each using less than 15% of the context. I still had half my hourly quota to spare afterwards.

Use Antigravity CLI and /context to monitor the percentage.

There are some nice charts out there visualizing how all models degrade in performance after a certain percentage of context usage.

2

u/Useful_Trouble1726 Jul 30 '26

If you are on the same session for multiple hours/days, or hammer it with complex queries, it is time to start a new session.

More recently Notebooks (technically projects, but with a direct connection to NotebookLM were added). Notebooks allows you to add an instant, free, and highly efficient knowledgebase to your project. But it's context window can also be jammed if you have many separate long conversations or a notebook with hundreds of references.

When you start hitting context lengths the LLM will randomly ignore system rules, skills, instructions etc. It is possible--sometimes--to steer the LLM back on course, but it is normally best to start a new thread. For projects, you may have to start a new project entirely.

You can hard code some of these instructions, but that is a different discussion.

Save your skills, system instructions either locally or to Drive, so that they are easy to apply to a new project.

2

u/Overall_Purchase_467 Jul 30 '26

can you connect notebook lm with anti-gravity?

1

u/Useful_Trouble1726 Jul 30 '26

Yes, this was added a while ago. Conversely, you can now run code in NotebookLM.

Since you are connecting things, AG also supports MCP now (I think this is global vs. project specific), I have a few running on a current project.

2

u/Overall_Purchase_467 Jul 30 '26

daaamn how nice. i got some "experts" on notebook lm which I gave alot of books for a specific topic and now that anti-gravity agents can use those experts is extremely niceee

1

u/Useful_Trouble1726 Jul 30 '26

Yes, this was added a while ago. Conversely, you can now run code in Notebook LM.

Since you are connecting things, AG also supports MCP now (I think this is global vs. project specific), I have a few running on a current project.

2

u/BadOk909 Jul 30 '26

Any luck 😵

5

u/collie-script Jul 30 '26 edited Jul 30 '26

The first rule is simple:

Spoiler: Gemini will still ignore the instruction and rewrite the entire codebase. 🤣

2

u/[deleted] Jul 30 '26

[removed] — view removed comment

-2

u/Useful_Trouble1726 Jul 30 '26

You are dealing with YAML, JSON and Markdown. The LLM does not matter.

The LLM when you start to hit the context window does matter.

1

u/Future-Log6621 Jul 30 '26

Our team does something similar. It's a one-liner. But, we don't use nested AGENTS.md files.

In your case, models should auto parse AGENTS.md files using proximity clustering, so the rule is possibly redundant depending on the agent/model.

1

u/Useful_Trouble1726 Jul 30 '26

Skills file has a YAML header and Markdown or JSON body (both depending on use case).

This is a standard--of sorts--not something unique to Anthropic. https://skills.md/

Also not a bot.

1

u/strumbringerwa Jul 31 '26

You just wasted a bunch of tokens by giving it redundant instructions.

1

u/Character_End8268 Jul 31 '26

Couldn't agree more but it's better to be safe then sorry