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

Shell functions with autoload break command execution - make function definition file not found

Open LefterisJP opened this issue 10 months ago • 2 comments

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

  1. Use Claude Code with zsh shell (with zprezto in this case)
  2. Try to run make command
  3. 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 # undefined when 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:

  1. Not capture undefined/broken functions in snapshots, or
  2. Handle autoload functions properly when creating snapshots

LefterisJP avatar Jun 09 '25 16:06 LefterisJP

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 Dec 04 '25 10:12 github-actions[bot]

The issue is still occurring

Boelensman1 avatar Dec 04 '25 18:12 Boelensman1