Claude Pace Maker
Intelligent credit consumption throttling and code quality enforcement for Claude Code.
Features
- Credit Throttling: Adaptive pacing for 5-hour and 7-day usage windows
- Stale Data Detection: Resilient pacing calculations when usage data is outdated
- Model Preference: Nudges Claude to use specific model for subagents (quota balancing)
- Intent Validation: Requires intent declaration before code modifications
- TDD Enforcement: Core code paths require test declarations
- Clean Code Checks: Blocks security vulnerabilities, anti-patterns, and logic bugs
- Folder Exclusion: Exclude paths from TDD/Clean Code enforcement
- Session Lifecycle: Prevents premature session endings via AI validation
- Langfuse Telemetry: Optional tracing integration with Langfuse for session/trace/span tracking
- Blockage Telemetry: Track and report validation blocks via
pace-maker blockage-stats
- Daily Log Rotation: Automatic log rotation (one file per day, 15 days retention)
- Enhanced Status Display: Shows versions, Langfuse connectivity, and error counts
- Prompt Intelligence (Intel): Optional per-prompt metadata (frustration, specificity, task type, quality, iteration) attached to Langfuse traces for dashboard analytics
- Secrets Management: Sanitizes sensitive data from Langfuse trace outputs
- Langfuse Auto-Provisioning: Automatic API key provisioning with configurable URL
- Danger Bash Validation: Two-phase validation for dangerous Bash commands — regex gate fast-rejects without LLM call, then LLM validates intent alignment when INTENT: is present. 55 default rules covering work destruction (git) and system destruction (rm, kill, etc.)
- Activity Indicators: Real-time hook activity tracking (IV, TD, CC, ST, CX, PA, PL, LF, SS, SM, SE, SA, UP) with color-coded status
- Global API Poll Coordination: SQLite singleton prevents redundant API polling across concurrent sessions
- Companion Tool Installer:
pace-maker install claude-usage-monitor installs the usage monitoring dashboard
- Cross-Session Awareness Registry: Prevents "rogue agent" hallucinations when multiple Claude Code sessions work concurrently on the same repository. Each session is factually aware of sibling sessions in the same workspace via a shared SQLite registry. At session start, on subagent spawn, periodically every 5 tool uses, and before destructive Bash operations, the hook injects a banner listing active sibling sessions — so Claude no longer mistakes another session's unfamiliar files for corruption and attempts to "recover" by running
git checkout --, git reset --hard, git clean, or rm. Strict workspace isolation: sessions in different repositories never see each other. CLI: pace-maker sessions list, pace-maker cross-session-awareness on/off
- Memory Localization: Makes Claude Code's per-project memory portable across clones by symlinking the central
~/.claude/projects/<encoded>/memory/ folder to a repo-local .claude-memory/ directory that developers commit to git. When you clone a repo containing .claude-memory/, the SessionStart hook auto-links it — no manual symlink surgery per clone. Local always wins: stale central content is moved to a rename-backup then replaced with the symlink, with rollback on OSError. Optimistic race handling tolerates concurrent sessions. Safety asserts prevent any rmtree outside the central base. CLI: pace-maker localize-memory (seed a fresh project), pace-maker memory-localization on/off/status/unlink (toggle gate, reverse localization). Default enabled; state shown in pace-maker status
Installation
Option 1: Claude Code Plugin (recommended)
Install pace-maker as a Claude Code plugin via a marketplace for automatic hook registration and updates.
Prerequisites: A marketplace repo that includes pace-maker (see Setting Up a Marketplace below).
# One-time: add your organization's marketplace
claude plugin marketplace add https://github.com/YourOrg/claude-plugins.git
# Install pace-maker
claude plugin install claude-pace-maker@claude-plugins
That's it. The first Claude Code session after installation automatically bootstraps:
~/.claude-pace-maker/config.json with production defaults
~/.claude-pace-maker/source_code_extensions.json for validation
~/.claude-pace-maker/pacemaker symlink to the plugin Python package (required for CLI)
~/.local/bin/pace-maker CLI symlink (if ~/.local/bin is in PATH)
- A managed Python venv at
~/.claude-pace-maker/venv with dependencies (requests, pyyaml, claude-agent-sdk) on SessionStart
No install.sh or manual settings.json editing required.
CLI not found after claude plugin install? The plugin is registered in Claude, but bootstrap runs on the first session (or manually):
# Ensure ~/.local/bin is on PATH, then:
pace-maker doctor