Documentation aligned with GitHub release v3.59

Documentation

AI Code Stitcher is an AST-aware bridge between LLM-generated code and a local codebase. It accepts clipboard copies or terminal input, resolves file and scope, reconciles truncated code, normalizes formatting and writes local rollback snapshots.

The three parts: Code Stitcher is the desktop engine, Stitch Viewer is the side-by-side diff inspector, and stitch is the command-line companion for shells, local models and coding agents.

This guide follows the latest GitHub release notes. Release page documentation is more recent than the repository's main README.

Installation

The desktop runtime is Windows-focused. Download the current build from the official GitHub release assets, rather than using an old version-specific installer URL.

  1. Open the latest release and select the installation asset appropriate to your machine.
  2. Install and run Code Stitcher. Configure the project folders you want monitored using its settings interface / generated configuration.
  3. Leave the engine running for clipboard use. The CLI companion talks to that running engine over localhost IPC.

Platform note: The release describes the CLI as cross-platform, but it relies on a running desktop runtime for most patching workflows. Check the release assets for supported installers.

Clipboard quick start

F9
Arm: Toggle the background clipboard listener on. The latest release clears stale clipboard state when arming.
Ctrl + C
Copy: Copy an LLM response from a browser, editor, or other tool. Markdown fences and surrounding prose are handled by the parser.
Review
Place and apply: Stitcher resolves the target location and checks it. Ambiguous matches may open an interactive adjuster before writing.
F10
Inspect: Open Stitch Viewer to see the before/after diff.

Every committed write saves a local .bak snapshot for rollback using Ctrl+Z; Ctrl+Y redoes a reverted write.

Terminal bridge & AI agents

In v3.54 and later, the stitch CLI uses subcommands. The companion script (stitch_cli.py) communicates with the running Stitcher engine through localhost IPC.

Attach context to the F7 composer

stitch attach src/player.gd src/combat/hitbox.gdshell

Analyze a source file's AST

stitch analyze src/core/engine.pyshell

Returns a JSON structure of classes and functions with their boundaries, useful for autonomous agents choosing precise patch targets.

Pipe an edit directly to a target

cat my_patch.txt | stitch patch src/core/engine.pyshell

Here, patch bypasses the normal file auto-router for the specified path, while the engine still handles patch placement.

Monitor runtime activity

stitch streamshell

CLI note: For full argument details and platform specifics, consult the release CLI documentation.

Accordion stitching & multi-file input

LLMs frequently omit existing code using markers like // ... existing code .... Accordion stitching anchors the emitted sections against local source so the omitted material can be preserved instead of overwritten.

Recent releases accept Aider SEARCH/REPLACE hunks, unified diffs, markdown blocks, and conversational multi-file patches—even when a reply uses plain file headings instead of fenced code. v3.59 also resolves embedded # File: path/to/file hints inside Aider hunks, and tolerates trailing prose on file boundary headers.

When a multi-file Aider or unified patch targets brand-new files, v3.59 resolves the path against the active workspace, creates any missing parent folders, writes the file and applies the patch without prompts or folder pickers. Duplicated project-root prefixes in a path are stripped so they don't collide with a monitored folder.

Syntax healing & pre-write safeguards

Stitcher matches indentation to the target (including tabs for Godot GDScript), strips common formatting artifacts and checks the syntax or structural seams before committing edits.

  • Grammar checks: Guards for bracket parity, multiline data structures, and branch keywords. v3.59 improves Python ternary handling.
  • Seam guards: Detect suspicious cuts, deleted control-flow statements and indentation cliffs.
  • Path safeguards: Hardened target containment against directory traversal outside the monitored workspace.
  • Rollback snapshots: Saved under hidden .ep_backups/ directories for review and undo.

Tactical routing & interactive adjuster

Press Shift+F9 to intercept copied code and confirm where it should go. Use the adjuster when an automatic match needs human confirmation.

↑ ↓
Move the candidate's insertion/overwrite anchor.
← →
Cycle among ranked match candidates.
< >
Nudge indentation to match the destination.
[ ]
Adjust the start seam; use - and + for the end seam.
m
Smart-merge declarations and variables omitted by the model.
e
Edit the proposed snippet before saving.
Enter
Commit the reviewed patch; Esc skips it and 0 cancels the operation.

Full-file replacement confirmations default to No rather than Yes, according to the release history.

Stitch Viewer & rollback

Use F10 to open the SDL2 side-by-side visual comparison of the original snapshot and current file. Review the session timeline, revert a line, block, or hunk, or open the inline editor (Esc while in the viewer).

Snapshots live locally in .ep_backups/. The viewer does not require Git commits for diff inspection.

Hotkey reference

F9
Arm / disarm clipboard monitoring.
Shift + F9
Tactical Arm: interactive destination confirmation.
F8
Filelock: pin edits to a selected file.
F7
Compose prompt with file context.
F10
Open Stitch Viewer (not F11).
Ctrl + Z
Undo the last injected change.
Ctrl + Y
Redo a reverted change.

Workspace configuration

Configure one or more project directories in the application's generated cs_settings.ini / settings interface. Free Personal Edition supports recursive directory monitoring according to the GitHub release notes; it is not limited to a single folder level.

Use the settings generated by the installed version as the authority for exact option names and paths, because these can change between builds.

What's new in v3.59

  • Zero-prompt multi-file auto-creation: patches that target new files resolve the workspace root, create missing parent folders and apply without prompts or folder pickers.
  • Project root prefix normalization: duplicated workspace-root prefixes are stripped to avoid path collisions with monitored folders.
  • Deep HintScourer: a unified multi-pass hint engine scours prose, markdown headers, Aider pre-lines and comments, with entropy filters against hallucinated file names.
  • Language-consistent validation: code syntax is cross-checked against file extensions, so Python code won't match stray .c or .h hints.
  • In-hunk file resolution: # File: directives inside Aider and unified diff bodies re-route hunks to other files mid-stream.
  • Plain-text multi-file slicing: conversational file headings are detected with or without code fences, and trailing prose on boundary headers is tolerated.
  • Ternary-expression grammar protection: branch keywords only count when followed by a colon, avoiding false rejections on Python inline ternaries.
  • Clean-slate arming: F9 and Shift+F9 wipe the clipboard and internal memory so old code can't retrigger a patch.

Read the complete GitHub release notes and changelog for authoritative details.