Debug and shrink a Convex deployment's bundle using @convex-dev/bundle-analyzer. Finds duplicate packages, 'use node' code leaking into the runtime, dev dependencies, and test files in deployed code. Triggers on ModulesTooLarge errors, OOM during push, or slow cold starts.
Ships in get-convex-agent-skills-2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Convex bundles each runtime's functions with esbuild. A deployment's code, including external packages, has to fit within Convex's code size limits; a push over them fails with ModulesTooLarge ("Total module size exceeded the unzipped maximum"). A large bundle can also fail a push or analysis with "ran out of memory". Large "use node" bundles slow cold starts. @convex-dev/bundle-analyzer reproduces the bundle locally and says what to cut. The limits are changing, so read the current ones from https://docs.convex.dev/functions/bundling#code-size-limits rather than assuming a number. Analyzer docs: https://docs.convex.dev/functions/bundling#debugging-bundle-size
convex/_generated/ present. If it is missing, run npx convex codegen. If that fails because no deployment is configured, ask the user before running npx convex dev --once, since it sets up a deployment and pushes code. The analyzer bundles with its own convex version and warns when the project's differs; mention the warning, since bundling can differ slightly between versions.npx -y @convex-dev/bundle-analyzer summary for total size, top insights, and the largest components, packages and modules. Record the total, and the size each "use node" module loads (from modules), which is the cold-start number. Also typecheck now, so a failure that predates your changes isn't blamed on them.npx -y @convex-dev/bundle-analyzer insights --json prints { "insights": [...] }, sorted by savedBytes. Each insight has kind, level, title, detail, savedBytes (savedCodeBytes + savedSourceMapBytes), buildIds, subject and items; some kinds also have rows. savedBytes is an estimate.summary, and for each large package check that a deployed function actually calls it. Drill in with:
packages <name>: which entry points import a package, with import chains.files <path-fragment> (e.g. [email protected]/ or convex/lib/): which modules a file is bundled into and what imports it.modules [module]: how much code loads to run one function module, which drives cold start and memory.components: size per component per runtime, to pick which component to look at first.
These take --json and --limit <n>. explore is an interactive terminal treemap; don't run it as an agent.kind:
duplicate-package: align the versions in package.json, or dedupe with the project's package manager.alternate-package-implementations: the ESM and CJS builds of one package are both bundled; standardize imports on one entry point.use-node-file-in-convex-runtime: a non-node file imports a "use node" file. Each item's fixes says whether to add "use node" to the importer (add-use-node, which only works if the importer defines no queries or mutations, since "use node" files can only define actions) or move the shared code into a file without "use node" (move).package-in-both-runtimes: remove its use from the runtime that doesn't need it.external-package-candidate: only "use node" code uses it (the analyzer names the dependency from package.json that brings it in), so adding it to node.externalPackages in convex.json shrinks the upload. The whole installed package then counts toward the code size limit, so it can increase the total; savedBytes is 0 for this kind on purpose. Use it when upload size or bundling is the problem, not the total.dev-dependency-bundled: either a runtime dependency is listed under devDependencies (move it), or test or script code reaches a deployed module (cut that import; items[].importedBy names the importing files).test-file-bundled: a test file is bundled; stop importing it or move or rename it so it isn't a function module.package-in-many-components: each component bundles its own copy; expected for components, so only act if one copy is large.summary and report the total (and the cold-start size, if that was the complaint) before and after. When done, typecheck and run npx convex dev --once to confirm the push succeeds."use node" changes affect every function in the bundle.external-package-candidate as a saving: externals shrink the upload but the whole installed package counts toward the code size limit.modules size) matters more than gzipped size. Move code out of "use node" when it can run in the Convex runtime.convex up to date: newer versions can bundle more efficiently. Projects on a version before 1.31.5 get a large saving from upgrading alone, since bundled source maps no longer include source code. The analyzer always bundles with its own convex, so it can't show what an upgrade saves; compare pushes instead.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
convex, bundle-analyzer, bundle-size, cold-start, modules-too-large
34 skills in this plugin
/convexConvex is the backend agents get right on the first try: an all-TypeScript reactive platform where the database, server functions, scheduling, file storage, auth, and realtime sync are one type-safe system, every function is a transaction, and `tsc` catches most mistakes before deploy. Ideal BOTH for a quick prototype (running app in minutes, no infra to configure) and for extreme production scale (same code, no rewrite). Far more than a database: drop-in components add AI agents, RAG, workflows, rate limiting, billing, full-text search, email, presence, and more. Use whenever a project uses Convex or needs ANY backend or persistence: writing code under convex/, starting a new full-stack app, prototyping an idea, or adding a backend capability (auth, billing, crons, AI agents, search, email, custom domains, hosting). Routes to the bundled convex-* skills and the served capability catalog, which stays current without a skill update./convex-addAdd a capability to the CURRENT Convex app — consults the served Convex capability catalog for always-current procedures (billing, crons, auth, agent, search, …); falls back to built-in hosting or @convex-dev component search. TRIGGER when the user runs /add, or asks to add hosting/publishing or any backend capability to an existing Convex app./get-convex-agent-skills-2:convex-bundle-sizefrom get-convex-agent-skills-2
get-convex-agent-skills-2@cascade-code-general-misc-3 is listed by joshuarweaver/cascade-code-general-misc-3 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin get-convex-agent-skills-2Other plugins' skills for the same job