Read File Skill
Read the contents of a file from the workspace.
When to Use
Use the read_file skill for:
- Reading source code: View implementation details
- Reading configuration: Check config files, package.json, etc.
- Reading documentation: View README, docs, comments
- Reading data files: CSV, JSON, text files
- Partial reads: Read specific line ranges for large files
Input Format
{
"path": "src/index.ts",
"offset": 1,
"limit": 100
}
Parameters
| Parameter |
Type |
Required |
Default |
Description |
path |
string |
Yes |
- |
Path to file (relative to workspace) |
offset |
number |
No |
1 |
Start line (1-indexed) |
limit |
number |
No |
2000 |
Max lines to read |
encoding |
string |
No |
utf-8 |
File encoding |
Output Format
{
"success": true,
"output": "file contents here...",
"exitCode": 0,
"metadata": {
"path": "/full/path/to/file",
"lines": 150,
"size": 4096
}
}
Examples
Read entire file
{ "path": "package.json" }
Read specific lines
{
"path": "src/app.ts",
"offset": 100,
"limit": 50
}
Limitations
- Text only — this tool reads UTF-8 text files. Binary files (PDF, images, DOCX, ZIP, etc.) will be rejected.
- To read PDFs, use pdftotext (see the pdf skill for details).
- To inspect images, use bash with an appropriate library.
Security
- Paths are validated to stay within workspace boundaries
- Symlinks that escape workspace are blocked
- Binary files return an error
1---2name: read-file3description: Read contents of a file from the workspace4---56# Read File Skill78Read the contents of a file from the workspace.910## When to Use1112Use the read_file skill for:1314- **Reading source code**: View implementation details15- **Reading configuration**: Check config files, package.json, etc.16- **Reading documentation**: View README, docs, comments17- **Reading data files**: CSV, JSON, text files18- **Partial reads**: Read specific line ranges for large files1920## Input Format2122```json23{24 "path": "src/index.ts",25 "offset": 1,26 "limit": 10027}28```2930### Parameters3132| Parameter | Type | Required | Default | Description |33|-----------|------|----------|---------|-------------|34| `path` | string | Yes | - | Path to file (relative to workspace) |35| `offset` | number | No | 1 | Start line (1-indexed) |36| `limit` | number | No | 2000 | Max lines to read |37| `encoding` | string | No | utf-8 | File encoding |3839## Output Format4041```json42{43 "success": true,44 "output": "file contents here...",45 "exitCode": 0,46 "metadata": {47 "path": "/full/path/to/file",48 "lines": 150,49 "size": 409650 }51}52```5354## Examples5556### Read entire file5758```json59{ "path": "package.json" }60```6162### Read specific lines6364```json65{66 "path": "src/app.ts",67 "offset": 100,68 "limit": 5069}70```7172## Limitations7374- **Text only** — this tool reads UTF-8 text files. Binary files (PDF, images, DOCX, ZIP, etc.) will be rejected.75- To read PDFs, use pdftotext (see the pdf skill for details).76- To inspect images, use bash with an appropriate library.7778## Security7980- Paths are validated to stay within workspace boundaries81- Symlinks that escape workspace are blocked82- Binary files return an error