Skip to main content

Combicode

crates.io npm PyPI License: MIT

Combicode packs a project into one text file that you can give to an LLM. The file contains:

  1. A prompt that tells the model what it is reading.
  2. A code map: the directory tree plus the classes and functions in each file, with line numbers and sizes.
  3. The code: every file, unchanged.

Every line number in the map is exact, so you and the model can jump straight to any file or function.

Combicode is a single native binary written in Rust. The npm and PyPI packages contain the same binary, so you do not need Rust, Node.js or Python beyond the tool you install it with.

Install

Tool Run once Install
npm npx combicode npm install -g combicode
Python uvx combicode or pipx run combicode pipx install combicode or pip install combicode
Homebrew brew install aaurelions/tap/combicode
Cargo cargo install combicode

npx combicode needs only Node.js 18 or newer: npm downloads the prebuilt binary for your platform (Linux, macOS or Windows on x64 or ARM64) as an optional dependency. On other platforms, or if optional dependencies are disabled (--omit=optional), use cargo install combicode.

Prebuilt binaries for Linux, macOS and Windows (x64 and ARM64) are attached to every GitHub release.

Usage

Run it in your project directory:

combicode                     # saves combicode.txt

When you run it in a terminal, Combicode saves combicode.txt. When its output is redirected or piped, it writes to stdout instead, so both of these work:

combicode > combicode.txt
combicode | pbcopy            # copy to the clipboard on macOS

Status messages go to stderr, so they never end up in the file.

Choose what goes into the file

combicode --no-prompt > no-prompt.txt          # map and code, without the prompt
combicode --no-prompt --no-code > map.txt      # only the map
combicode --only-map > map.txt                 # the same, shorter
combicode --only-map --no-size > map.txt       # the map without sizes
combicode --no-map -o no-map.txt               # prompt and code, without the map
combicode --no-outline                         # the map lists files but not functions

Choose which files to pack

combicode --include 'src/,*.md'                # only src/ and Markdown files
combicode --only-map --include 'hello,world,my.txt' -o combicode.txt
combicode --exclude '*.test.ts,fixtures/'      # skip more files
combicode --omit-content 'data/,*.csv'         # list these in the map, but leave out their content
combicode ../other-project -o other.txt        # pack another directory

Patterns use gitignore syntax. A pattern without a slash, such as hello or *.md, matches at any depth, and a directory pattern matches everything inside it. Separate patterns with commas or repeat the option: -i src/ -i '*.md'.

Output

For a small project, combicode produces this file (line numbers added for reference):

 1  You are given the source code of the project "my-app", packed into a single document by Combicode.
 2
 3  <code_map> lists every included file as a directory tree, with the classes, functions and other symbols found in each file. Entries show OL (line range in the original file), ML (line range in this document) and size. <code> contains the files in map order, each inside a <file path="..."> element exactly as it appears on disk.
 4
 5  Before answering, study the project as a whole: its structure, entry points, configuration, dependencies and how the parts interact. When you refer to code, cite the file path and original line numbers. Use ML ranges to find a file or symbol in this document.
 6
 7  <code_map>
 8  my-app/
 9  ├── package.json [OL: 1-4 | ML: 18-21 | 43B]
10  └── src/
11      ├── greet.js [OL: 1-3 | ML: 25-27 | 60B]
12      │   └── fn greet(name) [OL: 1-3 | ML: 25-27 | 60B]
13      └── index.js [OL: 1-3 | ML: 31-33 | 66B]
14  </code_map>
15
16  <code>
17  <file path="package.json" bytes="43">
18  {
19    "name": "my-app",
20    "type": "module"
21  }
22  </file>
23
24  <file path="src/greet.js" bytes="60">
25  export function greet(name) {
26    return `Hello, ${name}!`;
27  }
28  </file>
29
30  <file path="src/index.js" bytes="66">
31  import { greet } from "./greet.js";
32
33  console.log(greet("world"));
34  </file>
35  </code>

Each map entry shows:

  • OL (original lines): the line range in the source file. fn greet(name) [OL: 1-3] is lines 1–3 of greet.js.
  • ML (merged lines): the line range in the output file, so sed -n '25,27p' combicode.txt prints exactly greet. ML appears only when the code is included.
  • Size of the file or symbol. Hide it with --no-size.

Lines are counted by \n, the same way as sed, wc -l and editors. Windows line endings (\r\n) do not change the count. Empty files are shown as [empty], and files left out with --omit-content as [content omitted | size].

The map is a code map: a directory tree with an outline of each file. That is why the options are named --no-map, --only-map and --no-outline.

Outlines

The outline lists classes, structs, interfaces, functions, methods, test cases and long loops (6 lines or more) for:

Languages Extensions
Python .py .pyi
JavaScript, TypeScript .js .jsx .mjs .cjs .ts .tsx .mts .cts
Rust, Go .rs .go
C, C++, C#, Java .c .h .cc .cpp .cxx .hh .hpp .hxx .cs .java
Kotlin, Swift, Scala .kt .kts .swift .scala .sc
PHP, Ruby, Lua, Perl, shell .php .rb .lua .pl .pm .sh .bash .zsh

Other text files are included without an outline. Outlines are found with fast heuristics rather than a full parser: they skip comments and strings and handle multi-line signatures, but unusual syntax can be missed. File contents are never changed.

Prompts

combicode --prompt docs -i '*.md' -o docs.txt    # a prompt for documentation (llms.txt style)
combicode --prompt-file my-prompt.md             # your own prompt

The built-in prompts describe only the sections that are present. --prompt docs tells the model to answer strictly from the packed documents.

Which files are included

Combicode walks the directory and:

  • respects .gitignore (including nested ones, .git/info/exclude and your global gitignore) and .ignore files. Use --no-gitignore to turn this off;
  • respects a .combicodeignore file, in gitignore syntax, for project-specific rules that should not affect git;
  • skips common non-source files: .git, dependencies such as node_modules and .venv, build output such as target and dist, lockfiles, .env files, media and archives. --no-gitignore does not turn these off;
  • skips git submodules, symlinks, binary files and files that are not valid UTF-8 (with a warning);
  • never packs its own output file, or an earlier Combicode output lying in the project.

Ignore rules are not secret detection. Check the file before you share it.

Restore files

A Combicode file can be turned back into files:

combicode restore combicode.txt -o restored/       # recreate the files in restored/
combicode restore combicode.txt -o restored/ -n    # dry run: show what would be written
combicode restore combicode.txt --force            # replace files that already exist

The bytes attribute of each <file> element is the exact UTF-8 length of its content, so content that looks like a </file> tag, empty files, missing final newlines, \r\n line endings and Unicode all round-trip exactly. If you edit content inside the file, update bytes to match.

Restore never writes outside the target directory: absolute paths, .., symlinks, Windows device names and other unsafe paths are rejected before anything is written. Existing files are kept unless you pass --force, and replaced files are swapped in atomically. Files left out with --omit-content are not restored.

Options

combicode [OPTIONS] [PATH]
combicode restore [OPTIONS] [INPUT]
Option Description
PATH Project directory to pack. Default: the current directory.
-o, --output <FILE> Write to FILE; - means stdout. Default: stdout, or combicode.txt when stdout is a terminal.
-i, --include <PATTERNS> Pack only files matching these patterns.
-e, --exclude <PATTERNS> Skip files matching these patterns.
--omit-content <PATTERNS> List matching files in the map without their content.
--no-gitignore Do not read .gitignore, .ignore or git exclude files.
--no-prompt Leave out the prompt.
--no-map Leave out the code map.
--no-code Leave out file contents.
--only-map Output only the code map (--no-prompt --no-code).
--no-outline List files in the map without classes and functions.
--no-size Hide sizes in the map.
--prompt <code|docs> Built-in prompt. Default: code.
--prompt-file <FILE> Use the contents of FILE as the prompt.
-q, --quiet Do not print the summary and warnings.
-h, --help / -V, --version Print help or the version.

restore options:

Option Description
INPUT Combicode file to read; - means stdin. Default: combicode.txt.
-o, --output <DIR> Directory to restore into. Default: the current directory.
-n, --dry-run Show what would be written without changing anything.
-f, --force Replace files that already exist.
-q, --quiet Do not print the file list and summary.

Exit status is 0 on success, 1 on errors and 2 on invalid options.

Windows PowerShell 5.1 saves redirected output as UTF-16. Use -o combicode.txt instead of > there (PowerShell 7 is fine).

License

MIT

Metadata

Release files for combicode 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for combicode 4.0.0
File
combicode-4.0.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
combicode-4.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
combicode-4.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.1+ x86-64 Details
combicode-4.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux musl 1.1+ ARM64 Details
combicode-4.0.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
combicode-4.0.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 5.6 MB

Release files / combicode-4.0.0-py3-none-win_arm64.whl

Download URL combicode-4.0.0-py3-none-win_arm64.whl
Size 827.3 kB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
f0bd72620186da7bc60f91f8a3ad85e2eaaee4086f94f6d73640aa197f1c691c
BLAKE2b-256 checksum
How to use checksums
5e2d543ef5a8e01e9cda4a54464bbf18e15093f677f6043588d6c6e5ec42dff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / combicode-4.0.0-py3-none-win_amd64.whl

Download URL combicode-4.0.0-py3-none-win_amd64.whl
Size 904.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
5d03914ddfecc4a5426ce315dddc77694acef4c9ccfd6872ed1abccd15327bbd
BLAKE2b-256 checksum
How to use checksums
0b06003c75382e5722d0e3011efd1b9cb9f24384061d2ca9be5dd2183bc81da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / combicode-4.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL combicode-4.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
beef706298806f734bb754bba2b497ff3a7faa22fcd4dfa8d9515f2e1efaefaf
BLAKE2b-256 checksum
How to use checksums
cd56076fea3bee7165273be4204b5e1e36ae8ae2d084e8a8118ef77302bd9340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / combicode-4.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL combicode-4.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 954.8 kB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
2a3e1fc7ea031110664d52e80f21e3b3cc5a74fa48a73930ac90a2fc75683f2a
BLAKE2b-256 checksum
How to use checksums
d3cff9e44c36e5daf2943e75a615a50e164b25778bcec20cf27a4ab15416b504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / combicode-4.0.0-py3-none-macosx_11_0_arm64.whl

Download URL combicode-4.0.0-py3-none-macosx_11_0_arm64.whl
Size 860.1 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d915c062c904553d05ad66b019d3f0f4f6bd426bfad2eeb233441003f144718a
BLAKE2b-256 checksum
How to use checksums
d0e9f0420cdfe29da6a7c9225812557b56c6e37d22eeade93bdce5d377ab8993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / combicode-4.0.0-py3-none-macosx_10_12_x86_64.whl

Download URL combicode-4.0.0-py3-none-macosx_10_12_x86_64.whl
Size 954.0 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b68ff6d1b7a6cf6238cab4e37eaa624308ac032fe22a0c249a6d8171c0a518a7
BLAKE2b-256 checksum
How to use checksums
79c5f137967bc2fe6f12e4131b50cf40df0c72f13dcd18eada2eefaac3aa71e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

4.1.0

6 release files

4.0.1

6 release files

This release

4.0.0 This release

6 release files

3.0.0

2 release files

2.0.0

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page