<!--
name: 'Tool Description: TaskOutput'
description: Default SDK built-in tool description and input schema for TaskOutput.
sdkPackage: '@anthropic-ai/claude-agent-sdk@0.3.168'
claudeCodeVersion: '2.1.168'
tool: "TaskOutput"
-->
# Tool Description: TaskOutput

## Metadata

- Request location: `tools[]`
- Tool name: `TaskOutput`
- Input schema properties: `task_id`, `block`, `timeout`

## Description

DEPRECATED: Background tasks return their output file path in the tool result, and you receive a <task-notification> with the same path when the task completes.
- For bash tasks: prefer using the Read tool on that output file path — it contains stdout/stderr.
- For local_agent tasks: use the Agent tool result directly. Do NOT Read the .output file — it is a symlink to the full subagent conversation transcript (JSONL) and will overflow your context window.
- For remote_agent tasks: prefer using the Read tool on the output file path — it contains the streamed remote session output (same as bash).

- Retrieves output from a running or completed task (background shell, agent, or remote session)
- Takes a task_id parameter identifying the task
- Returns the task output along with status information
- Use block=true (default) to wait for task completion
- Use block=false for non-blocking check of current status
- Task IDs can be found using the /tasks command
- Works with all task types: background shells, async agents, and remote sessions

## Input Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "task_id": {
      "description": "The task ID to get output from",
      "type": "string"
    },
    "block": {
      "description": "Whether to wait for completion",
      "default": true,
      "type": "boolean"
    },
    "timeout": {
      "description": "Max wait time in ms",
      "default": 30000,
      "type": "number",
      "minimum": 0,
      "maximum": 600000
    }
  },
  "required": [
    "task_id",
    "block",
    "timeout"
  ],
  "additionalProperties": false
}
```

## Token Impact

<!-- TOKEN_COUNT_START -->
- Complete definition estimated tokens: **523**
- Measurement: captured tool object serialized independently as JSON text against the common baseline
- Additivity: independent, non-additive estimate
<!-- TOKEN_COUNT_END -->
