
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@agentbrain/cli
Advanced tools
CLI for AgentBrain - generate smart context documentation for coding agents
Smart context generation for coding agents - Keep AI assistants in sync with your codebase
Command-line interface for AgentBrain. Automatically generates and maintains context documentation that helps coding agents (Claude, Cursor, Windsurf) understand your codebase instantly.
npm install -g @agentbrain/cli
npm install --save-dev @agentbrain/cli
agentbrain --version
cd /path/to/your/project
agentbrain setup
That's it! AgentBrain now:
.agentbrain/context.md - Full repository intelligence.agentbrain/dependency-map.md - Service relationships.agentbrain/patterns.md - Coding patterns and conventionsCLAUDE.md / .cursorrules / .windsurfrules - Agent loading instructions.git/hooks/post-commit - Smart auto-regeneration hookAgentBrain analyzes your codebase and generates three intelligence documents:
After setup, context updates automatically in the background when you commit source file changes. Commits complete instantly (~0.05s) while regeneration happens in the background.
Smart Filtering: Only regenerates when source code changes (skips docs/config updates to save time and API costs).
AgentBrain automatically detects when you're modifying the same files repeatedly in commits - a sign you may be stuck in a loop. When detected:
agentbrain spec to plan a fixCheck manually:
agentbrain doom
setup - Complete Automated SetupOne-command setup for AgentBrain in your repository.
agentbrain setup [options]
Options:
--path <path> - Repository path (default: current directory)--skip-hooks - Skip git hooks installation--skip-agent-files - Skip agent file injection--no-confirm - Skip all confirmation promptsWhat it does:
Cost: ~$0.02-0.05 for initial generation (cached repeats are free)
init - Regenerate ContextManually regenerate all context documentation.
agentbrain init [options]
Options:
--path <path> - Repository path--no-confirm - Skip confirmation prompt--silent - Suppress output (for scripts)Use when:
Cost: ~$0.02-0.05 per regeneration (same git hash = free from cache)
spec - Create Task SpecificationsGenerate AI-guided task specifications with problem analysis and architecture planning.
agentbrain spec "<task description>" [options]
Options:
--path <path> - Repository path--load <slug> - Load existing spec by slugExamples:
# Create new spec
agentbrain spec "add user authentication with OAuth"
# Load existing spec
agentbrain spec --load add-user-authentication
What it creates:
Specs are saved to: .agentbrain/specs/<task-slug>.md
Cost: ~$0.01-0.03 per spec generation
doom - Detect Doom LoopsAnalyze git history to detect if you're modifying the same files repeatedly.
agentbrain doom [options]
Options:
--path <path> - Repository path--commits <n> - Number of recent commits to analyze (default: 10)--threshold <n> - Minimum occurrences to flag (default: 4)--json - Output as JSON for programmatic useExample Output:
Analyzing last 10 commits...
⚠ Doom loop detected!
These files appear repeatedly:
apps/api/src/main.ts (9 times · 90%)
apps/api/src/auth.ts (6 times · 60%)
Suggestions:
→ Stop coding. Investigate root cause first.
→ Run: agentbrain spec "fix [problem description]"
Automatic Detection: After commits, doom detection runs in the background. Warning shown on next command if detected.
doctor - Health DiagnosticsRun health checks on your AgentBrain setup.
agentbrain doctor [options]
Options:
--path <path> - Repository path--json - Output as JSONChecks:
Use when:
status - Auto-Update StatusView status of background context updates.
agentbrain status [options]
Options:
--path <path> - Repository pathShows:
.agentbrain/update.logstandards - Generate Coding StandardsGenerate coding standards documentation based on your codebase patterns.
agentbrain standards [options]
Options:
--path <path> - Repository pathCreates: .agentbrain/standards.md
Cost: ~$0.01-0.02 per generation
handoff - Generate Session HandoffGenerate session handoff document with recent changes and context.
agentbrain handoff [options]
Options:
--path <path> - Repository path--goal <goal> - Session goal (optional)--commits <n> - Number of recent commits (default: 5)Creates: .agentbrain/handoff.md
Includes:
Cost: ~$0.01-0.02 per generation
config - Configure API SettingsConfigure AI provider API keys and settings.
agentbrain config
Interactive setup for:
Supports:
disable - Disable AgentBrainDisable AgentBrain features in your repository.
agentbrain disable [options]
Options:
--path <path> - Repository path--remove-hooks - Remove git hooks--remove-agent-files - Remove agent file modificationsUse when:
Note: Does not delete .agentbrain/ directory or context files.
AgentBrain provides a Model Context Protocol (MCP) server that enables AI agents to access repository intelligence directly.
Install MCP Server:
npm install -g @agentbrain/mcp-server
See: @agentbrain/mcp-server for setup instructions.
MCP Tools Include Doom Warnings:
load_context - Returns doom_warning field if loop detectedload_spec - Returns doom_warning field if loop detectedsave_handoff - Appends doom section to handoff documentCheck git hooks:
agentbrain doctor
Verify hook is installed:
cat .git/hooks/post-commit
# or for Husky:
cat .husky/post-commit
Reinstall hooks:
agentbrain disable --remove-hooks
agentbrain setup
Check update log:
cat .agentbrain/update.log
Common issues:
agentbrain config.agentbrain/agentbrain binaryForce regeneration:
agentbrain init --no-confirm
Check cache: Cache is tied to git hash. If you haven't committed changes, old cache is used.
Adjust sensitivity:
# Check last 15 commits, flag if file appears 6+ times
agentbrain doom --commits 15 --threshold 6
Excluded patterns:
Smart regeneration already optimized:
Further reduce costs:
--skip-hooks during development sprintsagentbrain initagentbrain disableAgentBrain detects and supports Husky automatically.
Husky v9+ (recommended):
Hook installs directly to .husky/post-commit
Custom hook paths:
Detects git config core.hooksPath and installs there
No conflicts: AgentBrain hook runs alongside existing hooks
.agentbrain/
├── context.md # Full repository intelligence
├── dependency-map.md # Service relationships
├── patterns.md # Coding patterns
├── standards.md # Coding standards (optional)
├── handoff.md # Session handoff (optional)
├── update.log # Auto-update history
└── specs/ # Task specifications
└── <task-slug>.md
CLAUDE.md - Claude Code loading instructions.cursorrules - Cursor loading instructions.windsurfrules - Windsurf loading instructions.git/hooks/post-commit - Standard installation.husky/post-commit - Husky installation✅ Good for:
❌ Skip if:
agentbrain setup onceagentbrain specMIT © AgentBrain
FAQs
CLI for AgentBrain - generate smart context documentation for coding agents
We found that @agentbrain/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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.