{"id":51008393,"url":"https://github.com/voidd0/ctxstuff","last_synced_at":"2026-06-20T23:31:00.183Z","repository":{"id":353200374,"uuid":"1218321740","full_name":"voidd0/ctxstuff","owner":"voidd0","description":"pack context for LLM prompts. token-aware file globbing for OpenAI/Anthropic/Gemini.","archived":false,"fork":false,"pushed_at":"2026-04-29T06:14:01.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T20:46:11.091Z","etag":null,"topics":["ai","anthropic","claude","cli","context-window","devtools","gemini","gpt","javascript","llm","nodejs","openai","tokenization"],"latest_commit_sha":null,"homepage":"https://tools.voiddo.com/ctxstuff/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voidd0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T18:57:33.000Z","updated_at":"2026-05-06T06:46:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/voidd0/ctxstuff","commit_stats":null,"previous_names":["voidd0/ctxstuff"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voidd0/ctxstuff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidd0%2Fctxstuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidd0%2Fctxstuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidd0%2Fctxstuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidd0%2Fctxstuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidd0","download_url":"https://codeload.github.com/voidd0/ctxstuff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidd0%2Fctxstuff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34589204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","claude","cli","context-window","devtools","gemini","gpt","javascript","llm","nodejs","openai","tokenization"],"created_at":"2026-06-20T23:30:59.957Z","updated_at":"2026-06-20T23:31:00.178Z","avatar_url":"https://github.com/voidd0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ctxstuff\n\n\u003e **Pack codebases into LLM-ready context. Cost-estimate before you send.**\n\u003e A gift to the terminal from [**vøiddo**](https://voiddo.com).\n\n[![npm](https://img.shields.io/npm/v/@v0idd0/ctxstuff?color=%2322c55e\u0026label=%40v0idd0%2Fctxstuff)](https://www.npmjs.com/package/@v0idd0/ctxstuff)\n[![downloads](https://img.shields.io/npm/dm/@v0idd0/ctxstuff?color=%2322c55e)](https://www.npmjs.com/package/@v0idd0/ctxstuff)\n[![license](https://img.shields.io/npm/l/@v0idd0/ctxstuff?color=%2322c55e)](./LICENSE)\n[![node](https://img.shields.io/node/v/@v0idd0/ctxstuff?color=%2322c55e)](./package.json)\n\n**[Homepage](https://voiddo.com/tools/ctxstuff/)** · **[GitHub](https://github.com/voidd0/ctxstuff)** · **[npm](https://www.npmjs.com/package/@v0idd0/ctxstuff)** · **[All tools](https://voiddo.com/tools/)** · **[Contact](mailto:support@voiddo.com)**\n\n---\n\n## Why ctxstuff\n\nYou have a directory of source code and a frontier LLM with a 200K–10M-token context window. You need to turn one into prompt material for the other, in a format that the model actually reads well, while knowing **how much this prompt is going to cost** before you pay for it.\n\nEvery other tool does half of that, paywalls the other half, and hallucinates pricing numbers that haven't been correct since the day they shipped.\n\n**ctxstuff does the whole job in one binary, 60+ current models, and no artificial limits.** No daily op cap. No 20-file ceiling. No license key. No telemetry. No network calls. You run it locally, it reads your files, it emits markdown/XML/JSON, you paste or pipe, done.\n\nBuilt because we got tired of manually cat-ing 40 source files into a prompt every time we wanted to ask Claude \"does this look right?\"\n\n## Install\n\n```bash\n# npm\nnpm install -g @v0idd0/ctxstuff\n\n# or pnpm / yarn / bun\npnpm add -g @v0idd0/ctxstuff\nyarn global add @v0idd0/ctxstuff\nbun add -g @v0idd0/ctxstuff\n\n# one-shot via npx (no install)\nnpx @v0idd0/ctxstuff pack ./src --model claude\n```\n\nRequires Node.js **≥ 14**.\n\n## What it does\n\n| Command | What it does |\n|---|---|\n| `pack` | Pack a directory into one markdown/XML/plain/JSON context file |\n| `count` | Count tokens in a file or directory, per-file breakdown available |\n| `compare` | Compare token counts and cost across every supported model |\n| `optimize` | Shrink context to fit a target token budget (strip comments, minify, prioritise) |\n| `split` | Split a large codebase into chunks that each fit in one prompt |\n| `cost` | USD cost estimate across 60+ models, sorted cheapest-first |\n| `watch` | Watch a directory and auto-repack on every change (clipboard-aware) |\n| `profile` | Save custom model profiles (context + pricing) for your own tokenizer |\n\n## Usage\n\n```bash\n# pack a project to a markdown file\nctxstuff pack ./my-project -o context.md\n\n# pack as XML and copy straight to clipboard\nctxstuff pack ./src --format xml -c\n\n# count tokens across the tree for a specific model\nctxstuff count ./src --model claude-opus-4-7\n\n# per-file breakdown, heaviest first\nctxstuff count ./src --breakdown\n\n# cross-model cost comparison\nctxstuff cost ./src --compare --output 2000\n\n# optimize to fit 500K-token budget\nctxstuff optimize ./src --tokens 500000 --minify -o optimized.md\n\n# split a huge repo into chunks, each ≤ 1M tokens\nctxstuff split ./mega-repo --max-tokens 1000000 -o ./chunks\n\n# watch and auto-repack on file save\nctxstuff watch ./src -o context.md\n\n# see suggested split boundaries without writing anything\nctxstuff split ./src --suggest\n\n# pick files by extension + ignore node_modules-style junk\nctxstuff pack . --ext ts,tsx,md --ignore dist,coverage\n```\n\n## Model coverage (60+, pricing snapshot 2026-04-22)\n\n| Provider | Flagship tier | Cheaper tiers |\n|---|---|---|\n| **OpenAI** | `gpt-5.4` ($2.50/$15), `o3` ($2/$8, reasoning) | `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5`, `gpt-4.1`, `gpt-4.1-mini`/`nano`, `gpt-4o`, `gpt-4o-mini`, `o3-mini`, `o4-mini` |\n| **Anthropic** | `claude-opus-4-7` ($5/$25, **1M ctx**, released 2026-04-16) | `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4-5`, `claude-3.5-sonnet`, `claude-3.5-haiku` |\n| **Google** | `gemini-3.1-pro` ($2/$12, **2M ctx**) | `gemini-3-pro`, `gemini-3-flash`, `gemini-3.1-flash-lite`, `gemini-2.5-pro`, `gemini-2.5-flash` |\n| **Meta** | `llama-4-scout` (**10M ctx!**) | `llama-4-maverick`, `llama-3.3-70b` |\n| **Mistral** | `mistral-large-3` ($2/$6), `magistral-medium` (reasoning) | `mistral-medium-3`, `mistral-small-4`, `magistral-small-1.2`, `codestral` |\n| **xAI** | `grok-4` ($3/$15) | `grok-4.1-fast` (2M ctx, $0.20/$0.50) |\n| **DeepSeek** | `deepseek-v3.2` ($0.28/$0.42), `deepseek-r2` (reasoning) | — |\n| **Alibaba** | `qwen3-max` ($0.78/$3.90, 262K ctx) | `qwen3.5-plus` (1M ctx) |\n| **Cohere** | `command-a` ($2.50/$10) | `command-r-plus`, `command-r`, `command-r7b` (**$0.0375**/MTok — cheapest premium) |\n\n**Short aliases** (pass to `--model`): `gpt`, `claude`, `opus`, `sonnet`, `haiku`, `gemini`, `gemini-pro`, `llama`, `scout`, `maverick`, `mistral`, `magistral`, `grok`, `deepseek`, `qwen`, `command`, `reasoning`. Every old pre-3.0 key (`claude-4-opus`, `mistral-large-2`, etc.) resolves to its 2026-04 equivalent.\n\nPricing drifts monthly — run `ctxstuff cost . --compare` to see the numbers the installed version knows. Bump the package when you want fresh data.\n\n## Output formats\n\n- **`markdown`** (default) — headers per file, fenced code blocks with language hints. Best for Claude, Gemini, GPT-5.\n- **`xml`** — Anthropic's preferred framing (`\u003cfile path=\"...\"\u003e ... \u003c/file\u003e`). Best for long Claude runs with tool use.\n- **`plain`** — just the raw text, minimal dividers. Best for pipelines that re-process.\n- **`json`** — structured output for programmatic consumers: `{ files: [{ path, lang, content, tokens }], tokens, model }`.\n\n## Library use\n\n```js\nconst { pack, count, cost } = require('@v0idd0/ctxstuff');\n\nconst result = await pack('./src', {\n  model: 'claude-opus-4-7',\n  format: 'xml',\n  ignore: ['node_modules', 'dist'],\n});\nconsole.log(result.tokens, result.content.length);\n```\n\n## Why free forever\n\nWe are [**vøiddo**](https://voiddo.com) — a studio building small, sharp tools and a few serious products ([scrb](https://scrb.voiddo.com), [rankd](https://rankd.voiddo.com), [gridlock](https://gl.voiddo.com), and more). The serious products pay for themselves. The tools are gifts.\n\nWe write ctxstuff because _we_ need to pack our own codebases into LLM context all day, and leaving it free means we don't have to build a billing flow for a CLI utility.\n\n## From the same studio\n\n- **[@v0idd0/tokcount](https://www.npmjs.com/package/@v0idd0/tokcount)** — count LLM tokens + cost across 60+ models\n- **[@v0idd0/jsonyo](https://www.npmjs.com/package/@v0idd0/jsonyo)** — JSON swiss army knife, 18 commands\n- **[@v0idd0/promptdiff](https://www.npmjs.com/package/@v0idd0/promptdiff)** — diff LLM prompts with semantic awareness\n- **[@v0idd0/envguard](https://www.npmjs.com/package/@v0idd0/envguard)** — stop shipping `.env` drift to staging\n- **[View all tools →](https://voiddo.com/tools/)**\n\n## Contributing\n\nModel gone? Price stale? New provider? New output format? Open an issue at [github.com/voidd0/ctxstuff/issues](https://github.com/voidd0/ctxstuff/issues) or drop a line to [support@voiddo.com](mailto:support@voiddo.com).\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n\n---\n\nBuilt by [vøiddo](https://voiddo.com/) — a small studio shipping AI-flavoured products, free dev tools, Chrome extensions and weird browser games.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidd0%2Fctxstuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidd0%2Fctxstuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidd0%2Fctxstuff/lists"}