{"version":"2.1.296","anchor":"skills-accept-formatforegroundforkresult","canonical_anchor":"skills-accept-formatforegroundforkresult","heading":"Forked skill and slash command results can pass through a formatter; async agent failures carry a cause","tier":"internal","area":"Skills","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296\/e\/skills-accept-formatforegroundforkresult","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296","markdown":"### Forked skill and slash command results can pass through a formatter; async agent failures carry a cause\n\nSkills can supply a formatForegroundForkResult hook to reshape foreground forked results, and failed background agents now record a cause\n\n**What**\n\nSkills and slash commands can run \"forked\", meaning in a separate side conversation whose result is handed back to the main one. When that runs in the foreground (you wait for it to finish), its result can now be reshaped before it is used:\n\n- `formatForegroundForkResult` is a new optional hook on skill definitions. A hook here is a piece of code the skill provides that Claude Code calls at a set moment. It receives the result of a foreground forked skill or slash command and can reformat it. Before, the result text was used as it was.\n\n- If that hook throws an error, the error is logged as \"fork result formatter threw\".\n\n- Agents running in the background (async agents) now carry a cause when they fail, such as `stalled`, `error`, or `api_error:kind`.\n\n**Why**\n\nFor most people this is plumbing they will not notice. Skill authors gain a way to shape what a forked run hands back. A recorded failure cause makes it possible to tell a background agent that stalled from one that hit an error.\n\n- Area: Skills\n- Names: `formatForegroundForkResult`\n- Tier: Under the hood\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}