Additional instructions for AGENTS.md focusing on token optimization A developer introduced a set of guidelines for an AI agent's AGENTS.md file to optimize token usage. The instructions prioritize using a pre-computed AST knowledge graph (graph.json) and the rtk CLI proxy to reduce token consumption by 60-90%. The workflow emphasizes retrieving minimal information, using ast-grep for code searches, and avoiding full directory reads. Always retrieve the smallest amount of information necessary. Escalate only when necessary. Stop escalating as soon as sufficient information has been obtained. Preferred order: - Need code structure? graph.json . - Need symbols? ast-grep . - Need repository metadata? rtk . - Need implementation? Source files. - Use repository-wide search as last resort Avoid reading entire directories or the whole repository unless explicitly requested. rtk is a CLI proxy that filters and compresses command outputs, saving 60-90% tokens. Use rtk whenever possible because it preserves the relevant information while reducing LLM token consumption. Always prefix shell commands with rtk : Instead of: Use: ls -la rtk ls -la git status rtk git status git log -10 rtk git log -10 docker ps rtk docker ps Other examples where you can use rtk : Other examples where you can use rtk : rtk tree rtk read rtk cat rtk git diff rtk diff rtk npm run test rtk curl