Zed context and rules
Zed context on every assistant turn includes project rules, explicit @ attachments, active file focus, and full thread history. Input bloat here dominates spend more than prompt wording.
Hub: Tokenminning in Zed.
Rules files
Project rules inject when configured:
- One concern per rules file; keep them short
- Reference configs by path — do not paste entire style guides
- Do not duplicate instructions in rules, README, and chat custom instructions
Same hygiene as Prompt hygiene — static blocks should be stable if your provider offers prefix caching.
@ attachments
Use precise references instead of pasting files:
| Pattern | When |
|---|---|
@file / symbol | Single-file or function-scoped fixes |
| Broad directory dump | Avoid — inflates every follow-up |
Close unrelated buffers before agent work so “active file” context stays lean.
Prefer: Fix ONLY auth/login.ts line 42 over review the frontend.
New thread per task
Start a new assistant thread when:
- You finish one task and start another
- You switch model tiers
- Follow-ups feel slow or expensive
Every message resends prior context — marathon threads are the main hidden cost.
Troubleshooting
| Symptom | Fix |
|---|---|
| High input | Trim rules; narrow @ scope |
| Irrelevant context | New thread; fewer open files |
| Local model too weak | Cloud mid-tier for commits — Local models |
Related
Last updated on