
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.
gsum is a specialized command-line tool designed to optimize codebase context for agentic AI CLIs like Gemini CLI and Claude CLI. It dramatically reduces token usage, saves context windows, and minimizes tool calls by generating intelligent, compressed summaries of your codebase.
Agentic AI CLIs like Gemini CLI and Claude CLI are powerful, but they burn through tokens and context windows fast. gsum solves this by:
💡 Primary Use Case: Run gsum within Claude Code to leverage Gemini CLI's large context window and free API tier. Instead of Claude Code burning through your limited Claude tokens reading 50+ files, gsum defers the heavy analysis work to Gemini's generous free tier, then provides Claude with the essential context in a single, optimized summary.
# 🔥 NEW USER? Start here! Zero learning curve:
gsum interactive
# Try gsum without installing
npx gsum
# Install globally
npm install -g gsum
# Generate summary of current directory
gsum
# Focus on frontend files
gsum --focus frontend
🎯 Agentic AI CLI Optimization:
📊 Context Management:
🛠️ Core Features:
# Global installation
npm install -g gsum
# Or use without installing
npx gsum
git clone https://github.com/jhurray/gsum.git
cd gsum
make install
The git installer will:
which gsumIf you use Claude Desktop and installed via git, add slash commands for seamless integration:
make install-commands
This enables:
/gsum - Generate ephemeral summary/gsum-save - Create/update persistent summary/gsum-plan <task> - Generate implementation plans/gsum-interactive - 🔥 Interactive guided mode (works in any repo!)Note: Claude commands are only available with git installation. Commands are always overwritten on install/update to ensure you have the latest version.
gsum is designed to maximize efficiency for agentic AI CLIs by automatically adapting its behavior:
🎯 Primary Mode - Claude Code + Gemini CLI:
CLAUDE_CODE or CLAUDE_DESKTOP_TOOLS_ACTIVE environment variablesgemini --yolo command) to leverage its large context window and free API tier🔧 Standalone Gemini Mode:
🛡️ Fallback Options:
--fallback: Generates prompt you can copy to Claude manually (when Gemini quota exceeded)--claude-execute: Attempts to use local Claude CLI if installed--claude-only: Bypasses LLM entirely, generates analysis data only💡 Key Insight: The tool is specifically architected so Claude Code users can offload expensive codebase analysis to Gemini's free tier while keeping their Claude tokens for actual development work.
gsum analyzes your codebase locally:
Gemini Mode (Default):
Claude Code Mode (Auto-Enabled):
Depending on the command and environment:
# Generate ephemeral summary of current directory
gsum
# Save persistent summary (ARCHITECTURE.gsum.md)
gsum save
# Generate implementation plan
gsum plan "add user authentication"
# Plan with task-relevant files
gsum plan "fix auth bug" --smart-files 10
# Force fresh analysis (ignore cache)
gsum plan "refactor API" --fresh
# Claude-optimized plan
gsum plan "add OAuth" --claude-optimized
# Update gsum to latest version (from anywhere)
gsum update
# Show usage guide for LLMs
gsum llm-usage
# Show detailed help
gsum --help
# Interactive mode - guided configuration
gsum interactive
# or short alias
gsum i
# Ultra-compressed project overview
gsum fingerprint
# or short alias
gsum fp
# Fingerprint as JSON
gsum fingerprint --format json
# Verbose output (see what gsum is doing)
gsum -v
# Debug mode (detailed logs)
gsum -d
# Force regeneration (ignore git checks)
gsum save --force
# Custom output file
gsum save --file MY_DOCS.md
# Generate fallback prompt on quota error
gsum --fallback
# Try Claude CLI on quota error (experimental)
gsum --claude-execute
gsum now provides better visibility and control when running AI operations:
# Auto-verbose mode in Claude Code
# When running through Claude Code, gsum automatically enables verbose mode
# Set custom timeout (default: 5 minutes)
export GSUM_TIMEOUT=600000 # 10 minutes in milliseconds
gsum save
# Verbose mode shows:
# - 🚀 Execution start with working directory
# - 📝 Prompt length information
# - ⏳ Real-time progress with elapsed time
# - ✅ Completion status
# - ⏱️ Timeout warnings if exceeded
Progress indicators show animated dots with elapsed time:
⏳ Gemini is processing.... (45s)
Benefits:
Control the depth and detail of generated summaries:
# Minimal context (2-3k words) - Essential architecture only
gsum --context-level minimal
# Standard context (5-7k words) - Balanced detail [DEFAULT for gsum]
gsum --context-level standard
# Comprehensive context (10k+ words) - Full documentation [DEFAULT for save]
gsum --context-level comprehensive
When to use each level:
Generate targeted summaries for specific parts of your codebase:
# Focus on frontend components and UI
gsum --focus frontend
# Focus on backend API and endpoints
gsum --focus api
# Focus on database models and schemas
gsum --focus database
# Focus on test structure and coverage
gsum --focus testing
# Focus on deployment and CI/CD
gsum --focus deployment
# Focus on build tools and configuration
gsum --focus tooling
# Focus on documentation and guides
gsum --focus documentation
How it works:
Example combinations:
# Quick frontend overview
gsum --focus frontend --context-level minimal
# Comprehensive API documentation
gsum save --focus api --context-level comprehensive
Generate summaries for specific directories:
# Summarize a specific directory
gsum src/api
# Summarize a subdirectory
gsum src/components/Auth
# Save summary for a specific path
gsum save backend/
# Combine with other options
gsum src/frontend --focus frontend --context-level minimal
Benefits:
gsum now includes special optimizations for Claude Code users:
# Auto-enabled in Claude Code environment
gsum # Automatically uses Claude optimization
# Force Claude optimization
gsum --claude-optimized
# Save with Claude context cache
gsum save --claude-optimized
# Generate optimized implementation plan
gsum plan "add auth" --claude-optimized
Features:
.gsum/ for instant reuseCache structure:
.gsum/
├── context.md # Claude-optimized context
├── cache-metadata.json # Cache tracking info
└── file-summaries/ # Individual file analysis
Benefits for Claude Code:
The most user-friendly way to use gsum! Not sure which options to use? Let gsum guide you step-by-step:
gsum interactive
# or
gsum i
🔥 What makes Interactive Mode special:
The interactive experience:
Perfect for:
Interactive mode eliminates the guesswork and ensures you always get the perfect gsum configuration for your project!
Automatically include the most relevant files in your summary:
# Include 10 most relevant files
gsum --smart-files 10
# Include 5 most relevant files for a specific task
gsum plan "add authentication" --smart-files 5
# Combine with other options
gsum --focus api --smart-files 15
How it works:
Perfect for:
Get an ultra-compressed overview of any project:
# Generate fingerprint
gsum fingerprint
# Fingerprint for specific directory
gsum fingerprint src/
# Output as JSON
gsum fingerprint --format json
Example output:
🗺️ Codebase Fingerprint
📦 my-app
🔧 Tech: React/TypeScript/Node.js
🏗️ Structure: Monorepo with 3 packages
📄 Files: 127 (.ts: 89, .tsx: 38, .json: 15)
🎯 Patterns: Redux state, REST API, Unit tests
📚 Dependencies: 47 prod, 23 dev
🌿 Git: main branch, 1,234 commits, 5 contributors
Perfect for:
# Limit directory depth
gsum --depth 5
# Include only specific files
gsum --include "*.js,*.ts"
# Exclude patterns
gsum --exclude "test/**,*.spec.js"
# Disable git integration
gsum --no-git
# Output as JSON
gsum --format json
gsum save is smart about regeneration:
git diff--force to overrideSaved files include:
[Your documentation content]
<!-- git-hash: abc123def456 -->
<!-- git-branch: main -->
When Gemini quota is exceeded, gsum provides options:
Generate Fallback Prompt (--fallback)
gsum --fallback
Creates a detailed prompt you can copy to Claude
Try Claude CLI (--claude-execute)
gsum --claude-execute
Experimental: Attempts to run with Claude CLI directly
Wait for Reset Gemini quotas typically reset daily
gsum is a modular Node.js CLI application:
gsum/
├── cli/
│ ├── gsum.js # Main CLI entry point
│ ├── lib/
│ │ ├── analyzer.js # Codebase analysis engine
│ │ ├── generator.js # Summary generation orchestrator
│ │ ├── git.js # Git integration and change tracking
│ │ ├── gemini.js # Gemini API client
│ │ ├── claude.js # Claude CLI client (experimental)
│ │ ├── fallback.js # Fallback prompt generator
│ │ └── commands/ # Command implementations
│ └── package.json # Dependencies
├── install.sh # Smart installer script
├── test.sh # Test suite
└── Makefile # Build automation
$ gsum
# Outputs comprehensive guide including:
# - Component architecture
# - State management approach
# - Routing structure
# - Build configuration
# - Testing setup
$ gsum save
# Creates ARCHITECTURE.gsum.md with:
# - Service architecture
# - API endpoints
# - Database models
# - Dependency injection
# - Deployment configuration
$ gsum plan "add real-time notifications"
# Generates step-by-step plan:
# 1. WebSocket server setup
# 2. Frontend integration points
# 3. Database schema changes
# 4. API modifications
# 5. Testing approach
After running make install-commands:
/gsum in any conversationUse gsum llm-usage to see integration guide:
$ gsum llm-usage
# Shows examples and best practices for LLMs
gsum: command not found
source ~/.bashrc (or ~/.zshrc)echo $PATH includes ~/binGemini quota exceeded
gsum --fallback for Claude promptSummary not updating
git statusgsum save --force to force updateCommand times out
export GSUM_TIMEOUT=600000 (10 minutes)gsum -vNo progress visible in Claude Code
gsum -vecho $CLAUDE_CODESee docs/TROUBLESHOOTING.md for detailed solutions.
make test # Run test suite
npm pack # Test npm package
npm install -g gsum or npx gsumgit clone + make install for full development setupMIT License - see LICENSE file for details.
Created by jhurray
GSUM_TIMEOUT env varnpm install -g gsum and npx gsumFAQs
AI-powered codebase summarization CLI with smart context optimization
The npm package gsum receives a total of 7 weekly downloads. As such, gsum popularity was classified as not popular.
We found that gsum 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.