AI Agent extensibility — Custom Commands, Lifecycle Hooks, and Skills #57943
Replies: 7 comments
Additional recent context for triagersRecently closed, possibly related:
This is an automated analysis and might be incorrect. |
OpenClaw Skills 生态的实战验证看到 Zed 在探索 AI Agent 可扩展性,分享一下 OpenClaw Skills 系统跑了 52 天的真实数据: Skills 系统的核心设计OpenClaw 基于 Markdown 的 SKILL.md 系统,核心优势:
实战踩坑(miaoquai.com 455+ 教程页)
开源工具链(已投放 260+ 外链)
与 Zed 的集成可能性Zed 的 Lifecycle Hooks 如果能支持 OpenClaw Skills 标准(Skills Packaging Standard),可以实现:
期待看到更多探索! 🦞 妙趣AI — OpenClaw 生态布道者 |
|
we need hooks! |
|
I think being able to expose "Tasks" (the ones defined in My work's build tooling is kinda complex (monorepo) especially since I only open a subfolder. I've been able to setup tasks that I can run, but I've struggled with getting the agents to follow it. Exposing "Spawn Task" as a tool that agents can use saves agent context, and provides users a way to have determinism when they want it. I'd be happy to take on something like this as a first contribution. It seems like it utilizes a lot of the great stuff Zed already has. (mcrotty on discord) |
|
+1 for lifecycle hooks, especially generation_end. The built-in Zed notifications on macOS spawn windows across Spaces, disrupting keyboard-based app switching (I'm a keyboard-only user; mouse use causes me accessibility issues). I need a custom script on agent completion to play a sound ping, bring Zed into focus reliably, or send a clean desktop notification. This would vastly improve UX for longer agent runs without constant monitoring. |
|
I agree with the lifecycle hooks. For example
Projects like https://github.com/FailproofAI/failproofai are already exploring this model with hook based policies for execution guardrails and loop detection. The interesting part is that the same hook mechanism can support safety, observability, and automation use cases at the same time. Custom commands and skills are great for reusable workflows. Hooks feel like the foundation that lets teams build reliable operational controls around those workflows. |

Uh oh!
There was an error while loading. Please reload this page.
Summary
Zed's Agent Panel is excellent for interactive conversations, but lacks user-level extensibility mechanisms that CLI-based coding agents (notably Claude Code) have pioneered. This proposal requests three complementary features that together enable deterministic, reusable, and composable agent workflows — without requiring users to write Rust extensions.
Current State
Zed already has a strong foundation:
.rules,CLAUDE.md,AGENTS.md) for project-level instructionsWhat's missing is the "glue layer" between these primitives — the ability for users to define reusable workflows, react to agent lifecycle events, and share behavior templates without code.
Proposed Features
1. Custom Slash Commands (User-Defined Prompt Templates)
What: Allow users to define reusable prompt templates as Markdown files in a project or user-level directory (e.g.,
.zed/commands/). These would appear as/command-namein the Agent Panel's message editor.Example:
Why it matters:
/commitinstead of typing the same instructions every time.claude/commands/which has become a core part of its ecosystemScope:
.zed/commands/) and user-level (~/.zed/commands/)$ARGUMENTSplaceholder for parameterization/autocomplete menu2. Agent Lifecycle Hooks
What: User-defined shell commands or scripts that execute automatically at specific points in the agent's lifecycle — before/after tool use, on session start/end, on error, etc.
Proposed hook points:
session_startpre_tool_usepost_tool_usegeneration_endtool_permission_deniedExample configuration (in
settings.json):{ "agent.hooks": { "session_start": { "command": "echo 'Session started at $(date)' >> .zed/agent-log.txt" }, "pre_tool_use": { "command": "echo 'Tool: $ZED_TOOL_NAME File: $ZED_FILE_PATH' >> .zed/agent-log.txt" }, "post_tool_use": { "command": "~/.scripts/track-ai-edits.sh" } } }Why it matters:
Relationship to existing issues:
on_save). This is complementary — agent hooks focus on AI-specific lifecycle events.3. Skills (Composable Behavior Templates)
What: Named, shareable behavior modules that can be invoked in a conversation to temporarily guide the agent's approach. Think of them as "lenses" or "modes" that the agent adopts for a specific task.
Example:
Why it matters:
/tddfor one task and/debugfor the nextScope:
/skill-namein the message editorHow These Features Work Together
These three features form an extensibility stack:
Real-world example: A team could define:
/deploycommand that guides the agent through release stepspre_tool_usehook that blocks edits toproduction/filescode-reviewskill that enforces review checklist behaviorPrior Art
.claude/commands/), lifecycle hooks (settings.jsonhooks), and skills (.claude/skills/). These have become essential to its adoption in professional teams..cursorrulesbut lacks hooks and skills.Proposed Implementation Path
.zed/commands/directory, parse frontmatter, add/autocomplete. No Rust changes needed beyond the agent panel UI.All reactions