[BUG] swift-lsp@claude-plugins-official blocks autonomous multi-file refactors with per-edit compilation validation
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The swift-lsp@claude-plugins-official plugin blocks autonomous operation during multi-file refactors. It validates Swift compilation after every individual file edit and halts execution when it detects unresolved type references β even though intermediate broken states are expected and normal during refactors that span multiple files. This happens even with --dangerously-skip-permissions flag or defaultMode: "dontAsk" setting enabled.
What Should Happen?
In autonomous/don't-ask mode, the plugin should either defer validation until the task completes, warn but continue rather than blocking, or recognize multi-file refactor patterns and suppress intermediate validation. Users who explicitly opt into autonomous mode should not have execution halted by per-edit compilation checks.
Error Messages/Logs
PostToolUse:Edit hook stopped continuation: The file contains multiple unresolved type references (GameState, DifficultyLevel, UserMessage, PersistedLevelStats) that are missing from scope. These compilation errors must be resolved before the edit can be considered valid.
Steps to Reproduce
- Enable swift-lsp@claude-plugins-official in ~/.claude/settings.json
- Launch Claude Code with --dangerously-skip-permissions (or set defaultMode: "dontAsk")
- Open a Swift project with a property used across multiple files
- Ask Claude to rename that property across the codebase
- Claude edits the first file, plugin validates, sees unresolved references in files not yet updated, and halts execution
- Session stalls waiting for user input despite autonomous mode being enabled
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.1
Claude Code Version
2.1.2 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- Claude Code version: 2.1.2
- macOS, Xcode project with SwiftUI
- When Claude code gets stuck just instruct it to "continue. ignore the hook for now". I suspect any prompt will restart Claude code and nudge it to continue.
- Suggested fix: Add a config option for batch validation at task completion rather than per-edit, or have the plugin respect autonomous mode by logging warnings without blocking
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/11807
- https://github.com/anthropics/claude-code/issues/12445
- https://github.com/anthropics/claude-code/issues/16950
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and π the existing issue instead
- To prevent auto-closure, add a comment or π this comment
π€ Generated with Claude Code
This issue is potentially difference from the 3 possible duplicate issues because it is related to the swift-lsp@claude-plugins-official plugin. Further investigation is required to narrow the conditions that trigger the bug.
Had a conversation with Claude today where I asked it to disable the hook. This was the result after it removed the hook settings from its local file:
βΊ The hook is already removed! That was its "last gasp" - it triggered one final time on the very edit that deleted it.
Let me verify it's gone:
βΊ Read(.claude/settings.local.json) βΏ Β Read 40 lines
βΊ Done! The hooks section is completely removed. No more interruptions.
β Insight βββββββββββββββββββββββββββββββββββββ The hook was a prompt-based PostToolUse hook that ran after every Edit/Write operation. While useful for catching anti-patterns, it was too aggressive for intentional styling choices like Color.black.opacity(0.3). If you ever want it back (with modifications), you can re-add the hooks section to .claude/settings.local.json. βββββββββββββββββββββββββββββββββββββββββββββββββ
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Closing for now β inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.