Claude Code: Agent Hook Events & Memory Frontmatter

Claude Code

Claude Code 2.1.33 deepens its agentic automation capabilities with two new hook events — TeammateIdle and TaskCompleted — that let developers wire external systems into the agent lifecycle without polling. The release also introduces a memory frontmatter field for agents, enabling persistent context declarations in agent configuration files, and adds Task(agent_type) for restricting which agent types can be spawned by a given task.


New Hook Events for Agent Lifecycle Automation

Two new hook events, TeammateIdle and TaskCompleted, extend Claude Code's hooks system to cover the full agent team lifecycle. TeammateIdle fires when an agent teammate enters an idle state; TaskCompleted fires when a task is fully resolved.

For teams building automation pipelines on top of Claude Code — CI/CD integrations, notification systems, or orchestration tools coordinating multiple agent teams — these hooks provide the integration points needed to react to agent state changes in real time. A TeammateIdle hook could trigger work reassignment, while a TaskCompleted hook could update an external project management system or kick off downstream processes.

Memory Frontmatter for Agents

Agents in Claude Code can now declare a memory frontmatter field in their configuration files. This field allows an agent to carry forward persistent context across sessions or task handoffs — giving agents a structured mechanism to retain relevant state without relying solely on conversation history.

This is a meaningful addition for long-running agentic workflows where agents need to maintain awareness of prior decisions, accumulated knowledge, or ongoing constraints. The memory frontmatter approach keeps context explicit and version-controllable, since it lives in the agent's definition file rather than in ephemeral session state.

Granular Agent Spawning Control

A new Task(agent_type) parameter restricts which types of agents can be spawned by a given task. This provides governance for teams running Claude Code in environments where agent proliferation must be controlled — for example, ensuring that a customer-facing agent can only spawn read-only research agents rather than agents with write or execution permissions.

Combined with subagent skills declaration, this gives developers precise control over the agent dependency graph in multi-agent architectures.

Additional Changes

The same release includes OAuth support for remote VS Code sessions, resolving a gap for developers running Claude Code on remote machines or in development containers. The session picker now displays git branch and message count alongside each session entry, making it easier to identify and resume the correct session when working across multiple feature branches.