claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] swift-lsp@claude-plugins-official blocks autonomous multi-file refactors with per-edit compilation validation

Open jpavley opened this issue 10 months ago β€’ 3 comments

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

  1. Enable swift-lsp@claude-plugins-official in ~/.claude/settings.json
  2. Launch Claude Code with --dangerously-skip-permissions (or set defaultMode: "dontAsk")
  3. Open a Swift project with a property used across multiple files
  4. Ask Claude to rename that property across the codebase
  5. Claude edits the first file, plugin validates, sees unresolved references in files not yet updated, and halts execution
  6. 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

jpavley avatar Jan 09 '26 18:01 jpavley

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11807
  2. https://github.com/anthropics/claude-code/issues/12445
  3. 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

github-actions[bot] avatar Jan 09 '26 19:01 github-actions[bot]

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.

jpavley avatar Jan 10 '26 04:01 jpavley

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. ─────────────────────────────────────────────────

jpavley avatar Jan 10 '26 23:01 jpavley

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.

github-actions[bot] avatar Feb 10 '26 10:02 github-actions[bot]

Closing for now β€” inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Feb 24 '26 22:02 github-actions[bot]

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.

github-actions[bot] avatar Mar 04 '26 14:03 github-actions[bot]