How z33mscessex/code_recycle works
code_recycle is a local-first search tool for reusing code and verified research notes. The main workflow is to configure folders and rules, scan eligible files, split them into searchable entries, build a SQLite index, then search it and return locations and snippets with reuse rules and secret checks applied. Users can run this through the CLI or an MCP client; optional local embeddings augment keyword ranking. The graph follows the shown CLI, indexing, search, and server calls; unsampled secret-scanner internals are represented only as a subsystem.
Main entry points: cli.py CLI commands · search.py Search and ranking · index.py Index builder · server.py MCP server
Components 15
User entry points
- CLI commands
code_recycle/cli.py - MCP server
code_recycle/server.py - Settings loader
code_recycle/settings.py
Index construction
- File walker
code_recycle/files.py - Secret screening
code_recycle/secret_check.py - Chunk parsing
code_recycle/chunks.py - Index builder
code_recycle/index.py
Search and safeguards
- Search and ranking
code_recycle/search.py - Result secret check
code_recycle/secret_check.py - Answer formatting
code_recycle/search.py
Local index and embeddings
- SQLite search index
code_recycle/index.py - Embedding support
code_recycle/embed.py
Other components
- User
- MCP client
- Local folders
Connections 22
- User → CLI commands: runs commands
README.md - CLI commands → Settings loader: loads settings
code_recycle/cli.py - MCP client → MCP server: launches tool
README.md - MCP server → Settings loader: loads settings
code_recycle/server.py - CLI commands → Index builder: builds index
code_recycle/cli.py - CLI commands → Search and ranking: runs search
code_recycle/cli.py - CLI commands → MCP server: starts server
code_recycle/cli.py - MCP server → Search and ranking: runs search
code_recycle/server.py - MCP server → Answer formatting: formats answer
code_recycle/server.py - Local folders → File walker: provides files
- Settings loader → File walker: sets scan rules
code_recycle/files.py - File walker → Secret screening: scans files
code_recycle/files.py - Index builder → File walker: walks folders
code_recycle/index.py - Index builder → Chunk parsing: splits files
code_recycle/index.py - Index builder → SQLite search index: writes chunks
code_recycle/index.py - Index builder → Embedding support: creates vectors
code_recycle/index.py - Search and ranking → SQLite search index: reads candidates
code_recycle/search.py - Search and ranking → Embedding support: augments ranking
code_recycle/search.py - Search and ranking → Result secret check: checks results
code_recycle/search.py - Search and ranking → Answer formatting: formats results
code_recycle/cli.py - CLI commands → User: prints results
code_recycle/cli.py - Answer formatting → MCP client: returns answer