Code Library¶
Hybrid catalog: repos under a configured source root, tools extracted by guided static scan (human accept), sorted into user-defined categories.
Agent/MCP search is off until categories are enabled.
Setup¶
- Set your settings in the workbench (Settings → Code library) or on the command line; they are kept in
<data_root>/config/code-library.toml, not intool-chest.toml:
python3 scripts/workspace_config.py code-library --data-root ~/tool-chest-data get
echo '{"changes": {"general.source_root": "~/Documents/workspace/oss", "general.enabled_categories": ["ai"]}}' \
| python3 scripts/workspace_config.py code-library --data-root ~/tool-chest-data set
source_root is the folder of repos (flat or under <category>/); categories is the taxonomy (oss/<category>/
folders are added too); enabled_categories is the gate for MCP/CLI search (empty means nothing is searchable).
- Open the dashboard → Library → Code library:
- Browse (allowlisted) and set source root
- Process a repo → review proposals → accept with categories
- Toggle enabled categories for agent search
Inventory lives at ~/tool-chest-data/code-library/library.toml (not git).
A git repo directly under source_root has no category. A non-git child is a
category folder: its repos default to that category when you accept their tools.
The workspace layout (oss/<category>/<repo>) is described in
~/Documents/workspace/CLAUDE.md.
CLI¶
make code-library
make code-library-search Q='tokenizer'
.venv/bin/python3 scripts/code_library.py search-tools 'bandit'
MCP tools: search_tools, search_code_library, get_passage, list_repos.
Safety¶
- Scan/dry-run are read-only (no execute of exogenous code in v1).
- FS browser allowlisted under
$HOME,data_root,~/Documents/workspace. - Never catalog
data_root/lab/**or denied RAG paths.