Documentation
Welcome to the technical documentation for AI Code Stitcher. This manual details how to configure, control, and execute advanced codebase updates with extreme efficiency.
Core Concept: The Stitcher is a client-side utility built in Pygame/Python designed to act as the missing bridge between conversational AI (ChatGPT, Claude, Aider) and your local file system. It intercepts snippets copied directly to your system clipboard, processes them, and surgically targets code replacements.
Installation
The AI Code Stitcher runs as a lightweight native Windows executable. It uses low-level win32 API integration for a responsive user experience.
Prerequisites
- Windows 10/11
Step-by-step Setup
- Download the compiled installer here.
- Run the setup wizard. Upon the first launch, the program will create your personalized
cs_settings.iniconfig file inside your AppData directory. - Notepad will automatically open to configure your workspace. Enter the path to your code repository under the monitored folder section and restart the app.
Quick Start Guide
Once your workspace directory has been specified in your settings, running the Stitcher is a fluid, three-step loop:
Accordion Stitching
Standard text patchers fail when code outputs are truncated. Large language models often use comments like # ... rest of code unchanged ... to avoid emitting massive files.
The Accordion Stitcher uses Edge Anchor Mapping to solve this. It recursively pairs the non-truncated segments with your local source file while identifying the boundaries of the gap. Once the gap boundaries are secured, it cleanly stretches and inserts the correct logic without wiping adjacent lines.
Note: Standalone ellipses (...) or comment lines signaling omissions are dynamically processed and stripped to ensure no leftover placeholder debris is written into production scripts.
Nuclear Search
When the AI outputs code snippets at the global level without providing conversational hints or relative paths, the program activates Nuclear Search.
Nuclear Search calculates a TF-IDF-like keyword density weight across your codebase. It scans variables, structures, classes, and method signatures inside your clipboard and ranks local files by their structural affinity. In most cases, the target file is cleanly resolved within milliseconds.
Tactical Routing (Shift+F9)
For high-risk files or highly sensitive structural changes, toggle Tactical Arm using Shift+F9. This forces the engine out of automatic routing and exposes the manual prompt pipelines:
- Smart Drop-In: Directly updates existing code blocks and methods inside matching targets.
- Full Class Overwrite: Eradicates the local class definition and drops in the complete, new definition.
- Full File Overwrite: Overwrites the full active target buffer with safety drop safeguards.
- Interactive Headless Overlay: Drops you into a manual alignment console where you can manually offset and overlay your patch block with your arrow keys before executing.
Syntax Healing
Web interfaces and copy-paste buffers can sometimes inject formatting bugs into otherwise valid code. AI Code Stitcher applies multiple active correction sweeps on every clipboard write:
Active Corrections:
- Fracture Repair: Reconnects lines that were illegally wrapped by UI wrappers while respecting multiline docstrings.
- Tab Normalization: Automatically converts hard tab/space hybrid indents to perfect 4-space indentations.
- Garbage Scrubbing: Vaporizes hidden Unicode characters, Non-Breaking Spaces (NBSP), and zero-width characters.
- Import Hoisting: Locates newly introduced, deeply buried imports and systematically promotes them to the top-level header space of the module, ensuring zero duplication.
cs_settings.ini
Your local configuration file controls window placement, transparency levels, system audio behaviors, and monitor affinities.
[DEFAULT]
# Enter absolute paths to folders you want to monitor here
# Append --no-recursive to a folder path to prevent scanning subdirectories
C:\your_codebase\your_project
CONF_SOUND_ENABLED = True
CONF_ALWAYS_ON_TOP = True
CONF_VIEWER_ALWAYS_ON_TOP = True
CONF_INACTIVITY_SCREENSAVER = 30 # (MINS) 0 = off.
CONF_GLOBAL_HOTKEY = True # excluding F9 and Shift-F9
# UI Dimensions
CONF_TOTAL_CHARS = 68
CONF_WINDOW_HEIGHT = 880
CONF_WINDOW_TRANSPARENCY = 0.90
CONF_WINDOW_WIDTH = 440
CONF_FONT_NAME = lucida console
CONF_FONT_SIZE = 10
ini
Hotkey Cheat Sheet
Use these dedicated hotkeys while the monitor window is focused to command operations:
cs_settings.ini directly in Notepad.