# Code Consolidator: a browser tool for AI-ready code context

> The browser successor to my Python copy-code tools. It reads a folder with the File System API, uploads nothing, and produces one labelled, sanitised text block.

URL: https://thuyavan.netlify.app/projects/code-consolidator-tool
Updated: 2026-10-12

- Period: 2026-04
- Technologies: JavaScript, Tailwind CSS

## Purpose

The browser successor to the Python copycode family (S01) and ThuOneCopy (P22): pick a local project folder, tick the files you want, strip comments / imports, and copy one clean, labelled block of code ready to paste into ChatGPT or Claude.

## Features (from the code)

Local folder read via webkitdirectory; buildFileTree → recursive tree with expand / collapse, tri-state checkboxes (updateAllCheckboxes, getAllChildFiles), live search.

Selection list separate from the tree; add / remove; generate-button enable logic.

Filters (initFilters): by extension (getFileExtension), removeComments, remove imports.

generateCode: concatenates the picked files into one labelled block; per-file open in a tab and a dedicated consolidate tab (openConsolidateTab, handleTabClick, switchTab).

Modal system (showModal/hideModal, about + “buy me a coffee”), toast messages (showMessage).

## Relationship

Completes the owner’s LLM-context toolkit: copycode (S01, CLI), ThuOneCopy (P22, PyQt desktop), this Code Consolidator (browser), plus the tree exporters (S04), HAR→API formatter (S06) and MD splitter (S05). A clear through-line: “prepare clean context for AI assistants”, evolved from CLI → desktop → zero-install web.
