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.014context design2btwGuide skill2agent operations5

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 $10 for lifetime access
View Membership →

Related Articles

Tips2026-06-12
This Week at Antigravity Lab: Five Posts on Deciding How Much to Hand Over to Agents
Editor's notes on five posts: sizing agent tasks by what you can review, delegating dependency updates by risk tier, a StoreKit 2 migration case study, and a Japanese UI setup guide.
Agents & Manager2026-07-04
Where to Put Evidence and Approval When Your Agent Self-Debugs in a Real Browser
Antigravity 2.0 launches a real Chrome mid-build, clicking buttons and taking screenshots to self-heal. It is fast, but shipping that as-is is risky. Here is how to capture evidence and draw the approval boundary.
Tips2026-07-01
Don't Let Your Automation Lean on AI Ultra's 5x Ceiling
The $100/month AI Ultra plan raises Antigravity's usage limits to 5x AI Pro. But if you architect automation around that ceiling, it collapses the moment you drop back a tier. Here is a limit-independent degradation design, with the real pain points.
📚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
See all →