Skip to Content
IDEsZedContext & rules

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:

PatternWhen
@file / symbolSingle-file or function-scoped fixes
Broad directory dumpAvoid — 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

SymptomFix
High inputTrim rules; narrow @ scope
Irrelevant contextNew thread; fewer open files
Local model too weakCloud mid-tier for commits — Local models
Last updated on