# Cognitive Spawn

> Avvia i watcher cognitivi in background (inhibit, error, cleanup). Sono daemon bash che fanno tail del transcript della sessione corrente + check periodici sul filesystem, scrivono alert in ~/.claude-cognitive-alerts/, e il PostToolUse hook li consegna al modello prima del prossimo tool call. Invoca ad inizio sessione di lavoro non triviale, dopo /clear, o quando vuoi monitoring real-time attivo.…

- **Type:** Skill
- **Install:** `agentstack add skill-tommasobbianchi-claude-cognitive-skills-cognitive-spawn`
- **Verified:** Pending review
- **Seller:** [tommasobbianchi](https://agentstack.voostack.com/s/tommasobbianchi)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [tommasobbianchi](https://github.com/tommasobbianchi)
- **Source:** https://github.com/tommasobbianchi/claude-cognitive-skills/tree/main/skills/cognitive-spawn

## Install

```sh
agentstack add skill-tommasobbianchi-claude-cognitive-skills-cognitive-spawn
```

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

## About

# Cognitive-Spawn — sentinelle in background

**Principio**: i sottosistemi di controllo girano in **processi separati** dal main, osservano transcript+filesystem, e injettano alert via hook `PostToolUse` prima del prossimo tool call mutativo. Vedi `/cognitive-flow` per il modello completo.

## Come avviarli

Identifica il transcript della sessione corrente e lancia:

```bash
TRANSCRIPT=$(ls -t ~/.claude/projects/$(pwd | sed 's|/|-|g')/*.jsonl | head -1)
~/.claude/cognitive-watchers/spawn.sh start "$TRANSCRIPT" "$PWD"
```

Lo script avvia 3 daemon (PID files in `~/.claude-cognitive-alerts/.pids/`):

| Watcher | Cosa fa | Sleep |
|---|---|---|
| `inhibit` | tail del transcript JSONL; detect comandi Bash ad alto blast radius (rm -rf, git push --force, deploy, scp, drop table) | 2 s |
| `error` | tail del transcript; detect tool_result con `is_error=true` | 2 s |
| `cleanup` | check periodico del working tree del cwd + /tmp residui | 60 s |

## Come usarli

Niente — sono passivi. Quando producono un alert, il file appare in `~/.claude-cognitive-alerts/.alert`. Al prossimo tool call mutativo (Bash, Edit, Write, Task), il hook `PostToolUse` registrato in `~/.claude/settings.json` li legge, formatta su stderr, exit 2 → il modello riceve l'alert come system-reminder e DEVE addressarlo prima di proseguire.

## Verifica / stop

```bash
~/.claude/cognitive-watchers/spawn.sh status   # quali girano + alert pendenti
~/.claude/cognitive-watchers/spawn.sh stop     # termina tutti
```

## Auto-start a session start (opzionale)

Per averli sempre attivi senza invocazione manuale, aggiungi un hook SessionStart in `~/.claude/settings.json` che lancia `spawn.sh start` con il transcript della sessione (variabile passata dal JSON stdin del hook).

## File correlati

- watcher scripts: `~/.claude/cognitive-watchers/{inhibit,error,cleanup}-watcher.sh`
- orchestratore: `~/.claude/cognitive-watchers/spawn.sh`
- hook delivery: `~/.claude/cognitive-watchers/post-tool-hook.sh`
- dir alert: `~/.claude-cognitive-alerts/`
- log daemon: `~/.claude-cognitive-alerts/.logs/`
- skill compagne: `/cognitive-stop`, `/cognitive-flow`, `/inhibit`, `/cleanup-check`, `/error-check`

## Source & license

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

- **Author:** [tommasobbianchi](https://github.com/tommasobbianchi)
- **Source:** [tommasobbianchi/claude-cognitive-skills](https://github.com/tommasobbianchi/claude-cognitive-skills)
- **License:** MIT

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: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-tommasobbianchi-claude-cognitive-skills-cognitive-spawn
- Seller: https://agentstack.voostack.com/s/tommasobbianchi
- 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%.
