# Hook

> Create Claude Code hooks with standardized structure. Generates complete hook scaffolds with setup commands, logging, and Claude config integration. Just run `hook` to create a new hook template.

- **Type:** Skill
- **Install:** `agentstack add skill-hasna-skills-hook`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hasna](https://agentstack.voostack.com/s/hasna)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [hasna](https://github.com/hasna)
- **Source:** https://github.com/hasna/skills/tree/main/skills/hook

## Install

```sh
agentstack add skill-hasna-skills-hook
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Hook Creation Skill

Creates Claude Code hook scaffolds following a standardized pattern. Run `hook` in any directory to generate a complete hook project.

## Quick Start

```bash
# Install globally
bun add -g git+ssh://git@github.com/example/hook.git

# Create a hook (interactive)
hook

# Or with a name directly
hook my-hook
```

## What Gets Created

Running `hook ` creates:

```
hook-/
├── src/
│   ├── index.ts              # CLI entry point
│   ├── commands/
│   │   ├── run.ts            # Main hook logic
│   │   ├── setup.ts          # Setup command
│   │   ├── test.ts           # Manual testing
│   │   └── config.ts         # Configuration management
│   ├── core/
│   │   └── .ts         # Hook-specific logic (implement here)
│   └── utils/
│       ├── logger.ts         # Configurable logging
│       └── claude.ts         # Claude config helpers
├── hook.config.json          # Self-describing metadata
├── package.json
├── tsconfig.json
├── bunfig.toml
├── README.md
└── HOOK.md
```

## Usage

```bash
hook [name] [options]

Options:
  --event      PreToolUse, PostToolUse, or Stop (default: PreToolUse)
  --matcher    Tool matcher: Bash, Write, Edit, * (default: *)
  --output       Output directory (default: current)
  --help              Show help
```

## Hook Events

| Event | When | Can Block |
|-------|------|-----------|
| PreToolUse | Before tool executes | Yes |
| PostToolUse | After tool executes | No |
| Stop | When agent stops | No |

## After Creating

1. `cd hook-`
2. `bun install`
3. Edit `src/core/.ts` - implement your logic
4. Test: `bun run src/index.ts test`
5. Push to GitHub
6. Install: `bun add -g git+ssh://git@github.com/example/hook-.git`
7. Setup: `hook- setup`

## Hook Output Format

```typescript
{ "decision": "allow" }                           // Allow operation
{ "decision": "block", "reason": "Why blocked" }  // Block (PreToolUse only)
{ "decision": "error", "message": "Error msg" }   // Error occurred
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hasna](https://github.com/hasna)
- **Source:** [hasna/skills](https://github.com/hasna/skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hasna-skills-hook
- Seller: https://agentstack.voostack.com/s/hasna
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
