# How Skills Work in Open Interpreter: Building Reusable Function Libraries

> Learn how Open Interpreter skills work and build reusable Python function libraries. Discover how skills automatically import and access them via computer.skills for enhanced automation.

- Repository: [Open Interpreter/open-interpreter](https://github.com/openinterpreter/open-interpreter)
- Tags: deep-dive
- Published: 2026-03-05

---

**Skills in Open Interpreter are standard Python functions stored in a dedicated directory that get automatically imported when `import_skills=True`, allowing you to build reusable function libraries accessible via the `computer.skills` namespace.**

Open Interpreter treats skills as ordinary Python modules, enabling users to transform ad-hoc scripts into persistent, shareable libraries. This article explains the architecture behind the skills system and provides step-by-step instructions for creating reusable function libraries using the built-in wizard and manual module creation.

## Architecture of the Skills System

The skills system consists of three core components: the `Skills` manager class, the `NewSkill` interactive wizard, and the profile configuration that enables automatic importing.

### The Skills Class

Located in [`interpreter/core/computer/skills/skills.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/computer/skills/skills.py), the `Skills` class manages the lifecycle of skill modules. It handles listing available skills via `list()`, searching via `search()`, and bulk importing via `import_skills()`. The class stores the path to the skills directory (defaulting to `<repo_root>/skills`) and executes all `*.py` files found there.

### The NewSkill Wizard

Also defined in [`interpreter/core/computer/skills/skills.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/computer/skills/skills.py) (lines 57-124), the `NewSkill` class provides an interactive wizard for authoring skills. It guides users through naming the skill, recording sequential steps, and persisting the result as a Python module. The `create()` method initiates the wizard, `add_step()` records code blocks, and `save()` writes the final file to the skills directory.

### Profile Configuration

Skills are enabled through profile configuration files such as [`interpreter/terminal_interface/profiles/defaults/the01.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/terminal_interface/profiles/defaults/the01.py). A profile sets `interpreter.computer.import_skills = True` and optionally customizes `interpreter.computer.skills.path` to point to a specific directory. Without this configuration, the skills system remains dormant.

## How Skills Work in Open Interpreter at Runtime

Understanding the data flow helps clarify how reusable functions become available to the LLM during a session.

1. **Startup**: When `OpenInterpreter` initializes in [`interpreter/core/core.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/core.py), it creates a `Computer` instance. If the active profile sets `import_skills=True`, the `computer.skills.path` attribute is configured.

2. **Import**: The first time the terminal interface or any LLM-generated code accesses `computer.skills`, the `import_skills()` method executes (triggered in [`interpreter/terminal_interface/terminal_interface.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/terminal_interface/terminal_interface.py)). This method walks the skills directory, concatenates all Python code, and executes it through the computer's Python executor. If a traceback occurs, it falls back to importing each file individually.

3. **Listing**: Calling `computer.skills.list()` returns available skill names formatted as function calls (e.g., `['weather_lookup()', 'file_search()']`). This method simply reads the directory and appends `()` to each filename without the `.py` extension.

4. **Execution**: Because the modules were executed during import, the functions exist in the interpreter's global namespace. The LLM can invoke them directly: `weather_lookup(city="Paris")`.

5. **Creation**: When using `computer.skills.new_skill.create()`, the wizard records steps and ultimately calls `save()`, which writes a new Python file to the skills directory. This file becomes available on the next interpreter start or after manually calling `import_skills()`.

## Building Reusable Function Libraries

Creating persistent, shareable libraries involves enabling the system, using the wizard for interactive creation, or manually authoring modules.

### Enabling Skills in Your Profile

Before creating skills, ensure your profile activates the system:

```python

# interpreter/terminal_interface/profiles/defaults/my_profile.py

from interpreter import interpreter

interpreter.computer.import_skills = True          # Enable automatic importing

interpreter.computer.skills.path = "./skills"      # Directory for skill modules

```

This configuration mirrors the approach used in [`the01.py`](https://github.com/openinterpreter/open-interpreter/blob/main/the01.py) (lines 17-30).

### Creating Skills with the Interactive Wizard

The wizard provides a guided interface for converting ad-hoc code into reusable functions:

```python

# Start the wizard

computer.skills.new_skill.create()

```

The wizard executes the logic defined in `NewSkill.create()` (lines 62-73) and prompts for:

1. **Name**: Setting `computer.skills.new_skill.name = "send_email"` triggers the property setter (lines 78-84), validating the input.
2. **Steps**: For each step, the user executes code, then records it via `add_step("Description", code_string)`. This method (lines 100-112) stores the step as a markdown-formatted string.
3. **Save**: Calling `save()` (lines 190-258) writes the Python file to `<skills_path>/send_email.py`, generating a function that contains the recorded steps.

### Manual Skill Creation

For version-controlled libraries, manually create Python files in the skills directory:

```python

# File: ./skills/data_processing.py

import pandas as pd

def clean_csv(filepath):
    """
    Load and clean a CSV file by dropping NA values.
    """
    df = pd.read_csv(filepath)
    cleaned = df.dropna()
    return cleaned

def summarize_column(df, column):
    """
    Return basic statistics for a specific column.
    """
    return df[column].describe()

```

These functions become available as `clean_csv()` and `summarize_column()` after the next import.

### Importing Skills During a Running Session

If you add files to the skills folder while the interpreter is active, force a reload:

```python
computer.skills.import_skills()   # Re-imports all .py files in the skills directory

```

This executes the logic in `import_skills()` (lines 100-154), which concatenates all skill code and executes it through the computer's Python executor.

## Code Examples

### Listing and Calling an Existing Skill

```python

# List all loaded skills

print(computer.skills.list())

# Output: ['weather_lookup()', 'file_search()']

# Call a skill directly (function exists in global namespace)

weather_lookup(city="Tokyo")

```

The `list()` method (lines 46-66) reads the skills directory and formats filenames as callable function names.

### Authoring a Reusable Send-Email Skill

```python

# Initiate the wizard

computer.skills.new_skill.create()

# ---- Wizard interaction ----

computer.skills.new_skill.name = "send_email"

# Step 1: Create message helper

code_step1 = """
import smtplib
from email.message import EmailMessage

def make_msg(to, subject, body):
    msg = EmailMessage()
    msg["From"] = "me@example.com"
    msg["To"] = to
    msg["Subject"] = subject
    msg.set_content(body)
    return msg
"""
computer.skills.new_skill.add_step("Create message helper", code_step1)

# Step 2: Send the email

code_step2 = """
def send(to, subject, body):
    msg = make_msg(to, subject, body)
    with smtplib.SMTP("smtp.example.com", 587) as s:
        s.starttls()
        s.login("me@example.com", "password")
        s.send_message(msg)
"""
computer.skills.new_skill.add_step("Send using SMTP", code_step2)

# Persist the skill

computer.skills.new_skill.save()

```

After saving, the file [`./skills/send_email.py`](https://github.com/openinterpreter/open-interpreter/blob/main/./skills/send_email.py) is created. On the next interpreter start:

```python
>>> send_email(to="bob@example.com", subject="Report", body="Here is the report.")

```

### Manual Import of New Skills

```python

# If you added files to the skills folder while running:

computer.skills.import_skills()   # Forces re-import of all .py files

```

This executes the logic in `import_skills()` (lines 100-154), which concatenates all skill code and executes it through the computer's Python executor, falling back to per-file import if errors occur.

## Summary

- **Skills are standard Python functions** stored as `.py` files in a configurable directory, loaded automatically when `import_skills=True`.
- **The `Skills` class** in [`interpreter/core/computer/skills/skills.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/computer/skills/skills.py) manages listing, searching, and bulk importing of modules.
- **The `NewSkill` wizard** provides an interactive interface for recording code steps and persisting them as reusable functions without manual file editing.
- **Profile configuration** enables the system; setting `interpreter.computer.import_skills = True` and `interpreter.computer.skills.path` activates automatic loading.
- **Functions become globally available** after import, allowing the LLM to invoke them directly by name without additional import statements.

## Frequently Asked Questions

### Where are skills stored in Open Interpreter?

Skills are stored as individual `.py` files in a directory specified by `interpreter.computer.skills.path`, which defaults to a `skills` folder in the repository root. The `Skills` class in [`interpreter/core/computer/skills/skills.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/computer/skills/skills.py) manages this directory, reading all Python files during the import process.

### How do I enable automatic skill importing?

Set `interpreter.computer.import_skills = True` in your profile configuration file (such as [`interpreter/terminal_interface/profiles/defaults/the01.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/terminal_interface/profiles/defaults/the01.py)). When this flag is active, the interpreter automatically executes all `.py` files in the skills directory at startup, making the functions available in the global namespace.

### Can I create skills without using the interactive wizard?

Yes, you can manually create Python files in the skills directory. Each file should define functions that perform specific tasks. When the interpreter imports skills (either at startup or via `computer.skills.import_skills()`), it executes these files, making the functions callable. This approach is ideal for version-controlled libraries or complex multi-function modules.

### What happens if a skill has an error during import?

The `import_skills()` method in [`interpreter/core/computer/skills/skills.py`](https://github.com/openinterpreter/open-interpreter/blob/main/interpreter/core/computer/skills/skills.py) first attempts to concatenate and execute all skill code together. If a traceback occurs during this bulk execution, it falls back to importing each file individually, isolating errors to specific modules. This ensures that a single broken skill does not prevent other valid skills from loading.