Lifecycle hooks, quality gates, knowledge engine, and dispatch utilities for Claude Code sessions.
Core CLI hooks and utilities that integrate with Claude Code's lifecycle:
- bootstrap — Session bootstrap that initializes bus state, knowledge engine, and identity tracking.
- session-start / session-end — Hooks called at session boundaries for setup and teardown.
- pre-compact — Pre-compaction hook for context preservation before session compaction.
- pre-commit — Quality gate that runs ruff, mypy, and pytest before allowing commits.
- standards-guard — PreToolUse hook that blocks forbidden content in standards docs and workflow files.
- post-tool-use — PostToolUse hook that detects errors and triggers incident response.
- check-model-vision — Detects vision capability for configured Ollama models.
- dispatch — Workflow dispatch engine for multi-stage agent pipelines.
- statusline — Generates session statusline output.
Knowledge base pipeline for ingesting, compiling, and querying markdown content:
- ingest — Converts raw markdown files into tracked JSON artifacts.
- compile — Aggregates daily logs into structured knowledge articles.
- query — Semantic search over the knowledge base using TF-IDF.
- validate — Structural consistency checks (broken links, orphans, stale articles).
- engine — Orchestrates the full ingest-compile-validate pipeline.
Quality gates and mode management for enforcing code standards:
- modes — Operational mode system (developer, research, review, ops, personal).
- gate — Quality gate evaluation with configurable thresholds.
- schemas — Validation schemas for structured data.
- precedents — Precedent tracking for quality decisions.
- anti-gaming — Metrics to detect and prevent gaming of quality systems.
uvx --from git+https://github.com/BrainXio/claude-cli claude-bootstrapclaude-bootstrapclaude-pre-commitclaude-knowledge ingest /path/to/source --dry-runclaude-knowledge compile --dry-runclaude-knowledge query "how does the dispatch engine work"claude-knowledge validateclaude-dispatch my-workflow --dry-runclaude-check-model-vision# Read last N messages
claude-bus read 10
# Write a message
claude-bus write '{"content":"status","from":"session","to":"all","type":"status"}'
# Claim next unclaimed message
claude-bus claim| Command | Purpose |
|---|---|
claude-bootstrap |
Session bootstrap (bus, KB engine setup) |
claude-session-start |
Session start hook (model capability detect) |
claude-session-end |
Session end hook (cleanup, summary) |
claude-pre-compact |
Pre-compaction hook (context preservation) |
claude-pre-commit |
Pre-commit hook (ruff, mypy, pytest) |
claude-standards-guard |
PreToolUse hook — standards enforcement |
claude-post-tool-use |
PostToolUse hook — error detection & incident response |
claude-check-model-vision |
Detect Ollama vision capability |
claude-dispatch |
Workflow dispatch utility |
claude-knowledge |
Knowledge engine CLI |
claude-statusline |
Statusline generator |
claude-commit |
Automated commits with rule enforcement |
claude-bus |
Inter-session bus CLI (read, write, claim) |
uv run pytest # Run tests
uv run ruff check . # Lint
uv run ruff format . # Format
uv run mypy src/ --strict # Type checkQuality gates: ruff, mypy strict, pytest with 90% coverage threshold.
- BrainXio/claude-config — Framework configuration for
.claude/settings, agents, rules, skills, and workflows. This package is designed to work alongsideclaude-configto provide the full Claude Code extension framework.