Work with plugin

Use plugin when you need to claude code plugin — skills, hooks, commands, and mcp config.

Prerequisites

Steps

  1. Understand the current behavior. Read the entry points to see what plugin does today before making changes. The primary functions are:

    • main() in plugin/hooks/_handoff_cli.py
    • build_resume_prompt() in plugin/hooks/_resume_prompt.py — Render the user-facing resume prompt body.
    • discover_specs() in plugin/hooks/_state.py — Walk specs/ directories under each root for in-flight specs.
    • git_state() in plugin/hooks/_state.py — Return branch, last commit, and uncommitted files for cwd.
    • session_sentinel_path() in plugin/hooks/_state.py — Path to the once-per-session compact-warning sentinel.
  2. Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.

  3. Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.

  4. Run the related tests. This catches regressions before they reach other developers. Target with pytest -k "plugin".

Key files

Common modifications

Functions you are most likely to modify: