Context Assembler

Combine files and folders into one LLM-ready context block — like repomix or files-to-prompt, fully in your browser

    Add files

    Folder uploads preserve the directory tree. node_modules, .git, dist and build output are skipped automatically and never read.

    Limits: up to 500 files, 1.0 MB each, 20.0 MB total. Heavier picks are reported, not lost.

    Comma or newline separated. Names match any path segment; * is a glob.

    Context output

    Your assembled context appears here

    Pick a folder or add files on the left

    Files are read locally with the File API and never uploaded. The token estimate uses ≈4 characters/token — a rough guide, not an exact tokenizer count.

    Large language models like Claude and ChatGPT give much better answers when you hand them complete, well-structured context — but copy-pasting files one by one is tedious and you constantly forget a file. The Context Assembler is the browser-based counterpart of CLI tools such as repomix and files-to-prompt: pick a whole folder (structure preserved) or add individual files, and it merges everything into a single text block an LLM can read. Each file is wrapped in <file path="...">…</file> tags so the model always knows which file it is looking at, with an optional ASCII project tree up top. Heavy directories (node_modules, .git, dist, build, .next) are skipped automatically and never read, and you can fine-tune with your own ignore patterns or limit to specific extensions (.ts, .tsx). A live token estimate (≈4 characters per token) tells you how much of the context window you are using, with a link to the Token Cost Calculator to turn that into dollars. Binary files are detected and skipped, and everything runs locally in your browser — your code is never uploaded.

    Examples

    Assemble a TypeScript project

    📁 Pick folder: my-app/
    
    <file path="my-app/src/index.ts">
    import { greet } from "./utils";
    greet("world");
    </file>
    <file path="my-app/src/utils.ts">
    export const greet = (n: string) => console.log(`Hello, ${n}!`);
    </file>
    <file path="my-app/package.json">
    { "name": "my-app", "type": "module" }
    </file>

    Each file is wrapped in an XML tag with its relative path. The optional tree header gives the model a map of the project first.

    Filter to one extension

    Extensions: .ts,.tsx
    Ignore: node_modules, *.test.ts, dist
    
    → Only non-test TypeScript files are included.

    Combine an extension allow-list with ignore globs to ship just the source files that matter for a code-review prompt.

    Right-size the context window

    Output: 12,480 chars · ≈3,120 tokens
    → Open Token Cost Calculator

    The token estimate shows how much of the context window the assembly uses before you paste it.

    Examples

    Assembling a small project

    Input
    Files: src/index.ts, src/utils.ts, README.md
    Ignore: node_modules/**, *.lock
    Output
    Project structure:
      src/index.ts
      src/utils.ts
      README.md
    
    <file path="src/index.ts">
    import { add } from "./utils" ...
    </file>

    Each file becomes an XML-tagged block with an escaped path; the tree header lets the model navigate the layout.

    About this tool

    Context Assembler merges files and folders into a single LLM-ready context block. Drop in source files, a documentation tree, or a whole folder, and it emits one document with each file wrapped in an XML-tagged block, a project tree at the top, and a token estimate — the same pattern popularized by repomix and files-to-prompt.

    Glob ignore filters let you exclude node_modules, build output or secrets, and hard limits (file count, per-file size, and total size) keep the bundle within a model's context window while reporting what was skipped. File paths are XML-escaped so the output is safe to paste, and nothing is ever uploaded — files are read in your browser only.

    How to use

    1. Add files or a folder

      Pick individual files or upload a folder; a project tree and per-file list build automatically.

    2. Filter what's included

      Use glob ignore patterns to drop node_modules, dist, images or any path you don't want in the context.

    3. Check the token estimate

      A running token estimate and size limits show whether the bundle fits your target model's context window.

    4. Copy the assembled context

      Copy one XML-tagged block with the tree header and every included file to paste into Claude, ChatGPT or an agent.

    Use cases

    Hand a repo to a model

    Assemble an entire small project into one prompt so the model can reason across files without manual copy-paste.

    Debug with full context

    Bundle the relevant files and folder structure so a model review sees imports and layout, not isolated snippets.

    Generate documentation

    Give the model the source tree and files and ask for README, architecture or API docs grounded in the real layout.

    Common mistakes

    Mistake:Including node_modules or build output.

    Fix:Add ignore globs like node_modules/**, dist/** and *.min.js so the bundle isn't flooded with generated code.

    Mistake:Exceeding the context window.

    Fix:Watch the token estimate and per-file size limits; trim to the relevant files rather than dumping the whole repository.

    Mistake:Forgetting that paths are escaped.

    Fix:Paths with &, < or > are XML-escaped inside the tags so the block stays valid; paste it as-is into the model.

    Frequently asked questions

    References & standards