34 lines
1.6 KiB
Markdown
34 lines
1.6 KiB
Markdown
# Context & Token Management Rules
|
|
|
|
## File Access — Read Only What's Needed
|
|
- NEVER load or scan the entire project at the start of a task
|
|
- Only read files that are directly relevant to the current request
|
|
- If you need to understand the project structure, use `list_files` on specific
|
|
subdirectories — do NOT recurse the whole repo
|
|
- If you've already read a file in this session, do NOT read it again — use
|
|
your memory of it
|
|
|
|
## Thinking — Stay Focused, Don't Over-Plan
|
|
- Do not brainstorm more than 3 approaches before picking one
|
|
- Do not re-analyze a problem you already analyzed earlier in the session
|
|
- If a task is simple (under 5 steps), start doing it — don't write a plan first
|
|
- Maximum 2 rounds of self-correction before asking the user for help
|
|
- If you are stuck, STOP and ask — do not keep retrying and do not say it's okay and move on
|
|
|
|
## Context Window — Proactive Handoff
|
|
- Monitor context window usage (visible in environment_details)
|
|
- If context usage exceeds 40%, warn the user: "Context is at X%, consider
|
|
starting a new task soon"
|
|
- If context usage exceeds 60%, STOP the current task and use the `new_task`
|
|
tool to propose a clean handoff with a summary of:
|
|
- What was accomplished
|
|
- What files were changed
|
|
- What the next step is
|
|
- Never let the context exceed 70% — performance degrades past that point
|
|
|
|
## Response Style — Be Concise
|
|
- Do not repeat what you just did at the end of each step
|
|
- Do not summarize the whole conversation when answering a short question
|
|
- Status updates should be one sentence max
|
|
- Do not explain what you're about to do AND then do it — just do it
|