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.
- Period
- Apr 2026
- Technologies
- 2
- Diagrams
- 1
- Reading time
- 1 min
Source & download: Merge Selected Project Files into One AI-Ready Text Block
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).
Diagram as text
flowchart LR F[webkitdirectory pick folder] --> T[buildFileTree: checkbox tree + search] T --> SEL[selected list] SEL --> FIL[filters: ext, strip comments/imports] FIL --> G[generateCode → one labelled block] G --> CB[(copy to clipboard)]
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.
Related projects
Art of Cake: cake-competition website (Wix / Velo)
A no-code competition website on Wix and Velo with competition registration and Stripe payments, built for a French client.
JavaScriptStripe / PayHereHAR and Copy-as-fetch to API documentation formatter
A Tkinter and browser tool that turns HAR files and Copy-as-fetch strings into clean API documentation, with key masking for safe sharing.
PythonDesktop GUI (Tk / Qt)JavaScriptLogo Color Previewer: colour variations with a WCAG contrast check
A Next.js 16 tool that applies 100+ palettes to a logo, checks WCAG contrast live and exports favourite variations as a ZIP in the browser.
Next.jsReactTypeScriptTailwind CSSWant to discuss this project?
Happy to walk through the architecture, trade-offs or the code.