Web App · AI Productivity

Merge Selected Project Files into One AI-Ready Text Block

TL;DR

Open one HTML file, choose a project folder (read locally, never uploaded), tick files, set filters, and copy one clean, labelled block of code.

Updated 1 min read

JavaScriptTailwind CSSwebkitdirectorySVG sprites

Download source (ZIP)v1.0.0 · 2 files · 64 KB · MIT license

Abstract

The problem

Giving AI models code context means opening and copy-pasting files one by one, including noise like imports and comments that waste the context window.

The solution

A browser app that reads a project folder locally, lets you tick files in a tree, and consolidates them with language-aware sanitisation.

The result

A perfectly formatted, AI-ready or doc-ready aggregate generated in seconds.

Input & Output

Input
  • A local project folder chosen through the browser (never uploaded)
Output
  • A Consolidated tab containing the merged, formatted code with a Copy button
Optional output
  • Multiple consolidated tabs to compare filter settings
  • Numbered files and relative-path headers

System Diagram

How It Works

Project explorer

Recursive tree, folder-level bulk selection and automatic expansion.

Tab-based viewer

Double-click any file for a read-only preview; every run opens a new tab.

Smart Sanitize

Separate toggles for single-line, multi-line and inline comments plus import stripping.

Space optimiser

Collapses blank lines to reduce token count.

Structured output

Headers with folder, file and relative path; optional sequence numbers.

Configuration

OptionPurpose
Include Relative PathHelps the AI understand project architecture.
Remove Comments / ImportsSaves tokens on limited context windows.
Excess Space RemoverCollapses multiple empty lines.

How to Run

Step 1
# Select Project Folder
Step 2
# Tick the related files (e.g. model, repository, controller)
Step 3
# Choose filters → Generate Consolidated Code → Copy

Source Code

preview

Loading…

Download source (ZIP)v1.0.0 · 2 files · 64 KB · MIT license

Released under the MIT license. Free to use, modify and share.

Impact & Benefits

Minutes of copy-pasting become seconds.
Runs entirely client-side, so code stays private.
Saves AI tokens through comment and import removal.

Screenshots

1/2 The whole app is one HTML file
2/2 Smart Sanitize options and Generate button

Frequently Asked Questions

How do I give ChatGPT the context of many files at once?

Select the related files in the tree and generate a consolidated block with path headers, then paste it into the chat.

Are my files uploaded anywhere?

No. It uses the browser folder-selection API and processes everything locally.

Can it remove comments and imports to save tokens?

Yes. Smart Sanitize strips single-line, multi-line and inline comments, import lines and extra blank lines.

Related

© 2026 Thuyavan Sivarasa. Script code is MIT licensed.