Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
An orchestrator that governs, visualizes, and makes auditable AI agent workflows through external state machines.
state-gate is a plugin that governs, visualizes, and makes auditable the development and exploration work of AI agents like Claude Code through external state machines.
It treats agents not as "smart entities that remember processes," but as executors that generate and submit actions and artifacts required by the state machine.
state_gate_get_state: Get current state and promptstate_gate_emit_event: Emit event to transition statestate_gate_list_events: List available eventsstate_gate_create_run: Create a new Runstate_gate_list_runs: List all Runstool_permissions in process definition)state-gate uses npx, so the npm package must be published.
npm install -g @caphtech/state-gate
Or, npx will automatically download it on first execution.
# Add marketplace
/plugin marketplace add https://github.com/CAPHTECH/state_gate
# Install plugin
/plugin install state-gate
/plugin install https://github.com/CAPHTECH/state_gate/tree/main/plugin
Create a Run based on a process in your project directory:
state-gate create-run --process-id exploration-process --write-config
This saves the Run ID to .state_gate/state-gate.json and is automatically referenced in subsequent commands.
Check current state via MCP tool or CLI:
# CLI
state-gate get-state
# In Claude Code
Execute mcp__state-gate__state_gate_get_state
Follow the current state's prompt to perform work and create artifacts.
After completing work, emit an event with artifacts:
# As MCP tool
Use mcp__state-gate__state_gate_emit_event and specify:
- event_name: Event name to emit
- expected_revision: Current revision number
- idempotency_key: Unique key
- artifact_paths: Array of created artifact paths
state_gate evaluates guard conditions and automatically transitions to the next state if conditions are met. The PostToolUse hook automatically displays the new state's prompt.
Place processes in .state_gate/processes/*.yaml.
Example: .state_gate/processes/exploration-process.yaml
id: exploration-process
name: Exploration Process
initial_state: idle
states:
- name: idle
description: Waiting for task
prompt: "Receive task and emit 'start' event"
tool_permissions:
allowed: []
- name: exploring
description: Exploring the codebase
prompt: "Explore the codebase and record in exploration.md"
required_artifacts:
- path: evidence/exploration.md
tool_permissions:
allowed: [Read, Glob, Grep, Write]
denied: [Edit, Bash]
# ...
events:
- name: start
description: Start exploration
- name: submit_exploration
description: Submit exploration results
# ...
transitions:
- from: idle
event: start
to: exploring
- from: exploring
event: submit_exploration
to: done
guards:
- type: artifact_exists
paths: ["evidence/exploration.md"]
# ...
Define tool_permissions in each state, and the PreToolUse hook will automatically check permissions:
allowed: List of tools to allowdenied: List of tools to denyask: List of tools requiring user confirmationPriority: denied > ask > allowed
# Check MCP server status
claude mcp list
# Try starting manually
npx -y @caphtech/state-gate serve
# Check hooks configuration
cat ~/.claude/settings.json | jq '.hooks'
# Check if plugin is correctly installed
/plugin list
Verify that .state_gate/state-gate.json exists:
cat .state_gate/state-gate.json
MIT
For Issues and Pull Requests, visit the GitHub repository.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub caphtech/state_gate --plugin state-gatePlugins from other owners that cover similar ground