> For the complete documentation index, see [llms.txt](https://docs.crew.you/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crew.you/tools/code-development.md).

# Code & Development

Crew can write and execute Python code, analyze data, create visualizations, and even make changes to your GitHub repositories.

## Python Sandbox

Crew runs Python code in a secure, isolated sandbox environment. Each execution starts fresh with a clean environment.

### Data Analysis

> "Analyze this CSV file — find the top 10 customers by revenue, calculate monthly trends, and create a visualization."

> "Read the Excel spreadsheet and create a pivot table showing sales by region and product category."

> "Calculate the correlation between marketing spend and revenue from this dataset."

### Chart Creation

> "Create a bar chart showing monthly revenue from this data: \[paste or upload data]."

> "Generate a line chart comparing our three product lines over the past year."

> "Create a pie chart of our expense breakdown."

### Data Processing

> "Clean this CSV — remove duplicates, fix date formats, handle missing values, and save the cleaned version."

> "Merge these two spreadsheets on the 'Customer ID' column and create a combined report."

> "Convert this JSON file to a well-formatted CSV."

### Pre-installed Libraries

The sandbox comes with these Python libraries ready to use:

* **pandas** — Data manipulation and analysis
* **numpy** — Numerical computing
* **matplotlib** — Chart and visualization creation
* **openpyxl** — Excel file reading/writing
* **python-docx** — Word document handling
* **Pillow** — Image processing
* **lxml** — XML/HTML parsing

### How It Works

1. You ask Crew to perform a data task
2. Crew writes Python code
3. The code runs in an isolated sandbox
4. Results (text output, files, charts) are returned to you

### Sandbox Limits

| Plan  | Max Execution Time |
| ----- | ------------------ |
| Free  | 30 seconds         |
| Basic | 120 seconds        |
| Plus  | 300 seconds        |
| Pro   | 300 seconds        |

### Working with Files

When you upload a file before asking for code execution, the file is automatically available in the sandbox:

> \[Upload sales\_data.xlsx] "Analyze this spreadsheet and create a summary report with charts."

Output files (charts, processed data, generated documents) are saved to My Files.

## GitHub Integration

> **Plan requirement:** Pro plan

### Repository Management

> "List my GitHub repositories."

> "Show me the open issues in my-org/my-repo."

> "What PRs are waiting for review?"

### API Access

Crew has full access to the GitHub API, so you can:

* Create and manage issues
* Review pull requests
* Check CI/CD status
* Manage repository settings
* And anything else the GitHub API supports

## Coding Agent

The Coding Agent can autonomously make changes to your GitHub repositories:

> "In my-org/frontend-app, fix the broken login form. The submit button doesn't work on mobile."

> "Add input validation to the signup form in my-org/web-app."

> "Refactor the database module in my-org/api-server to use connection pooling."

### How It Works

1. You describe the change you want
2. Crew clones your repository in a secure environment
3. The agent reads the code, understands the structure, and makes changes
4. Changes are committed to a new branch
5. A pull request is created for your review

The agent runs in the background — you'll be notified when the PR is ready.

### Best Practices

* **Be specific**: Describe the exact behavior you want, not just "fix the bug"
* **Reference files**: If you know which files need changes, mention them
* **Always review**: The agent creates PRs, never pushes to main — always review before merging

## Practical Scenarios

### Data Analysis Pipeline

> \[Upload quarterly\_data.xlsx] "Analyze this quarterly data: 1) Calculate year-over-year growth for each product line, 2) Create charts for the top 3 metrics, 3) Generate a PDF report with all findings."

### Quick Calculation

> "Calculate compound interest on $10,000 at 5% annual rate for 10 years, compounded monthly. Show a table of yearly balances."

### File Format Conversion

> "Convert this JSON API response to a clean Excel spreadsheet with proper column headers."

### Web Scraping + Analysis

> "Search the web for the Fortune 500 list, extract the company names and revenues, and create a chart showing the top 20 by revenue."

### Automated Reporting

> "Set up a weekly task: every Monday at 9 AM, pull the latest data from \[API URL], analyze trends, create a chart, and send the report to my email."

## Tips

* **Upload files first**: Attach spreadsheets and data files before asking for analysis
* **Request specific output**: "Create a chart" is good; "Create a bar chart with monthly revenue on the Y-axis and months on the X-axis, colored by product line" is better
* **Iterate**: If the first analysis isn't quite right, ask Crew to adjust — it remembers the context
* **Save results**: Ask Crew to save important outputs to My Files or Google Drive
* **Combine with email**: "Analyze the data, create a report, and email it to the team"
* **Need more depth?** For complex multi-step analysis or research that needs polished document output, try [Deep Work](/tools/deep-work.md)
