Shell functions with autoload break command execution - make function definition file not found
Description
When using Claude Code with zsh shell, certain commands like make fail with an error because Claude Code creates shell snapshots containing broken function definitions.
Error Message
(eval):1: make: function definition file not found
Root Cause
Claude Code creates shell snapshots in /tmp/{username}/claude-shell-snapshot-* that contain broken function definitions. Specifically, the make command is defined as:
make () {
# undefined
builtin autoload -XUz
}
This function definition is invalid and causes the error. The function cannot be properly removed because it's reloaded from the snapshot.
Steps to Reproduce
- Use Claude Code with zsh shell (with zprezto in this case)
- Try to run
makecommand - Observe the error:
(eval):1: make: function definition file not found
Additional Information
- The issue persists even after trying to unfunction or unset the command
- Creating aliases doesn't override the function
- The snapshot file shows the function was marked as
# undefinedwhen captured
Workaround
Use command make or /usr/bin/make to bypass the shell function.
Environment
- Shell: zsh with zprezto
- OS: Linux (Arch)
- Claude Code version: Latest as of June 9, 2025
Expected Behavior
Shell commands should work normally without function definition errors. Claude Code should either:
- Not capture undefined/broken functions in snapshots, or
- Handle autoload functions properly when creating snapshots
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.
The issue is still occurring