
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@claudemini/shit-cli
Advanced tools
Session-based Hook Intelligence Tracker
A memory system for human-AI coding sessions. Tracks what happened, classifies intent and risk, and provides structured data for code review automation.
Supports Claude Code, Gemini CLI, Cursor, and OpenCode.
npm install -g @claudemini/shit-cli
cd /path/to/your/project
shit enable # Setup hooks + .shit-logs
# ... use Claude Code normally ...
shit list # See sessions
shit status # Check current session
npm install -g @claudemini/shit-cli
Or use directly without installing:
npx @claudemini/shit-cli <command>
shit enable # Enable for Claude Code (default)
shit enable gemini-cli # Enable for Gemini CLI
shit enable --all # Enable for all supported agents
shit enable --checkpoint # Also create checkpoints on git commit
shit disable # Remove hooks (keep data)
shit disable --clean # Remove hooks and all data
shit init # Low-level: register hooks in .claude/settings.json
shit status # Show current session + git info
shit list # List all sessions with type, risk, intent
shit view <session-id> # View semantic session report
shit view <session-id> --json # Include raw JSON data
shit review [session-id] # Run structured code review from session data
shit review --json # Machine-readable findings (structured schema)
shit review # goatchain Agent-driven review
shit review --recent=3 --md # Aggregated Markdown report for PR comments
shit review --strict --fail-on=medium # CI gate by severity threshold
shit explain <session-id> # Human-friendly explanation of a session
shit explain <commit-sha> # Explain a commit via its checkpoint
shit review options:
--recent=<n> review latest n sessions (default 1)--all review all sessions in .shit-logs--min-severity=<info|low|medium|high|critical> filter findings--fail-on=<info|low|medium|high|critical> strict-mode failure threshold (default high)--agent-timeout-ms=<ms> total timeout for the review agent (default: 60s base + 30s per session)--allow-worktree-diff allow worktree fallback diff when checkpoint commits are unavailable--agent-auto-approve=<bool> auto approve agent tool calls (default true)--no-agent-auto-approve disable auto approval for agent tool calls--agent deprecated alias (accepted but ignored)--engine=<name> deprecated alias (accepted but ignored)--strict exit code 1 when findings reach --fail-on--json output structured JSON--markdown / --md output Markdownshit query --recent=5 # Recent 5 sessions
shit query --file=src/auth/auth.service.ts # Sessions that modified this file
shit query --type=bugfix # All bugfix sessions
shit query --risk=high # High-risk sessions
shit query --type=feature --json # JSON output for bot consumption
shit checkpoints # List all checkpoints
shit commit # Manually create checkpoint for current HEAD
shit rewind <checkpoint> # Rollback to a checkpoint (git reset --hard)
shit rewind --interactive # Choose from available checkpoints
shit resume <checkpoint> # Restore session data from a checkpoint
shit reset --force # Delete checkpoint for current HEAD
shit doctor # Diagnose issues (corrupted state, stuck sessions)
shit doctor --fix # Auto-fix detected issues
shit shadow # List shadow branches
shit shadow info <branch> # Show branch details
shit clean --days=7 --dry-run # Preview cleanup
shit clean --days=7 # Delete sessions older than 7 days
shit summarize <session-id> # Generate AI summary (requires API key)
| Command | Description |
|---|---|
enable | Enable shit-cli in repository (multi-agent support) |
disable | Remove hooks, optionally clean data |
status | Show current session and git info |
init | Register hooks in .claude/settings.json |
log <type> | Log a hook event from stdin (called by hooks) |
list | List all sessions with type, intent, risk |
view <id> | View semantic session report |
review [id] | Run agent-driven code review (goatchain, single or multi-session) |
query | Query session memory across sessions |
explain <id> | Human-friendly explanation of a session or commit |
commit | Create checkpoint on git commit |
checkpoints | List all checkpoints |
rewind <cp> | Rollback to a checkpoint |
resume <cp> | Resume session from a checkpoint |
reset | Delete checkpoint for current HEAD |
summarize <id> | Generate AI summary for a session |
doctor | Diagnose and fix issues |
shadow | List/inspect shadow branches |
clean | Clean old sessions |
webhook | Show/test webhook configuration |
Human <-> AI Agent (Claude Code, Gemini CLI, ...)
| (hooks)
Event Ingestion (log.js)
|
Semantic Extraction (extract.js)
|
Session State (session.js) + Reports (report.js)
|
Memory System (.shit-logs/ + index.json)
|
Agent Review (goatchain) / Human Queries
events.jsonl.summary.json (bot-readable), summary.txt (human-readable), context.md, metadata.json, and prompts.txt are regenerated on every event.All configuration lives in .shit-logs/config.json. Environment variables override file config.
{
"provider": "openai",
"api_key": "sk-...",
"model": "gpt-4o-mini",
"openai_base_url": "https://api.openai.com/v1",
"openai_endpoint": "",
"max_tokens": 1000,
"temperature": 0.7,
"webhooks": {
"url": "https://example.com/hook",
"events": ["session.ended", "review.completed"],
"secret": "",
"auth_token": "",
"headers": {},
"timeout_ms": 5000,
"retry": 1
},
"env": {
"SHIT_WEBHOOK_URL": "",
"SHIT_WEBHOOK_SECRET": "",
"SHIT_WEBHOOK_EVENTS": ""
}
}
| Field | Description | Default |
|---|---|---|
provider | "openai" or "anthropic" | "openai" |
api_key | API key for the provider | — |
model | Model ID for summarize / review | "gpt-4o-mini" |
openai_base_url | OpenAI-compatible base URL | "https://api.openai.com/v1" |
openai_endpoint | Full endpoint URL (overrides openai_base_url) | — |
max_tokens | Max tokens for AI summary | 1000 |
temperature | Temperature for AI summary | 0.7 |
webhooks | Webhook configuration object (see Webhook) | — |
env | Environment variable overrides (lower priority than real env vars) | — |
OpenAI-compatible provider (e.g. MiniMax, DeepSeek, Together):
{
"provider": "openai",
"api_key": "sk-...",
"model": "your-model-id",
"openai_base_url": "https://api.your-provider.com/v1"
}
Anthropic:
{
"provider": "anthropic",
"api_key": "sk-ant-...",
"model": "claude-3-haiku-20240307"
}
With webhook:
{
"provider": "openai",
"api_key": "sk-...",
"model": "gpt-4o-mini",
"webhooks": {
"url": "https://hooks.slack.com/services/xxx",
"events": ["session.ended", "review.completed"]
}
}
.shit-logs/
├── index.json # Cross-session index
└── <session-id>/
├── events.jsonl # Raw hook events
├── state.json # Incremental processing state
├── summary.json # Bot data interface (v2)
├── summary.txt # Human-readable report
├── context.md # Session context (Entire-style)
├── prompts.txt # User prompts with timestamps
├── metadata.json # Lightweight session metadata
└── ai-summary.md # AI-generated summary (optional)
{
"version": "2.0",
"session": {
"id": "f608c31e...",
"start": "2026-02-27T10:00:00Z",
"end": "2026-02-27T10:45:00Z",
"duration_minutes": 45,
"type": "bugfix",
"intent": "Fix authentication timeout issue",
"risk": "medium",
"summary": "Fixed: Fix authentication timeout issue"
},
"changes": {
"files": [{ "path": "src/auth.ts", "category": "source", "operations": ["edit"] }],
"summary": { "source": 3, "test": 1 }
},
"activity": {
"tools": { "Read": 15, "Edit": 3, "Bash": 5 },
"commands": { "test": ["npm run test"], "git": ["git status"] },
"errors": []
},
"review_hints": {
"tests_run": true,
"build_verified": false,
"files_without_tests": ["src/auth.ts"],
"large_change": false,
"config_changed": false,
"migration_added": false
},
"prompts": [{ "time": "...", "text": "Fix the auth timeout bug" }],
"scope": ["auth"]
}
| Type | Description |
|---|---|
bugfix | Bug fixes |
feature | New features |
refactor | Code restructuring |
debug | Investigation/debugging |
test | Test writing/updates |
docs | Documentation |
devops | CI/CD, deployment |
upgrade | Dependency updates |
config | Configuration changes |
style | Formatting, UI |
security | Security-related |
perf | Performance optimization |
import { readFileSync } from 'fs';
// Read session data
const summary = JSON.parse(readFileSync('.shit-logs/<id>/summary.json', 'utf-8'));
// Check review hints
if (!summary.review_hints.tests_run && summary.changes.files.length > 0) {
review.warn('Files modified but no tests run');
}
if (summary.review_hints.migration_added) {
review.flag('Database migration requires careful review');
}
// Query file history via index
const index = JSON.parse(readFileSync('.shit-logs/index.json', 'utf-8'));
const history = index.file_history['src/auth/auth.service.ts'];
if (history && history.length > 3) {
review.note('This file has been modified frequently');
}
shit-cli can send webhook notifications to external systems (Slack, Lark, CI, custom platforms) when key events occur.
| Event | Trigger | Payload |
|---|---|---|
session.ended | Session ends (hook session-end / stop) | summary.json content |
review.completed | shit review finishes | Review report |
Webhook supports three configuration sources (highest priority first):
1. Environment variables (highest priority):
export SHIT_WEBHOOK_URL=https://example.com/hook
export SHIT_WEBHOOK_SECRET=my-secret # HMAC-SHA256 signing
export SHIT_WEBHOOK_AUTH_TOKEN=bearer-token # Bearer auth (alternative to secret)
export SHIT_WEBHOOK_EVENTS=session.ended,review.completed
2. .shit-logs/config.json env field:
{
"env": {
"SHIT_WEBHOOK_URL": "https://example.com/hook",
"SHIT_WEBHOOK_SECRET": "my-secret",
"SHIT_WEBHOOK_EVENTS": "session.ended,review.completed"
}
}
3. .shit-logs/config.json webhooks field (lowest priority):
{
"webhooks": {
"url": "https://example.com/hook",
"events": ["session.ended", "review.completed"],
"secret": "hmac-secret-key",
"headers": { "X-Custom": "value" },
"timeout_ms": 5000,
"retry": 1
}
}
secret or SHIT_WEBHOOK_SECRET. Adds X-Signature-256: sha256=<hex> header (GitHub-compatible format).auth_token or SHIT_WEBHOOK_AUTH_TOKEN. Adds Authorization: Bearer <token> header.{
"event": "session.ended",
"timestamp": "2026-03-03T12:00:00.000Z",
"payload": { ... }
}
shit webhook # Show current webhook configuration
shit webhook --test # Send a test ping to the configured URL
Set one of these environment variables to enable AI-powered session summaries:
export OPENAI_API_KEY=sk-... # Uses gpt-4o-mini by default
export OPENAI_BASE_URL=https://api.openai.com/v1 # Optional: OpenAI-compatible base URL
export AI_MODEL=gpt-5-mini # Optional: universal model override (all providers)
export ANTHROPIC_API_KEY=sk-... # Uses claude-3-haiku by default
Then run:
shit summarize <session-id>
| Variable | Description |
|---|---|
SHIT_LOG_DIR | Custom log directory (default: .shit-logs in project root) |
OPENAI_API_KEY | Enable AI summaries via OpenAI |
OPENAI_BASE_URL | OpenAI-compatible base URL for summaries (default: https://api.openai.com/v1) |
OPENAI_ENDPOINT | Full OpenAI-compatible endpoint (overrides OPENAI_BASE_URL) |
AI_MODEL | Universal model override for summaries (applies to all providers) |
OPENAI_MODEL | OpenAI-only model override (takes precedence over AI_MODEL for OpenAI) |
ANTHROPIC_API_KEY | Enable AI summaries via Anthropic |
ANTHROPIC_MODEL | Anthropic-only model override (takes precedence over AI_MODEL for Anthropic) |
SHIT_REVIEW_AGENT_TIMEOUT_MS | Agent review timeout in milliseconds (default: 60s base + 30s per session) |
SHIT_REVIEW_AUTO_APPROVE | Auto approve agent tool calls (true/false, default: true) |
SHIT_WEBHOOK_URL | Webhook endpoint URL |
SHIT_WEBHOOK_SECRET | HMAC-SHA256 signing secret for webhooks |
SHIT_WEBHOOK_AUTH_TOKEN | Bearer token for webhook authentication |
SHIT_WEBHOOK_EVENTS | Comma-separated list of webhook events to subscribe to |
shit summarize also accepts OpenAI-compatible responses where completion text is returned via reasoning_content instead of content.
.shit-logs/ (added to .gitignore automatically)Special thanks to goatchain for powering the agent-driven review workflow in shit review.
FAQs
Session-based Hook Intelligence Tracker for human-AI coding sessions
The npm package @claudemini/shit-cli receives a total of 12 weekly downloads. As such, @claudemini/shit-cli popularity was classified as not popular.
We found that @claudemini/shit-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.