Chef 11 introduces event dispatching mechanism, which emits event at different milestones in Chef run (aka lifecycle) , and users can add their custom handlers to hook into these events. Chef formatters already uses this API. For a complete list of currently available events check this
Following is a bare minimal example for adding a custom handler:
require 'chef/event_dispatch/base'
class Foo < Chef::EventDispatch::Base
# lets say hello world when chef run ends
def run_completed(node)