Skip to content

Prevent Claude edit stalls from missing reads#39

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-claude-update-read-guard-2026-04-24-11-15
Apr 24, 2026
Merged

Prevent Claude edit stalls from missing reads#39
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-claude-update-read-guard-2026-04-24-11-15

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

Claude Code rejects edits to existing files when the file has not been read in the current session. Surface that rule in the Claude playbook and inject a short UserPromptSubmit reminder only for claude-code sessions so Update/Edit/MultiEdit attempts read their target first instead of stalling mid-task.

Constraint: Claude Code enforces read-before-edit outside Colony, so the fix must guide the agent before it plans edit tools.

Rejected: Treat this as a Colony hook error | the failing message is emitted by Claude Code before PostToolUse can record an edit.

Confidence: high

Scope-risk: narrow

Directive: Keep this reminder Claude-only; do not add it to Codex or other IDE contexts unless their edit tools need the same guard.

Tested: pnpm --filter @colony/hooks test; pnpm --filter @colony/hooks build; pnpm exec biome check CLAUDE.md packages/hooks/src/handlers/user-prompt-submit.ts packages/hooks/test/runner.test.ts .changeset/claude-edit-read-guard.md

Not-tested: pnpm --filter @colony/hooks typecheck is blocked by existing missing declaration for better-sqlite3 in @colony/storage.
@NagyVikt NagyVikt merged commit 1b076d8 into main Apr 24, 2026
@NagyVikt NagyVikt deleted the agent/codex/fix-claude-update-read-guard-2026-04-24-11-15 branch April 24, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant