Files
claudetools/docs/archives/offline-mode-removed/INVISIBLE_PERIODIC_SAVE_SUMMARY.md
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00

5.6 KiB

Periodic Save Task - Invisible Mode Setup

Problem Solved

The periodic_save_check.py Task Scheduler task was showing a flashing console window every minute. This has been fixed by configuring the task to run completely invisibly.


What Changed

1. Updated Setup Script

File: D:\ClaudeTools\.claude\hooks\setup_periodic_save.ps1

Changes:

  • Uses pythonw.exe instead of python.exe (no console window)
  • Added -Hidden flag to task settings
  • Changed LogonType from Interactive to S4U (Service-For-User = background)
  • Added verification instructions in output

2. Created Update Script

File: D:\ClaudeTools\.claude\hooks\update_to_invisible.ps1

Purpose:

  • Quick one-command update for existing tasks
  • Preserves existing triggers and settings
  • Validates pythonw.exe exists
  • Shows verification output

3. Created Documentation

File: D:\ClaudeTools\.claude\PERIODIC_SAVE_INVISIBLE_SETUP.md

Contents:

  • Automatic setup instructions
  • Manual update procedures (PowerShell and GUI)
  • Verification steps
  • Troubleshooting guide

How to Fix Your Current Task

Run the update script:

# From PowerShell in D:\ClaudeTools
.\.claude\hooks\update_to_invisible.ps1

This will:

  • Find pythonw.exe automatically
  • Update the task to use pythonw.exe
  • Set the task to run hidden
  • Verify all settings are correct

Option 2: Recreate Task

Re-run the setup script (removes old task and creates new one):

# From PowerShell in D:\ClaudeTools
.\.claude\hooks\setup_periodic_save.ps1

Option 3: Manual (GUI)

  1. Open Task Scheduler (Win + R → taskschd.msc)
  2. Find "ClaudeTools - Periodic Context Save"
  3. Right-click → Properties
  4. Actions tab: Change python.exe to pythonw.exe
  5. General tab: Check "Hidden" checkbox
  6. Click OK

Verification

After updating, verify the task is configured correctly:

# Quick verification
Get-ScheduledTask -TaskName "ClaudeTools - Periodic Context Save" |
    Select-Object -ExpandProperty Actions |
    Select-Object Execute

# Should show: ...pythonw.exe (NOT python.exe)

# Check hidden setting
Get-ScheduledTask -TaskName "ClaudeTools - Periodic Context Save" |
    Select-Object -ExpandProperty Settings |
    Select-Object Hidden

# Should show: Hidden: True

Technical Details

pythonw.exe vs python.exe

Executable Console Window Use Case
python.exe Shows console Interactive scripts, debugging
pythonw.exe No console Background tasks, GUI apps

Task Scheduler Settings

Setting Old Value New Value Purpose
Executable python.exe pythonw.exe No console window
Hidden False True Hide from task list
LogonType Interactive S4U Run in background

What is S4U (Service-For-User)?

  • Runs tasks in background session
  • No interactive window
  • Doesn't require user to be logged in
  • Ideal for background automation

Files Modified/Created

Modified

  • D:\ClaudeTools\.claude\hooks\setup_periodic_save.ps1
    • Lines 9-18: Auto-detect pythonw.exe path
    • Line 29: Use pythonw.exe instead of python.exe
    • Line 43: Added -Hidden flag
    • Line 46: Changed LogonType to S4U
    • Lines 59-64: Updated output messages

Created

  • D:\ClaudeTools\.claude\hooks\update_to_invisible.ps1

    • Quick update script for existing tasks
  • D:\ClaudeTools\.claude\PERIODIC_SAVE_INVISIBLE_SETUP.md

    • Complete setup and troubleshooting guide
  • D:\ClaudeTools\INVISIBLE_PERIODIC_SAVE_SUMMARY.md

    • This file - quick reference summary

Testing

After updating, the task will run every minute but you should see:

  • ✓ No console window flashing
  • ✓ No visible task execution
  • ✓ Logs still being written to D:\ClaudeTools\.claude\periodic-save.log

Check logs to verify it's working:

Get-Content D:\ClaudeTools\.claude\periodic-save.log -Tail 20

You should see log entries appearing every minute (when Claude is active) without any visible window.


Troubleshooting

Still seeing console window?

Check executable:

Get-ScheduledTask -TaskName "ClaudeTools - Periodic Context Save" |
    Select-Object -ExpandProperty Actions
  • If shows python.exe - update didn't work, try manual update
  • If shows pythonw.exe - should be invisible (check hidden setting)

Check hidden setting:

Get-ScheduledTask -TaskName "ClaudeTools - Periodic Context Save" |
    Select-Object -ExpandProperty Settings |
    Select-Object Hidden
  • Should show Hidden: True
  • If False, run update script again

Check LogonType:

Get-ScheduledTask -TaskName "ClaudeTools - Periodic Context Save" |
    Select-Object -ExpandProperty Principal
  • Should show LogonType: S4U
  • If Interactive, run update script again

pythonw.exe not found?

# Check Python installation
Get-Command python | Select-Object -ExpandProperty Source

# Check if pythonw.exe exists in same directory
$PythonPath = (Get-Command python).Source
$PythonDir = Split-Path $PythonPath -Parent
Test-Path (Join-Path $PythonDir "pythonw.exe")

If False, reinstall Python. pythonw.exe should always come with Python on Windows.


Current Status

Task Name: ClaudeTools - Periodic Context Save Frequency: Every 1 minute Action: Check activity, save context every 5 minutes of active work Visibility: Hidden (no console window) Logs: D:\ClaudeTools\.claude\periodic-save.log


Last Updated: 2026-01-17 Updated Files: 1 modified, 3 created