Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,21 @@ It is a small script to remove junk files from our windows operating system such
6 - Configure any additional options you want for the task, such as conditions and advanced settings.

7 - Click "OK" to save the scheduled task.

## Claude wrapper fix (Windows)

If `prompt-engineer` exits with code `0` but prints no response, apply this wrapper fix:

1 - Use a Windows launcher (`prompt-engineer.cmd`) that calls Node:
`node "%~dp0prompt-engineer.js" %*`

2 - In `prompt-engineer.js`, resolve the agent file path with `path.resolve(...)` instead of a hardcoded escaped string path.

3 - Invoke Claude with argument arrays and a direct Windows binary path (for example `...\\@anthropic-ai\\claude-code\\bin\\claude.exe`) to avoid shell escaping and command-length issues.

4 - Forward captured stdout/stderr back to the terminal so the agent response is visible.

Quick verification:

- `prompt-engineer "Return exactly: WRAPPER_OK"`
- Expected stdout: `WRAPPER_OK`
2 changes: 0 additions & 2 deletions cleanerOS.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@echo off

cd C:\Users\YourUser\Documents\CleanerOS

python cleanerOS.py

pause
2 changes: 1 addition & 1 deletion cleanerOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def progress_bar(total, progress):
directoriesToOptimize = [
r"C:\Windows\Logs",
r"C:\Windows\Temp",
r"C:\Users\YourUser\AppData\Local\Temp"
r"C:\Users\Diego Chavez\AppData\Local\Temp"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep temp directory path user-agnostic

Replacing the generic user temp path with C:\Users\Diego Chavez\AppData\Local\Temp makes the default cleanup list machine-specific. On any Windows install where the username is not exactly Diego Chavez, this directory does not exist and optimizeStorage skips that target, so one of the three primary cleanup locations is silently not cleaned for most users.

Useful? React with 👍 / 👎.

]

# Ejecución
Expand Down
43 changes: 43 additions & 0 deletions cleanup_temp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import os
import sys
from pathlib import Path

def cleanup_directory(directory):
"""Elimina archivos temporales de un directorio."""
deleted_count = 0
error_count = 0
total_size = 0

# Verificar si el directorio existe
if not os.path.exists(directory):
print(f"ERROR|{directory}|Directory not found|0|0")
return

# Recorrer todos los archivos recursivamente
for root, dirs, files in os.walk(directory):
for filename in files:
filepath = os.path.join(root, filename)
try:
# Obtener tamaño del archivo
file_size = os.path.getsize(filepath)
total_size += file_size

# Eliminar archivo
os.remove(filepath)
deleted_count += 1

except (PermissionError, OSError, FileNotFoundError) as e:
error_count += 1

# Convertir tamaño a MB
size_mb = round(total_size / (1024 * 1024), 2)

print(f"SUCCESS|{directory}|{deleted_count}|{error_count}|{size_mb}")

if __name__ == "__main__":
if len(sys.argv) != 2:
print("ERROR|No directory provided|Usage: python cleanup.py <directory>|0|0")
sys.exit(1)

directory = sys.argv[1]
cleanup_directory(directory)