◉ANTIGRAVITY LABJP
Articles/Tips & Best Practices
✦ Tips & Best Practices/2026-07-04Intermediate

Where Context Should Live — Routing It Across Persistent, Per-Task, and In-the-Moment Layers

Antigravity 2.0's /btw lets you inject context mid-task. But unless you separate what belongs in a persistent rule, a task instruction, and a passing aside, your agent's accuracy actually drops. Here is a design for three context layers.

Antigravity 2.015context design4btwGuide skillagent operations8

✦ Premium Article

Antigravity 2.0 added /btw (by the way), so you can slip context in mid-task with a quick "by the way." It is handy. When an agent starts drifting slightly off course, a single line rights it without rewriting everything.

But this convenience has a trap. Pile everything into /btw and stopgap asides accumulate until the agent loses track of which rule is actually in force. Context does not help just because you add more of it. Context placed in the wrong spot lowers accuracy instead. This article builds a design that routes context into three layers and places each one correctly.

Context has three lifespans

You hesitate over "where to write context" because you are not attending to differences in lifespan. A rule you always want followed, an instruction just for this once, and a course-correction right now each have different lifespans. Put each where its lifespan belongs and the agent does not get confused.

LayerLifespanWhere it livesExample
Persistent ruleAlways, across the whole projectAGENTS.md / Guide skill"Write in polite form," "Tables as HTML," "Never touch production URLs"
Task instructionFor the duration of this workThe initial prompt"This article's topic is X," "The target is Y"
In-the-moment asideJust this one move/btw"By the way, that function name is stale; the new one is Z"

The crux of this routing is: do not repeat a persistent rule in /btw every time. Repeating it every time is the signal that it belongs in the persistent layer.

The persistent layer is the "always-on foundation"

Write things you want honored across every piece of work in AGENTS.md, once. What you write here is always in force without restating it in /btw.

# AGENTS.md (excerpt)
 
## Always follow
- Write Japanese body text in polite form (desu/masu)
- Write tables as HTML <table>, not Markdown
- Never connect to the production host (app.example.com); verify on staging only
- Always format external links as [display text](URL) (no bare URLs)
 
## Output conventions
- Do not open with a boilerplate intro like "In this article"
- The conclusion is not a recap; write exactly one next step

A thin persistent layer forces you to re-add the same caution via /btw every time. A persistent layer that is too thick freezes one-off circumstances and gets in the way of other work. Use "is this true for every piece of work?" as your test, and place only what is always true.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A concrete decision table for routing context into three layers: persistent rules, task instructions, and in-the-moment asides
✦A clear line on what to put in /btw and what never to, so you keep the main thread clean
✦An operations loop: when you catch yourself repeating an aside in /btw, promote it to a persistent rule
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $15 for lifetime access
View Membership →

Related Articles

✦ Tips2026-09-22
Don't Leave Your Chat Records to the Export Button — Three Routes for the Night It Does Nothing
Three ways to keep a record of your Antigravity conversations when the Export button does nothing at all: how to tell a broken button from a silent success, how to locate the conversation file in your own environment by modification time, and how to decide what to keep before the session ends.
✦ Tips2026-09-16
The Day the Upload to Agent Overlay Took Every Drop, and How I Got File Handling Back
A full-window Upload to Agent overlay intercepts every drop, so files never reach the integrated terminal or the explorer sidebar. Here are the two workarounds the community found, plus three ways to hand over a path without dragging.
✦ Tips2026-09-07
When the few lines you quoted stop making sense in the next prompt
Antigravity 2.12.0 lets you quote part of a response into your next prompt, but the definitions those lines depend on stay behind. Here is a small script that counts what got left out, plus the widths I actually measured.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links