[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77818":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":10,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":14,"starSnapshotCount":14,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},77818,"agents-md","Austin1serb\u002Fagents-md","Austin1serb","AGENTS.md patterns for context engineering in coding agents: safer command output, token efficiency, validation, and prompt-injection resistance.","",null,126,10,1,0,3,4,14,9,3.12,false,"main",true,[24,25,26,27,28],"agent-prompts","agents-skills","coding-prompts","prompt-engineering","token-usage","2026-06-12 02:03:44","# AGENTS.md Patterns for Context Engineering in Coding Agents\n\nPractical `AGENTS.md` and Codex prompt patterns for coding agents that need better context discipline, safer command output, and lower token usage.\n\nThis repo is for Software Engineers using Codex, Claude Code, Cursor, Windsurf, GitHub Copilot, or custom AI coding agents who want agents to get the most from their agent harness.\n\n> [!NOTE]\n> There will be more to come. Follow or watch to get updates.\n\n## What's In This Repo:\n\n| Resource | Purpose |\n|---|---|\n| [AGENTS.md instructions for coding agents](.\u002FAGENTS.md) | Optimized coding-agent instructions for context discipline, and better responses. |\n| [Coding-optimized system prompt](.\u002Fcodex-optimized-prompt.md) | A practical Codex prompt more focued on coding. |\n| [How to change Codex system prompt](.\u002Fchange-codex-system-prompt.md) | Instructions for replacing Codex system prompt, including subagent instruction files. |\n| [OpenAI Codex GPT-5.5 base system prompt](.\u002Fcodex-GPT-5.5-system-prompt.md) | OpenAI's base Codex GPT-5.5 system prompt, which is more general-purpose than the coding-optimized prompt. |\n\n## Biggest Current Win: Byte-capped command output\n\nA common coding-agent failure mode is pulling thousands of irrelevant lines into context while researching a task.\n\nLine limits like `head -n 20`, help sometimes, but they are not safe. One huge line can still flood the context window, reducing the output quality and increasing token usage.\n\nUse byte caps for unknown or potentially large command output:\n\n```bash\nCOMMAND 2>&1 | head -c 4000\n```\n\nFor logs, test failures, or recent output:\n\n```bash\nCOMMAND 2>&1 | tail -c 4000\n```\n\nsee: [AGENTS.md](https:\u002F\u002Fgithub.com\u002FAustin1serb\u002Fagents-md\u002Fblob\u002Fmain\u002FAGENTS.md#command-output) - Command Output\n\nIn my own Codex workflows, this single `AGENTS.md` rule reduced average token usage by roughly 50% across comparable tasks.\n\n## Why Context Discipline Matters\n\nCoding agents are great at writing shell commands, but often consume much more information than necessary to complete a task. For example, you might have a file that contains many utility functions, you might ask the agent to find a specific function and explain it. The agent might read the entire file, when it only needed to read a few lines to find the function definition. This can lead to degraded responses, higher token usage, and more irrelevant information in context.\n\n## How to Use AGENTS.md\n\nCopy [`AGENTS.md`](.\u002FAGENTS.md) into the root of any repo that supports agent instruction files. To use in all repos, add it to the root of `\u002F.codex`\n\nFor Codex, this repo also includes [`codex-optimized-prompt.md`](.\u002Fcodex-optimized-prompt.md), which I use as a coding-optimized system prompt.\n\nTo use it as your default Codex instruction file, download the file, and add this to your `.codex\u002Fconfig.toml`:\n\n```toml\nmodel_instructions_file = \"path\u002Fto\u002Fcodex-optimized-prompt.md\"\n```\n\nYou can also set different instruction files for different Codex profiles or subagents.\n\nBuilt by [Austin Serb](https:\u002F\u002Faustinserb.com).\n","该项目提供了一套用于编程代理的AGENTS.md模式，旨在优化上下文处理、确保命令输出安全、提高令牌使用效率以及增强对提示注入攻击的抵抗力。其核心功能包括字节限制的命令输出控制方法，以避免大量无关信息被拉入上下文，从而显著降低了平均令牌消耗并提升了响应质量。此外，项目还提供了针对Codex等AI编码助手优化过的系统提示设置指南。适合场景为软件工程师在使用如Codex、GitHub Copilot等AI辅助工具时，希望提升这些工具的理解能力与执行效率，同时减少不必要的资源开销。",2,"2026-06-11 03:56:05","CREATED_QUERY"]