> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# diff • AI Agent SDK

> diff: Get file diffs from autonomous execution.

# diff

Method

> This is a method of the [**Agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Agent.md) class in the [**agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/agent.md) module.

Get file diffs from autonomous execution.

Returns a list of :class:`FileDiff` objects showing what files
were modified, with additions/deletions counts.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def diff(from_hash: Optional[str]) -> Any
```

## Parameters

**from\_hash** `Optional[str]`

Base commit hash to diff from. If None, uses the first snapshot (pre-autonomous state).

### Returns

**Returns** `Any`

:

agent = Agent(autonomy="full\_auto")
result = agent.start("Refactor utils.py")
for d in agent.diff():
print(f"\{d.status}: \{d.path} (+\{d.additions}/-\{d.deletions})")

## Uses

* `diff`
* `logger.debug`

## Used By

* [`Agent.diff`](../functions/Agent-diff)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/agent.py#L4507)
>
> `praisonaiagents/agent/agent.py` at line 4507


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.