> For the complete documentation index, see [llms.txt](https://docs.protocol.land/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.protocol.land/working-with-files/create-a-new-file.md).

# Create a new file

Creating and adding new files to your repository is an integral part of updating your project's content.

Follow these steps to add a file to your repository on Protocol.Land:

1. Navigate to the main page of the repository and click “Add file” located on the top-left corner above the list of files.\
   ![](/files/gZQONuYMv1f19ta8FvfO)
2. Click “Create new file” from the modal you are prompted with.\
   ![](/files/dfgX0D3UW0hLgEgivY6U)
3. You will be redirected to the file creation page.
4. Type in the desired file name along with its extension in the provided input field. You can also provide a path along with the file name like \`folder/filename.ext\` to create folders within the repository.\
   ![](/files/gANbjTUR7ipmj4SWG3Ld)

{% hint style="info" %}
Note: The files and folders are created relative to the file path you click the “Create new file” in. If a folder already exists, it will simply add the file to it based on the provided path.
{% endhint %}

5. Type in your code in the provided code editor.
6. After making the changes, you have the option to “Cancel Changes” or “Commit Changes” to the active branch.\
   ![](/files/MlGRir99qO7NxPG72Q5P)
7. Click “Commit Changes”.
8. A modal will prompt you to add a commit message.\
   ![](/files/MCn6bNIR7VyH7hON1gzG)
9. Type in the desired commit message that summarizes the changes.
10. Preview the estimated cost of committing your changes by hovering over the information icon.
11. Click “Commit changes”.
12. You will be redirected to the main page of the repository, where the updated files list of the active branch will now include the newly created file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.protocol.land/working-with-files/create-a-new-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
