🦀 ClawHub
OpenClaw Codebase Intelligence
by @michealxie001
Intelligent codebase analysis and understanding with caching. Automatically explores project structure, identifies modules, analyzes dependencies, and answer...
💡 Examples
场景 1:接手新项目
# 1. 获取整体概览
python3 main.py analyze /path/to/project --stats2. 了解主要模块
python3 main.py analyze --search "module"3. 查找核心类
python3 main.py analyze --symbol "App" --symbol-type class4. 了解工作流程
python3 main.py ask "How does data flow through the system?"5. 生成架构图
python3 main.py diagram --format mermaid-component
场景 2:重构前分析
# 1. 检查谁依赖要重构的模块
python3 main.py deps src/old-module.py --reverse --depth 32. 了解影响范围
python3 main.py ask "What would break if I refactor the auth module?"3. 查看修改建议
python3 main.py ask "How to migrate from class X to class Y?"
场景 3:代码审查
# 查看变更影响
python3 main.py ask "What depends on src/utils/helpers.py?"
⚙️ Configuration
忽略文件
在 .codebase-intelligence.json 中配置:
{
"ignore": [
"node_modules",
".git",
"*.test.js",
"vendor/"
],
"entryPoints": [
"src/main.py",
"src/index.js"
]
}
缓存位置
默认缓存位置:
也可以指定:
python3 main.py analyze . --cache-dir /path/to/cache
TERMINAL
clawhub install oc-codebase-intelligence