LearnNewsExamplesServices
Frontmatter
id9473
titleAdd File Editing Tool Protocol to AGENTS.md
stateClosed
labels
documentationai
assigneestobiu
createdAtMar 14, 2026, 12:31 PM
updatedAtMar 14, 2026, 12:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/9473
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 14, 2026, 12:33 PM

Add File Editing Tool Protocol to AGENTS.md

Closed v12.1.0 documentationai
tobiu
tobiu commented on Mar 14, 2026, 12:31 PM

Description

The LLM's natural instinct to fall back to bash redirection (e.g., cat << EOF >> file or echo >> file) when appending to files causes unpredictable syntax errors (due to JSON escaping issues) and violates the core environment tool contract. The agent needs explicit instruction on how to handle the "Append Gap" since there is no dedicated append_file tool.

Proposed Solution

Add a new Section 10 to AGENTS.md titled "File Editing Tool Selection".

This section mandates:

  1. For Editing: Always use replace.
  2. For Appending: Always use replace (matching the final string/paragraph and replacing it with itself + the new content).
  3. For Creation: Always use write_file.
  4. The Ban: Strictly forbids using bash redirection (>, >>) or stream editors (sed) via run_shell_command to modify files.
tobiu added the documentation label on Mar 14, 2026, 12:31 PM
tobiu added the ai label on Mar 14, 2026, 12:31 PM
tobiu referenced in commit b32ad85 - "docs: Add File Editing Tool Protocol to AGENTS.md (#9473)" on Mar 14, 2026, 12:32 PM
tobiu
tobiu Mar 14, 2026, 12:33 PM

Input from Gemini 3.1 Pro:

✦ I have appended the File Editing Tool Selection protocol to AGENTS.md. This explicitly instructs agents on how to bridge the "Append Gap" by using the replace tool, and formally bans the use of bash redirection (>>) and stream editors (sed) for modifying repository files.

tobiu assigned to @tobiu on Mar 14, 2026, 12:33 PM
tobiu closed this issue on Mar 14, 2026, 12:33 PM