codebase.marketsSee what your code is worth
← Blog
RightsJuly 18, 20266 min read

How to sell your code without losing it

The single most common misconception about selling a codebase to an AI buyer is that you're selling the code— that afterwards it somehow isn't yours. In a well-structured deal, that's not what happens. You're selling a license to learn from it, and you keep everything else.

License, don't assign

There are two fundamentally different transactions. An assignment transfers ownership — appropriate when a company is acquired or shut down, and priced accordingly. A training licensegrants the buyer the right to use your code as training or evaluation data while you retain ownership, keep shipping your product, and can license the same code to other buyers. For an operating business or a living side project, a non-exclusive training license should be your default position. Exclusivity is a real thing buyers sometimes want, but it's a separate negotiation with a separate (much higher) price.

The terms that actually matter

  • Scope of use. Training and evaluation of machine-learning models — not redistribution, not resale, not shipping your code inside their products.
  • Access model. Appraisal should be read-only. A temporary working copy for evaluation, deleted if no deal closes, retained only under the license if one does. Never grant write access to anything, ever.
  • Deletion and audit. A deadline for deleting evaluation copies and a written confirmation. Serious buyers agree to this without friction.
  • Warranties you can actually make.You'll be asked to warrant that you own the code. Only warrant what's true — which brings us to rights hygiene.

Do you actually own it?

This is where deals die, so check before you list. Three traps account for nearly all of the failures:

  • Employer IP. If you wrote it while employed, your employment agreement may assign it to your employer — sometimes even for off-hours work, depending on the contract and jurisdiction. Moonlighting projects need a clean story.
  • Contributors. Every meaningful contributor either needs to have assigned rights to you (or your company), or needs to be party to the deal. A repo with two co-authors and no paperwork is a repo with two sellers.
  • Copyleft dependencies.Vendored GPL/AGPL code inside your tree complicates what you can license. Ordinary package-manager dependencies are usually fine — you're licensing your code, not your node_modules — but copied-in third-party source is a red flag buyers check for.

What a clean process looks like

On codebase.marketsthe flow is built around these principles: read-only GitHub connection, a human expert appraisal, a firm quote in about two business days, deletion of the working copy if you pass, and you keep your code and your repo either way. If you take the quote, the paperwork is a training license with the scope, deletion, and warranty terms above — not a transfer of your life's work.

Related reading: what codebases are worth in 2026 and what buyers actually grade.

Curious what your repository is worth?

Instant estimate, then a firm quote from a senior engineer in about two business days. Read-only, no obligation, you keep your code.

Get an instant estimate