Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    How to Give an AI Several Files at Once: Order, Markers and What to Check

    Updated December 2026

    Written by the Toolpuffin team. Tools in this guide are tested in the browser.

    Many AI chats take one block of text, not a folder. If you want help with several files, such as a few code files or a set of notes, you have to combine them in a way the model can tell apart. This guide shows how to mark the files, in which order to put things and what to check before you paste.

    Try the tool: Files to One Text

    Mark where each file starts

    If you paste files one after another, the model cannot tell where one file ends and the next begins. Put the file name above each file. Anthropic's documentation recommends wrapping each document in tags, with metadata such as the file name, when you give a model several documents.

    Source: Anthropic: Long context prompting tips

    • Markdown: a heading with the file name above the content of the file.
    • XML: a document tag around each file, with the file name inside.
    • Plain lines: a line with the file name above the content, the simplest option.

    Files to One Text offers these three ways of marking, and lets you put the files in the order you want.

    Put the question last

    Anthropic advises placing long documents and inputs, of about 20,000 tokens or more, near the top of the prompt, above your question and instructions. In their tests, putting the question at the end improved the quality of the response by up to 30%, especially with complex inputs of several documents.

    1. Paste the combined text first.
    2. Then write what you want, for example: find the bug in the function that reads the settings file.
    3. Name the files that matter most, so the model knows where to look.

    Check the size

    Every chat can hold only so much text, the context window, and the answer needs room too. Files to One Text shows a rough token count. For a better count, and to see how much of a model's window your text uses, use the counter and the meter.

    If the text is too long, leave out the files that are not needed, such as generated files and lock files. The tool skips hidden files and folders such as node_modules, dist and build by default.

    Remove secrets before you paste

    • Environment files such as .env, and config files, can hold passwords, API keys and tokens.
    • Read the combined text once before you paste it.
    • Replace secrets with a placeholder such as YOUR_API_KEY.
    • Anything you paste is sent to the AI service you use, so check its data policy for work you are not allowed to share.

    More guides