Discourage AI from using write-text-file for .gts files#64
Conversation
Tool calls like write-text-file don't stream — the entire payload must generate before the user sees anything, making the UI appear frozen on "Thinking" / "Preparing tool call". SEARCH/REPLACE blocks stream as visible text so users see real-time progress. Updated skill instructions across 4 files to enforce: always use SEARCH/REPLACE for .gts, write-text-file is OK for .json instances only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🔍 Workspace Sync Dry-Run Complete✅ Dry-run completed successfully - no changes were made Dry-Run Results |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🔍 Workspace Sync Dry-Run Complete✅ Dry-run completed successfully - no changes were made Dry-Run Results |
backspace
left a comment
There was a problem hiding this comment.
I’m surprised that search/replace is something to use even for new files, the name suggests otherwise to me.
Agree, not the most intuitive naming but that's how our mechanism for streaming code for new files works - the search portion is empty in this case |
Summary
Sometimes it happens that AI uses
write-text-fileto create.gtsfiles. Tool calls don't stream — the entire file content must generate before the user sees anything. This makes the UI show "Thinking" / "Preparing tool call" for a long time, appearing frozen. SEARCH/REPLACE blocks stream as visible text so users see real-time progress.Updated 3 skill files to enforce: always use SEARCH/REPLACE for .gts files, write-text-file is OK for .json instances only.
What changed (human-readable)
Skill/env-creating-and-editing-cards.mdCreating Cards table — reordered and reworded:
write-text-filewas listed first for "New card from scratch",SEARCH/REPLACEwas last for "New .gts definitions or JSON via code mode"SEARCH/REPLACEis first for "Always use for .gts files",write-text-fileis for "New .json card instances from scratch" onlyQuick Decision tree:
From scratch → write-text-fileNew .gts file → SEARCH/REPLACE with (new) marker (ALWAYS — never write-text-file for .gts)andNew .json instance → write-text-fileSkill/boxel-environment.json(frontMatter)New streaming rule added after STEP 4 (DATA TASK):
Command reference for
write-text-file_e5a1:Fallback only (after failed SEARCH/REPLACE)OK for .json instances. NEVER use for .gts files — tool calls don't stream, causing the UI to appear frozen. Always use SEARCH/REPLACE for .gts.Skill/source-code-editing.mdOpening paragraph:
...you must use a SEARCH/REPLACE block....you must use a SEARCH/REPLACE block. For .gts files, ALWAYS use SEARCH/REPLACE — never use write-text-file for .gts. SEARCH/REPLACE blocks stream as visible text (the user sees progress), while tool calls like write-text-file do NOT stream (the UI appears frozen with "Thinking" / "Preparing tool call" while generating the full file content).Test plan
🤖 Generated with Claude Code