Claude-skill-registry HLS Troubleshooting
This skill should be used when the user mentions "HLS not working", "haskell-language-server issues", "Haskell LSP problems", "no completions in Haskell", "HLS diagnostics not showing", "troubleshoot HLS", "Haskell code analysis not working", or asks why HLS features aren't available in Claude Code.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/hls-troubleshooting" ~/.claude/skills/majiayu000-claude-skill-registry-hls-troubleshooting && rm -rf "$T"
skills/data/hls-troubleshooting/SKILL.mdHLS Troubleshooting Guide
This skill provides guidance for diagnosing and resolving Haskell Language Server (HLS) issues in Claude Code.
Overview
HLS provides LSP features for Haskell development: diagnostics, go-to-definition, completions, hover info, and code actions. When HLS isn't working, these features become unavailable for
.hs and .lhs files.
Quick Check
Before troubleshooting, run the status command to identify the problem:
/hls:status
This performs three checks: PATH availability, version info, and startup test.
Progressive Troubleshooting
Diagnose issues from simple to complex. Most problems fall into one of three levels.
Level 1: HLS Not Found in PATH
Symptoms:
reports PATH check failed/hls:status- "command not found" errors
- No LSP features available
Diagnosis:
Check if HLS is installed:
which haskell-language-server-wrapper
Common Fixes:
-
Install via GHCup (recommended):
ghcup install hls -
Add GHCup to PATH - Add to shell config (
,.bashrc
):.zshrcexport PATH="$HOME/.ghcup/bin:$PATH" -
Verify installation location - Check common paths:
~/.ghcup/bin/haskell-language-server-wrapper~/.local/bin/haskell-language-server-wrapper~/.cabal/bin/haskell-language-server-wrapper
-
Restart Claude Code after PATH changes
Level 2: HLS Started But Unresponsive
Symptoms:
PATH check passes but startup test fails/hls:status- HLS process visible but no LSP responses
- Long delays before features appear
Diagnosis:
Check if HLS process is running:
ps aux | grep haskell-language-server
Check system resources:
# Memory usage free -h # CPU usage top -b -n 1 | head -20
Common Fixes:
-
Wait for initial indexing - HLS may take several minutes on first load for large projects
-
Check GHC version compatibility - HLS version must match project's GHC:
haskell-language-server-wrapper --version ghc --versionConsult
for the GHC version support matrix.references/hls-docs.xml -
Kill stuck processes:
pkill -f haskell-language-server -
Check available memory - HLS requires significant RAM for large projects. Consider:
- Closing other applications
- Increasing swap space
- Using a smaller project subset
-
Review HLS logs - Enable debug logging:
claude --enable-lsp-loggingLogs written to
~/.claude/debug/
Level 3: HLS Running But LSP Commands Failing
Symptoms:
all checks pass/hls:status- Some features work but others don't
- Intermittent errors or partial responses
Diagnosis:
Test specific LSP features manually. Check project configuration:
# Look for hie.yaml ls -la hie.yaml # Check cabal/stack files ls -la *.cabal cabal.project stack.yaml 2>/dev/null
Common Fixes:
-
Verify project builds - HLS requires a buildable project:
cabal build # or stack buildFix any compilation errors first.
-
Check hie.yaml configuration - For multi-component projects, HLS needs to know which component each file belongs to. Generate implicit config:
gen-hie > hie.yamlSee
for hie.yaml configuration details.references/hls-docs.xml -
Cradle errors - If HLS reports cradle loading failures:
- Ensure
orcabal.project
exists at project rootstack.yaml - Run
to refresh package indexcabal update - Check for syntax errors in cabal files
- Ensure
-
Enable verbose logging for detailed diagnostics:
claude --enable-lsp-loggingCheck
for HLS communication logs.~/.claude/debug/ -
Plugin-specific issues - Some HLS plugins may fail independently. Consult
for plugin configuration.references/hls-docs.xml
Platform-Specific Notes
Windows
- Use
instead ofwhere
for PATH checkswhich - PATH separator is
not;: - Common install location:
%APPDATA%\ghcup\bin
macOS
- GHCup installs to
~/.ghcup/bin - May need to allow in System Preferences > Security if blocked
Linux
- GHCup installs to
~/.ghcup/bin - Ensure glibc compatibility for prebuilt binaries
When to Consult Reference Documentation
For detailed information beyond this troubleshooting guide:
- HLS configuration and features: See
references/hls-docs.xml - GHC version issues and compiler errors: See
references/ghc-user.xml - Cabal project setup and build issues: See
references/cabal-docs.xml
These references contain comprehensive documentation for complex issues not covered here.
Summary Checklist
When HLS isn't working:
- Run
for quick diagnosis/hls:status - Level 1: Check PATH and installation
- Level 2: Check process state and resources
- Level 3: Check project configuration and builds
- Enable
for detailed debugging--enable-lsp-logging - Consult reference docs for complex issues