/install ctx-shrink
🛡️ ctx-shrink — AI Codebase Analyzer
When to Use
This skill is applicable when the user wants to:
- Analyze a codebase and generate a smart context map for AI agents
- Audit a project for accidentally committed secrets (
.env, keys, certs) - Check if a project is safe to publish (source maps, private files)
- Get a quick architecture overview of an unfamiliar codebase
📋 Instructions
You are an expert with ctx-shrink. Your job is to:
- Run ctx-shrink on the user's project directory
- Read the output (
AI-CONTEXT.mdor custom output file) - Explain what it found — architecture, endpoints, models, issues
- Recommend fixes for any security/safety issues found
🚀 Usage
Run analysis
ctx-shrink /path/to/project
ctx-shrink /path/to/project --out report.md
ctx-shrink /path/to/project --format json
Flags
| Flag | Description |
|---|---|
--max-depth N |
Limit directory depth |
--format json |
JSON output |
--out FILE |
Custom output file |
Common use cases
Quick project overview:
ctx-shrink . --out AI-CONTEXT.md
Pre-publish safety check:
ctx-shrink . --out publish-audit.md
For a specific path:
ctx-shrink ~/projects/my-api
📊 What it catches
| Check | What it catches |
|---|---|
| 📊 Project Analysis | Architecture, endpoints, models, dependencies |
| 🛡️ Gitignore Audit | .env, secrets, keys not in .gitignore |
| 📦 Publish Safety | Source maps, private keys, certs that would leak on publish |
⚠️ Rules
- Do not download installers, pipe
curl/wgetto a shell, or write binaries to system paths (/usr/local/bin, etc.). This skill only assumesctx-shrinkis already onPATH. - If
ctx-shrinkis not installed, send the user to the repository install section and let them choose a verified method: \x3Chttps://github.com/etherman-os/ctx-shrink#install> - Always read the output file after running
- Present findings in a clear, actionable format
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install ctx-shrink - After installation, invoke the skill by name or use
/ctx-shrink - Provide required inputs per the skill's parameter spec and get structured output
What is ctx-shrink?
ctx-shrink — Codebase analyzer for AI era. Generates smart context maps and catches packaging mistakes before they leak. It is an AI Agent Skill for Claude Code / OpenClaw, with 105 downloads so far.
How do I install ctx-shrink?
Run "/install ctx-shrink" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is ctx-shrink free?
Yes, ctx-shrink is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does ctx-shrink support?
ctx-shrink is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created ctx-shrink?
It is built and maintained by etherman (@etherman-os); the current version is v1.0.1.