Claude File Organizer is a Python utility designed to streamline the process of copying project files into a single directory for quick uploading to Claude, Anthropic's AI assistant. It automates file selection based on extensions and .gitignore rules, ensuring you share only what you need without the hassle of manual organization.
Claude File Organizer
Enhance your workflow with the Claude File Organizer – a powerful Python utility designed to streamline your file sharing process with Claude, the AI assistant from Anthropic. This tool simplifies the task of copying relevant project files into a specified directory, making it easy to upload them to Claude without the hassle of navigating through multiple folders.
Key Features
- Selective File Copying: Automatically copy files based on defined file extensions and .gitignore rules, ensuring that only the files you need are included.
- Automated Git Management: The tool initializes a git repository in your target folder, commits existing files to prevent data loss, and clears out old files before copying new ones.
- Organized Uploading: Easily upload your latest files to Claude without manually sifting through subdirectories.
Configuration Made Simple
Tailor the file copying process to your needs by editing the copy_files.py
script to specify:
- Source directory (where your files are located)
- Target directory (where you want to store files for upload)
- Optional file types to include
- Optional .gitignore file to exclude certain files
Example Configuration
# CONFIGURATION
SOURCE_DIRECTORY = Path('/Users/username/projects/myproject')
TARGET_DIRECTORY = Path('/Users/username/claude-files')
GITIGNORE_FILE = Path('/Users/username/projects/myproject/.gitignore')
# File extensions to copy (optional)
EXTENSIONS = {'.py', '.yaml', '.toml', '.txt', '.md', '.gitignore', '.gitattributes'}
When executed with python3 copy_files.py
, the tool performs the following steps:
- Initializes a git repository in the target folder (if not already existing).
- Commits current files to secure them.
- Deletes old files to prepare for new copies.
- Copies the specified files from the source directory to the target directory, documenting origins in a
file_map.txt
for quick reference.
Robust Security Features
The Claude File Organizer prioritizes safety with several built-in security measures:
- Prevents access to system directories (across Windows, Mac, Linux, and Unix)
- Checks permissions for both source and target directories
- Protects against root directory access
- Implements ownership checks on Unix systems
- Features comprehensive error handling for common permission and access issues
Limitations
While powerful, this tool has certain constraints:
- The target folder must not be part of an existing git repository.
- Requires write permissions for both the source and target directories.
- The target directory cannot be owned by a root or system user.
Community Contributions
We welcome contributions to enhance this project. Feel free to submit pull requests to help improve the Claude File Organizer.
Designed specifically for individuals who actively share files with Claude, this tool aims to optimize your productivity by organizing your file-handling tasks effortlessly. Share this utility among colleagues and make your interactions with Claude even more efficient!