Skip to content

Commit f574c0d

Browse files
catlog22claude
andcommitted
feat: Add Codex CLI optimization requirements to AGENTS.md
Add system optimization section with performance and compatibility improvements: - Direct binary execution to avoid shell wrapper overhead - apply_patch tool priority for efficient text editing - Windows UTF-8 encoding configuration for Chinese character support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5b38a63 commit f574c0d

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

.codex/AGENTS.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,30 @@ RULES: Build on previous subtask, maintain consistency
4646

4747
## Execution Requirements
4848

49+
### System Optimization
50+
51+
**Hard Requirement**: Call binaries directly in `functions.shell`, always set `workdir`, and avoid shell wrappers such as `bash -lc`, `sh -lc`, `zsh -lc`, `cmd /c`, `pwsh.exe -NoLogo -NoProfile -Command`, and `powershell.exe -NoLogo -NoProfile -Command`.
52+
53+
**Text Editing Priority**: Use the `apply_patch` tool for all routine text edits; fall back to `sed` for single-line substitutions only if `apply_patch` is unavailable, and avoid `python` editing scripts unless both options fail.
54+
55+
**`apply_patch` Usage**: Invoke `apply_patch` with the patch payload as the second element in the command array (no shell-style flags). Provide `workdir` and, when helpful, a short `justification` alongside the command.
56+
57+
**Example invocation**:
58+
```json
59+
{
60+
"command": ["apply_patch", "*** Begin Patch\n*** Update File: path/to/file\n@@\n- old\n+ new\n*** End Patch\n"],
61+
"workdir": "<workdir>",
62+
"justification": "Brief reason for the change"
63+
}
64+
```
65+
66+
**Windows UTF-8 Encoding**: Before executing commands on Windows systems, ensure proper UTF-8 encoding by running:
67+
```powershell
68+
[Console]::InputEncoding = [Text.UTF8Encoding]::new($false)
69+
[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
70+
chcp 65001 > $null
71+
```
72+
4973
### ALWAYS
5074

5175
- **Parse all fields** - Understand PURPOSE, TASK, MODE, CONTEXT, EXPECTED, RULES
@@ -58,6 +82,9 @@ RULES: Build on previous subtask, maintain consistency
5882
- **Match project style** - Follow existing patterns exactly
5983
- **Validate EXPECTED** - Ensure all deliverables are met
6084
- **Report context** (subtasks) - Summarize key info for next subtask
85+
- **Use direct binary calls** - Avoid shell wrappers for efficiency
86+
- **Prefer apply_patch** - Use for text edits over Python scripts
87+
- **Configure Windows encoding** - Set UTF-8 for Chinese character support
6188

6289
### NEVER
6390

@@ -335,6 +362,10 @@ Subtask 3: Add authentication (resume --last)
335362

336363
---
337364

338-
**Version**: 2.1.0
365+
**Version**: 2.2.0
339366
**Last Updated**: 2025-10-04
340-
**Changes**: Added multi-step task execution support with resume mechanism
367+
**Changes**:
368+
- Added system optimization requirements for direct binary calls
369+
- Added apply_patch tool priority for text editing
370+
- Added Windows UTF-8 encoding configuration for Chinese character support
371+
- Previous: Multi-step task execution support with resume mechanism

0 commit comments

Comments
 (0)