Skip to content

Hooks

What n8n-mcp-skills runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
n8n-mcp-skills
6.6k15 skills3 hooks

Claude Code

> /plugin marketplace add czlonkowski/n8n-skills
> /plugin install n8n-mcp-skills@n8n-mcp-skills

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • Matchesstartup|resume|clear|compact${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh

PreToolUse

  • Matches^mcp__.*__get_node$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/get-node.sh
  • Matches^mcp__.*__n8n_create_workflow$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/create-workflow.sh
  • Matches^mcp__.*__(n8n_update_partial_workflow|n8n_update_full_workflow)${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/update-workflow.sh
  • Matches^mcp__.*__(validate_workflow|n8n_validate_workflow)$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/validate-workflow.sh
  • Matches^mcp__.*__n8n_test_workflow$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/test-workflow.sh
  • Matches^mcp__.*__n8n_instances$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/instances.sh
  • Matches^mcp__.*__n8n_manage_credentials$${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use/manage-credentials.sh

PostToolUse

  • Matches^mcp__.*__validate_workflow$${CLAUDE_PLUGIN_ROOT}/hooks/post-tool-use/validate-workflow.sh
Read hooks/hooks.json

Where it lives

  • hooks/session-start.shRunsGitHub
    Read the script
    #!/usr/bin/env bash
    # Portions of this file are adapted from the n8n-io/skills plugin
    # (https://github.com/n8n-io/skills), licensed under Apache License 2.0.
    # Adapted for the community n8n-mcp MCP server. See /NOTICES.
    #
    # SessionStart hook for n8n-mcp-skills.
    # Loads the meta-skill (using-n8n-mcp-skills) into every session via additionalContext.
    # Re-fires on resume/clear/compact so the protocol survives compaction.
    #
    # On `clear` and `compact`, also wipes the PreToolUse hook markers for this
    # session so the per-node-type warnings can fire again. The agent's memory
    # of those warnings is gone after a clear/compact, so the markers shouldn't
    # keep them silent.
    #
    # Fails silently and never blocks session startup.
    
    set -uo pipefail
    
    PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
    META_SKILL="${PLUGIN_ROOT}/skills/using-n8n-mcp-skills/SKILL.md"
    CACHE_DIR="${HOME}/.cache/n8n-mcp-skills"
    mkdir -p "${CACHE_DIR}" 2>/dev/null || true
    
    INPUT="$(cat)"
    
    # --- Reset PreToolUse markers on clear/compact -------------------------------
    #
    # After /clear or /compact, the agent has lost the additionalContext that the
    # PreToolUse hooks injected earlier in the session. Without wiping markers,
    # the per-node warnings stay silent for the rest of the session even though
    # the agent no longer remembers them.
    
    if command -v jq >/dev/null 2>&1; then
      SOURCE="$(echo "${INPUT}" | jq -r '.source // empty' 2>/dev/null)"
      SESSION_ID="$(echo "${INPUT}" | jq -r '.session_id // empty' 2>/dev/null)"
    
      if [[ "${SOURCE}" == "clear" || "${SOURCE}" == "compact" ]] && [[ -n "${SESSION_ID}" ]]; then
        STATE_DIR="${TMPDIR:-/tmp}/n8n-mcp-skills-state"
        rm -f "${STATE_DIR}/${SESSION_ID}-"*.loaded 2>/dev/null || true
      fi
    fi
    
    # --- Build additionalContext --------------------------------------------------
    
    if [[ ! -r "${META_SKILL}" ]]; then
      # Skill missing or unreadable. Fail open with no context, don't break session.
      exit 0
    fi
    
    SKILL_BODY="$(cat "${META_SKILL}")"
    
    ADDITIONAL_CONTEXT="${SKILL_BODY}"
    
    # --- Emit hook output ---------------------------------------------------------
    
    # jq is the safe way to escape arbitrary text into JSON. Fall back to python3
    # if jq isn't installed (rare on macOS, possible on minimal Linux).
    if command -v jq >/dev/null 2>&1; then
      jq -n --arg ctx "${ADDITIONAL_CONTEXT}" '{
        hookSpecificOutput: {
          hookEventName: "SessionStart",
          additionalContext: $ctx
        }
      }'
    elif command -v python3 >/dev/null 2>&1; then
      python3 -c '
    import json, sys
    ctx = sys.stdin.read()
    print(json.dumps({
      "hookSpecificOutput": {
        "hookEventName": "SessionStart",
        "additionalContext": ctx
      }
    }))
    ' <<< "${ADDITIONAL_CONTEXT}"
    else
      # No JSON encoder available, skip injection rather than emit malformed JSON.
      exit 0
    fi
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

@czlonkowski
Ships withn8n-mcp-skills

Expert Claude Code skills for building flawless n8n workflows using the n8n-mcp MCP server

Stars on GitHub

Momentum

stars in total
6.6k
Star history of czlonkowski/n8n-skills on GitHub, a chart by star-history.com

More plugins that ship hooks.

claude-scholar

claude-scholar

A research assistant plugin for Claude Code that supports literature review, paper writing, citation verification, Zotero and Obsidian integration, and code review and debugging for academic and software work.

45 skills+35.9k
@galaxy-dawn@galaxy-dawn
Install Plugin
octo

octo

Runs multi-AI workflows in Claude Code that split research, requirements scoping, implementation and review across several external AI providers, such as Codex, Gemini-style CLIs, Copilot, Ollama and OpenRouter, to cover each model's blind spots.

71 skills+34.4k
@nyldn@nyldn
Install Plugin
ai-maestro

ai-maestro

Orchestrates multiple Claude Code agents across terminals and machines, giving them persistent memory and agent-to-agent messaging so you no longer have to relay messages between them by hand.

33 hooks1 MCP841
@23blocks-os@23blocks-os
Install Plugin
godotmaker

godotmaker

An autonomous pipeline that turns a text description into a playable Godot game, generating design docs, game assets such as backgrounds, characters, props, cards and effects, and running visual checks and playtests.

41 skills+2559
@randallliuxin@randallliuxin
Install Plugin
sutando

sutando

A personal AI assistant with voice, screen and meeting support that learns your patterns and can update its own code. It runs across several Macs and can talk with other people's assistants.

79 skills18 hooks401
@sonichi@sonichi
Install Plugin
nextboard-hardware-solution

nextboard-hardware-sol…

Helps hardware teams turn product requirements into a reviewable, buildable PCB design plan. Covers embedded architecture, MCU or SoC selection, power tree, interfaces, sensors, connectivity, and BOM risk.

1 skill+2395
@leokemp223@leokemp223
Install Plugin
claude-prompts

claude-prompts

MCP server for reusable prompt templates, multi-step workflow chains, and quality gates. Compose agentic workflows with an operator syntax; export as native skills to Claude Code, Cursor, OpenCode, and Gemini CLI.

5 hooks1 MCP191
@minipuft@minipuft
Install Plugin
crypto-trading-desk

crypto-trading-desk

A Claude Code plugin for crypto trading with skills to run multi-agent market analysis, track a portfolio and open trades, close trades with post-mortem review, and monitor stop-loss and take-profit levels on a schedule.

8 skills+2107
@hugoguerrap@hugoguerrap
Install Plugin

Questions about the hooks in n8n-mcp-skills.

Which coding agents can use the hooks in n8n-mcp-skills?
The hooks in n8n-mcp-skills install in Claude Code and Cursor: each runs Claude Code hooks from .claude/settings.json, so copy the hooks there.