# Read File

> Read contents of a file from the workspace

- Skill: `tashfeenahmed/read-file` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tashfeenahmed/read-file`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tashfeenahmed/read-file/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tashfeenahmed (https://skillmd.com/u/tashfeenahmed)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/tashfeenahmed/read-file

---


# 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

```json
{
  "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

```json
{
  "success": true,
  "output": "file contents here...",
  "exitCode": 0,
  "metadata": {
    "path": "/full/path/to/file",
    "lines": 150,
    "size": 4096
  }
}
```

## Examples

### Read entire file

```json
{ "path": "package.json" }
```

### Read specific lines

```json
{
  "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

