Skip to content
Testing
Hook

Hooks

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

From plugin
lintlang
1472 skills1 hook

Claude Code

> /plugin marketplace add hermes-labs-ai/lintlang
> /plugin install lintlang@lintlang

What fires, and when

AfterTool

  • Matches^(write_file|replace)$uv run --quiet --no-project --with PyYAML==6.0.3 -- python "${extensionPath}${/}hooks${/}lintlang_after_tool.py"
Read hooks/hooks.json

Where it lives

  • hooks/lintlang_after_tool.pyGitHub
    Read the script
    #!/usr/bin/env python3
    """Gemini CLI AfterTool adapter for the bundled LintLang source."""
    
    from __future__ import annotations
    
    import json
    import sys
    from pathlib import Path
    from typing import Any
    
    SUPPORTED_SUFFIXES = {".json", ".md", ".prompt", ".py", ".txt", ".yaml", ".yml"}
    MAX_FINDINGS = 8
    
    
    def _emit(context: str | None = None) -> None:
        output: dict[str, Any] = {}
        if context:
            output["hookSpecificOutput"] = {
                "hookEventName": "AfterTool",
                "additionalContext": context,
            }
        print(json.dumps(output))
    
    
    def _display_path(path: Path, cwd: str | None) -> str:
        if cwd:
            try:
                return str(path.resolve().relative_to(Path(cwd).resolve()))
            except ValueError:
                pass
        return str(path)
    
    
    def _format_result(path: str, verdict: str, result: Any) -> str | None:
        if getattr(result, "skipped", None) and not result.input_error:
            return None  # nothing agent-facing in the edited file: nothing to say
        if result.input_error:
            return f"LintLang could not scan {path}: {result.input_error}"
        findings = result.structural_findings
        if not findings:
            return None
    
        lines = [
            f"LintLang found {len(findings)} issue(s) in {path} (verdict: {verdict}).",
            "Repair the applicable findings, then preserve the user's requested behavior:",
        ]
        for finding in findings[:MAX_FINDINGS]:
            severity = finding.severity.value.upper()
            lines.append(
                f"- [{severity} {finding.code}] {finding.location}: {finding.description} "
                f"Suggested repair: {finding.suggestion}"
            )
        if len(findings) > MAX_FINDINGS:
            omitted = len(findings) - MAX_FINDINGS
            lines.append(f"- {omitted} additional finding(s) omitted; run `lintlang scan {path}` for all details.")
        return "\n".join(lines)
    
    
    def main() -> int:
        try:
            event = json.load(sys.stdin)
        except (json.JSONDecodeError, OSError):
            _emit()
            return 0
    
        if event.get("hook_event_name") != "AfterTool":
            _emit()
            return 0
        if event.get("tool_name") not in {"write_file", "replace"}:
            _emit()
            return 0
        if (event.get("tool_response") or {}).get("error"):
            _emit()
            return 0
    
        raw_path = (event.get("tool_input") or {}).get("file_path")
        if not isinstance(raw_path, str):
            _emit()
            return 0
    
        cwd = event.get("cwd") if isinstance(event.get("cwd"), str) else None
        path = Path(raw_path)
        if not path.is_absolute() and cwd:
            path = Path(cwd) / path
        if path.suffix.lower() not in SUPPORTED_SUFFIXES or not path.is_file():
            _emit()
            return 0
    
        extension_root = Path(__file__).resolve().parents[1]
        sys.path.insert(0, str(extension_root / "src"))
        display_path = _display_path(path, cwd)
        try:
            from lintlang.report import compute_verdict
            from lintlang.scanner import scan_file
    
            result = scan_file(path)
            context = _format_result(display_path, compute_verdict(result), result)
        except Exception as error:
            context = f"LintLang could not scan {display_path}: {error}. Run `lintlang scan {display_path}` directly."
    
        _emit(context)
        return 0
    
    
    if __name__ == "__main__":
        raise SystemExit(main())
    

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.

@hermes-labs-ai
Ships withlintlang

Catch agent failures before your agent runs. LintLang is a local, deterministic static linter for the instructions and tool interfaces an AI agent is given.

Stars on GitHub

Momentum

stars in total
147
Star history of hermes-labs-ai/lintlang on GitHub, a chart by star-history.com

More plugins that ship hooks.

bkit

bkit

A Claude Code plugin that checks AI-generated code against its design specs, with audit logs, auth, and database skills for bkend.ai projects. Useful for developers reviewing code that an AI assistant wrote.

44 skills+3605
@popup-studio-ai@popup-studio-ai
Install Plugin
accessibility-agents

accessibility-agents

Catches accessibility problems while an AI coding assistant writes web interface code, so WCAG accessibility issues are caught before they ship. It also compares audits across commits to flag regressions and drafts an accessibility statement from the findings.

113 skills7 hooks449
@community-access@community-access
Install Plugin
atdd

atdd

A methodology kit for Claude Code that drives feature work through acceptance test driven development, with spec-first artifacts, architecture checks, and a CRAP analyzer for risk-based refactor and test plans on changed code.

28 skills+3164
@swingerman@swingerman
Install Plugin
velocitai

velocitai

Next-generation UI automation harness powered by Python & Playwright. Chat with AI Agents to seamlessly generate, architect, and execute enterprise-grade UI test code.

13 skills+2158
@danielsuo117@danielsuo117
Install Plugin
e2e-testing

e2e-testing

Runs a disciplined, test-first workflow for building features and fixing bugs in Claude Code. It brainstorms and plans before coding, reviews finished work against the plan, and guides Playwright end-to-end tests for Next.js and React apps, so you stop skipping tests and debugging by guesswork.

9 skills2 hooks16
@burhankhatri@burhankhatri
Install Plugin

Questions about the hooks in lintlang.

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