Extract and organize text from Windows 11 Notepad tabs using AI
Project description
notepad-cleanup
Extract and organize text from all open Windows 11 Notepad tabs using AI-powered categorization.
What It Does
Windows 11 Notepad supports multiple tabs, making it easy to accumulate dozens of text snippets, code fragments, notes, and temporary data across multiple windows. notepad-cleanup extracts all that text in one command and organizes it into categorized folders using Claude Code CLI.
Two-phase extraction:
- Phase 1 (silent): Extracts loaded tabs via
WM_GETTEXTwithout stealing focus - Phase 2 (announced): Switches through unloaded tabs using UI Automation to capture everything
AI organization:
- Reads extracted files using Claude Code CLI
- Categorizes by content type (code, notes, configs, etc.)
- Renames files descriptively based on actual content
- Creates organized folder structure automatically
Features
- Silent extraction — No focus stealing for already-loaded tabs
- Two-phase capture — Gets all tabs including unloaded ones via UIA tab switching
- AI-powered organization — Claude Code CLI reads and categorizes your content
- Cross-session deduplication — Compare new extractions against historical sessions to find exact and near-duplicate files. See docs/fuzzy-matching.md
- Filesystem linking — Replace duplicates with hardlinks, symlinks, or DazzleLink descriptors
- Configuration system — Unified folder registry with
...notation, MRU history, persistent settings. See docs/config.md - CLI interface — Commands:
extract,compare,organize,diff,config,run - Manifest tracking — JSON metadata about every extracted file
- Windows 11 native — Built for the new Notepad with RichEditD2DPT controls
Requirements
- Windows 11 (uses Windows 11 Notepad tab features)
- Python 3.10+
- Claude Code CLI (optional, for organize step)
Installation
Using pip
pip install notepad-cleanup
Using venv (recommended)
# Create virtual environment
python -m venv venv
venv\Scripts\activate
# Install
pip install notepad-cleanup
# Or install from source
git clone https://github.com/DazzleTools/notepad-cleanup.git
cd notepad-cleanup
pip install -e .
Claude Code CLI (optional)
The organize step requires Claude Code CLI for AI categorization:
# Install from https://claude.ai/claude-code
# Verify installation
claude --version
Usage
Typical workflow
# 1. Extract all Notepad tabs
notepad-cleanup extract
# 2. Compare against previous sessions to find duplicates
notepad-cleanup compare --last
# 3. Spot-check matches in your diff tool
notepad-cleanup diff --last
# 4. Link duplicates (hardlink/symlink/dazzlelink)
notepad-cleanup compare --last --link auto
# 5. Organize new files with AI
notepad-cleanup organize --last
First-time setup
# Register your folders
notepad-cleanup config add "C:\Users\YourName\Desktop\Notepad Organize"
notepad-cleanup config set search "...1"
notepad-cleanup config set diff_tool bcomp
After setup, --last and saved search dirs make the workflow short:
notepad-cleanup extract
notepad-cleanup compare --last --link auto
notepad-cleanup organize --last
Extract
notepad-cleanup extract # Extract to default output folder (...)
notepad-cleanup extract -o ./my-backup # Custom output directory
notepad-cleanup extract --silent-only # Skip unloaded tabs (no focus stealing)
notepad-cleanup extract --dry-run # Preview without saving
Compare
notepad-cleanup compare --last # Use last extraction + saved search dirs
notepad-cleanup compare --last --no-fuzzy # Exact matches only (fast)
notepad-cleanup compare --last --link auto # Compare and link duplicates
notepad-cleanup compare "...-2" # Compare a specific past extraction
notepad-cleanup compare --last -s "D:\archive" # Search only this directory
notepad-cleanup compare --last -ss "D:\archive" # Search this + saved dirs
See docs/fuzzy-matching.md for details on near-duplicate detection.
Organize with AI
notepad-cleanup organize --last # Organize most recent extraction
notepad-cleanup organize --last --verbose # Stream Claude output in real-time
notepad-cleanup organize --last --dry-run # Preview without executing
Configuration
notepad-cleanup config show # Show all settings
notepad-cleanup config show ... # Resolve a ... reference
notepad-cleanup config add "C:\path" # Register a folder
notepad-cleanup config set search "...1" # Add folder to search list
notepad-cleanup config set diff_tool bcomp # Set diff tool
See docs/config.md for the full configuration reference including ... notation.
One-command workflow
notepad-cleanup run # Extract + organize
notepad-cleanup run --verbose # With real-time Claude output
Options:
--output-dir PATH— Custom output directory--yes— Skip confirmations--verbose— Stream Claude output
How It Works
Phase 1: Silent Extraction
Uses WM_GETTEXT message to read text from RichEditD2DPT child windows. This is completely silent and invisible — no focus changes, no window activation, no disruption to your workflow.
Limitation: Only works for tabs that have been loaded (visited) at least once in the current Notepad session. Unloaded tabs have no RichEditD2DPT control yet, so they cannot be read silently.
Phase 2: Tab Switching (Announced)
For unloaded tabs, uses UI Automation (TabItem.Select()) to activate each tab, which forces Windows to load the RichEditD2DPT control. Once loaded, the same WM_GETTEXT method reads the content.
Warning: This steals focus and activates Notepad windows. The tool warns you before Phase 2 starts and waits for confirmation. Do not type or click during Phase 2.
Organization with AI
After extraction, Claude Code CLI:
- Reads
manifest.jsonto understand the collection - Reads each extracted file to determine content type
- Returns a JSON plan with categories and renamed filenames
- The tool executes the plan locally (copy files to organized folders)
Categories might include:
code-snippets— Python, JavaScript, batch scripts, PowerShell, etc.config-files— INI, YAML, JSON configspersonal-notes— Short reminders, quick notesproject-planning— Design docs, task listsreference— Documentation, links, resourcesmisc— Everything else
Output Structure
notepad-cleanup-2026-02-14__00-15-30/
├── manifest.json # Metadata about all extracted files
├── window01/
│ ├── tab01.txt # Original extracted files
│ ├── tab02.txt
│ └── tab03.txt
├── window02/
│ └── tab01.txt
├── organized/ # AI-organized output (after organize step)
│ ├── code-snippets/
│ │ ├── process-data.py
│ │ └── batch-rename.bat
│ ├── personal-notes/
│ │ └── grocery-list.txt
│ └── _summary.md # Organization summary
├── _organize_prompt.md # AI prompt used
└── _organize_log.txt # Claude CLI output
Development
Setup
git clone https://github.com/DazzleTools/notepad-cleanup.git
cd notepad-cleanup
python -m venv venv
venv\Scripts\activate
pip install -e .
Testing
Manual testing recommended (this tool manipulates real Notepad windows):
- Open multiple Notepad windows with various tabs
- Include empty tabs, large tabs, code snippets, notes
- Run
notepad-cleanup extract --verbose - Verify accuracy of extracted content
- Run
notepad-cleanup organizeon output - Check organized folder structure
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
License
notepad-cleanup, Copyright (C) 2026 Dustin Darcy. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation.
See LICENSE for full details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notepad_cleanup-0.2.1.tar.gz.
File metadata
- Download URL: notepad_cleanup-0.2.1.tar.gz
- Upload date:
- Size: 58.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97642041c87ea99ecb3be7ddc545c130d8951e113501d56e19eb3ef6e5cc309a
|
|
| MD5 |
6ac991b152aa8b96cdc23acf012f29ab
|
|
| BLAKE2b-256 |
1f211db8f08aa9a9c736a8bd2fba30a6cb2507bc1fa0f92ef89176af4f44df0c
|
Provenance
The following attestation bundles were made for notepad_cleanup-0.2.1.tar.gz:
Publisher:
publish.yml on DazzleTools/notepad-cleanup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notepad_cleanup-0.2.1.tar.gz -
Subject digest:
97642041c87ea99ecb3be7ddc545c130d8951e113501d56e19eb3ef6e5cc309a - Sigstore transparency entry: 1109788039
- Sigstore integration time:
-
Permalink:
DazzleTools/notepad-cleanup@2ecc05d161b5b6b2ff8708f01c8c36a23936dcb9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/DazzleTools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ecc05d161b5b6b2ff8708f01c8c36a23936dcb9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file notepad_cleanup-0.2.1-py3-none-any.whl.
File metadata
- Download URL: notepad_cleanup-0.2.1-py3-none-any.whl
- Upload date:
- Size: 58.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da003e6b57c20058d32d95674df520be6de17a452403395a887abd57884e4fdc
|
|
| MD5 |
6baf18392a9f87f86b0de8f3c0168ae0
|
|
| BLAKE2b-256 |
a5e60d9ead12b271cec887a70c521ff3c989bfec710f77f9676730f12e77a517
|
Provenance
The following attestation bundles were made for notepad_cleanup-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on DazzleTools/notepad-cleanup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notepad_cleanup-0.2.1-py3-none-any.whl -
Subject digest:
da003e6b57c20058d32d95674df520be6de17a452403395a887abd57884e4fdc - Sigstore transparency entry: 1109788042
- Sigstore integration time:
-
Permalink:
DazzleTools/notepad-cleanup@2ecc05d161b5b6b2ff8708f01c8c36a23936dcb9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/DazzleTools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ecc05d161b5b6b2ff8708f01c8c36a23936dcb9 -
Trigger Event:
release
-
Statement type: