# Build smarter tool hooks with access to the full conversation history

> Tool pre- and post-hooks, as well as agent-level tool_hooks, can now read the current run's complete message history via run_context.messages.

- Published: 2026-03-10
- Author: Agno Team
- Category: Changelog
- Canonical: https://agno-com-nine.vercel.app/articles/access-full-message-history-inside-tool-hooks-for-richer-context-aware-logic
- Markdown: https://agno-com-nine.vercel.app/articles/access-full-message-history-inside-tool-hooks-for-richer-context-aware-logic.md

Tool pre- and post-hooks, as well as agent-level `tool_hooks`, can now read the current run's complete message history via `run_context.messages`. This makes it straightforward to build hooks that inspect prior conversation turns for auditing, conditional logic, prompt injection detection, or logging without needing to pass history through separate channels.

Details**:**

- `run_context.messages` is available in both pre- and post-hooks at the tool and agent level
- Enables hooks to make decisions based on the full conversation up to the current tool call
- No changes required to existing hooks that don't need message history; fully backward-compatible

See [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/03_teams/03_tools/message_history_in_tool_hooks.py) for reference.
