# Codeharbor Repo Digest > Turn a public GitHub repository or a ZIP into one prompt-ready text for AI. Give a public GitHub address or upload a repository as ZIP or .tar.gz and get one text with the directory tree and every selected file under its path, with a token estimate. Filters leave out vendored code, lock files, binaries and large files; secret files such as .env are never included and obvious tokens are masked. Part of usefulweb.app (https://usefulweb.app/). Part of [Codeharbor](https://codeharbor.usefulweb.app/) (ownerApp: codeharbor). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://codeharborrepodigest.usefulweb.app/ (interactive tool at https://codeharborrepodigest.usefulweb.app/tool) - JSON API: POST https://codeharborrepodigest.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://codeharborrepodigest.usefulweb.app/api/v1/tool) - OpenAPI: https://codeharborrepodigest.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://codeharborrepodigest.usefulweb.app/mcp - tool `codeharbor_repo_digest` ## Inputs - repoUrl (text): Public GitHub repository - An address like https://github.com/owner/repo, …/tree// or owner/repo. Private repositories cannot be opened. - archive (file): Or upload the repository (.zip, .tar.gz) - Used instead of the address when given, e.g. GitHub’s “Download ZIP”. Works without GitHub. - folder (text): Only this folder (optional) - e.g. packages/core — leave empty for the whole repository. - include (textarea): Include only (optional) - Glob patterns, one per line or comma-separated, e.g. src/**/*.ts, *.md. - exclude (textarea): Leave out (optional) - Glob patterns, e.g. tests/, *.snap, docs/**. - maxFileKb (number): Largest file to include (KB) - skipVendor (boolean): Skip vendored code and build output (node_modules, vendor, dist …) - skipLockfiles (boolean): Skip lock files (package-lock.json, poetry.lock …) - maxTokens (number): Token budget - Files are added by priority (README, manifests, source, docs, tests) until the estimate reaches this. - format (select): Layout ## Method - The repository is read from GitHub’s public .tar.gz archive of the resolved commit (one REST request turns the branch or tag into a commit; no login, no token) or from the uploaded .zip/.tar.gz. Archives are limited to 25 MB packed, 150 MB unpacked and 5,000 files; tar headers are checksum-verified and every size is checked before reading. - Every file gets one decision: secret files (.env, private keys, .npmrc, credentials, Terraform state …) are never included; then your leave-out and include patterns (globs with *, **, ?, [abc], {a,b}); then vendored folders and build output, lock files, generated files (*.min.js, *.map), binaries (by extension, NUL bytes or invalid UTF-8) and files above the size limit. - Included files are masked for obvious secrets with the token rules Codeharbor shares with Opsdeck (private keys, JWTs, bearer tokens, AWS, GitHub, Slack, Stripe-style, AI provider, Google, GitLab, npm and Hugging Face formats, passwords in URLs) plus long string literals assigned to secret-named keys; placeholders and environment lookups stay. - Token estimate: characters ÷ 4, OpenAI’s rule of thumb; real tokenizers differ by roughly 10–30 %. When the budget is short, files are taken by priority — README, manifests, source code, docs, tests, other — and smaller first; the output keeps the folder order.