@@ -121,6 +121,14 @@ func (l *lsTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error) {
121121 searchPath = l.workingDir
122122 }
123123
124+ if searchPath == "~" {
125+ homeDir, err := os.UserHomeDir()
126+ if err != nil {
127+ return ToolResponse{}, fmt.Errorf("error resolving home directory: %w", err)
128+ }
129+ searchPath = homeDir
130+ }
131+
124132 if !filepath.IsAbs(searchPath) {
125133 searchPath = filepath.Join(l.workingDir, searchPath)
126134 }