Humanloop allows you to store Prompt and Agent definitions in your local filesystem and in version control, while still leveraging Humanloop’s prompt management and evaluation capabilities. This guide will walk you through using local Files in your development workflow.
To follow along with the examples in this guide, create a Prompt named welcome-email in the root directory of your Humanloop workspace.
We’ll create a prompt that generates a welcome email for new customers. The Prompt uses the Humanloop .prompt format which has two main parts:
Toggle the Prompt File editor by hitting Cmd + Shift + E (or Ctrl + Shift + E on Windows) and replace the existing content with the following:

Save this new version of the Prompt by pressing Manage, then Deploy…, select your default environment (typically production) and follow the steps to deploy.
The Humanloop SDK includes both the programming interface and CLI tools you’ll need for this guide.
You’ll also need your Humanloop API key, which you can find on the API Keys page in your Organization settings.
After creating your Prompt in Humanloop (like the example Prompt we set up earlier), you’ll see it in your workspace:

Now you can pull this Prompt from Humanloop to your local environment by running:
This command clones your Humanloop workspace into a humanloop directory in your project root,
maintaining the same folder structure as your remote workspace.

humanloop pull will pull all Files deployed to your default environment (typically production) and store them in the humanloop directory.
To pull only specific Files, use a different environment, or change the local destination directory, check out the options in the help menu:
Now that you have your Prompt locally, you can use it in your code by configuring the SDK to use local Files.
You can also log results from your own provider calls by referencing local Files:
Important: When local Files are enabled and you reference a File using its path, the SDK will:
humanloop directory (this can be customized with local_files_directory/localFilesDirectory)To verify that your code is actually using the local Prompt, you can make a small modification and observe the change in output.
humanloop/welcome-email.prompt in a text editor and modify the system message.You’ll notice in the UI that a log was created with the new version of the Prompt.

When you call a modified local File, Humanloop uses content hashing to check for changes. If the content differs from an existing version, a new version is automatically created.
Now that your Prompt is a local File, you can add it to your version control system.
Once your Files are committed, you can track changes from Humanloop too.
After modifying a Prompt in the Humanloop UI and deploying it, run humanloop pull to get the
latest version, then use git diff to see what changed.
For example, if you update the model in your welcome-email Prompt from gpt-4o to gpt-4o-mini
in the Humanloop UI and deploy it, after pulling the changes you would see:

By integrating your Prompts and Agents with version control, you create a more robust development workflow:
Using with Agents
Everything you’ve learned about working with Prompt Files also applies to Agent Files.
The process is identical - pull from Humanloop, reference with the path parameter in agents.call and agents.log operations,
and manage through version control.
If you encounter any issues while working with local Files, check these common solutions:
.env file at the top level and that you run commands from your project root.--local-files-directory custom-dir when pulling, specify the same path in your SDK config for local_files_directory/localFilesDirectory).By integrating Humanloop Files into your development workflow, you’ve bridged the gap between AI development and software engineering practices, making it easier to build robust AI applications.
Now that you’re using local Files, you might want to: