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.

To print to the terminal instead of saving a file, use --stdout (or -o -). With --only-map --no-tags this makes Combicode a tree with code outlines and line counts:

combicode --only-map --no-tags --stdout -q     # the bare map, nothing else
alias ctree='combicode --only-map --no-tags --stdout -q'
ctree src/                                     # like `tree src/`, with classes and functions

--no-tags drops the <code_map> wrapper, which only helps an LLM find the section in a larger document. It works only when the map is the sole section. -q hides the summary line, which goes to stderr and would otherwise show up in the terminal.

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.
--stdout Write to stdout even when it is a terminal (same as -o -).
-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.
--no-tags Print the map without the <code_map> tags. Only when the map is the sole section.
--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.1.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.1.0
File
combicode-4.1.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
combicode-4.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
combicode-4.1.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.1.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.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
combicode-4.1.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.1.0-py3-none-win_arm64.whl

Download URL combicode-4.1.0-py3-none-win_arm64.whl
Size 829.9 kB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
23f32cd0e555a58ce4a320860c712570d975cc6ddbd0a936222cb034881f3b83
BLAKE2b-256 checksum
How to use checksums
5cacf63067046292cfcb0476b0b73f13aad4c2ac97e34cde3a516a9f6ccf255c
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.1.0-py3-none-win_amd64.whl

Download URL combicode-4.1.0-py3-none-win_amd64.whl
Size 907.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4a6ef79d755de38f893ac0e470df94a0b99f2c1c2e3531435e7cab1478b9baa7
BLAKE2b-256 checksum
How to use checksums
e6b7141010c6bc38c3986fbf166151de4a3726b30ea4d1f9cb327a2e6f8df960
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.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL combicode-4.1.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
92657bb354048e87d1eb18a127c665a87b6e1b6cff51868d95c738d8b4c1b2fe
BLAKE2b-256 checksum
How to use checksums
daf3943fe7b7eb2921bbe1686dee787f80a3426a9f65e08eae7fb45ac6639197
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.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL combicode-4.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 957.7 kB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
76f6b10c4263d33af1a6baae227526be964429013fe955f0cdedd97a02ba61a5
BLAKE2b-256 checksum
How to use checksums
b00ed8b957372f5263d80faf13e2925201064c63dafc931125d657f34c840e48
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.1.0-py3-none-macosx_11_0_arm64.whl

Download URL combicode-4.1.0-py3-none-macosx_11_0_arm64.whl
Size 863.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
def95bed4cfbcb9513b47f760b56d1680822cd6c0b6b01df8d098d545aa245f5
BLAKE2b-256 checksum
How to use checksums
9f0dd05ae4e355cb12b8450792ddf448102c2e7a4e20515a55150b880c298d43
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.1.0-py3-none-macosx_10_12_x86_64.whl

Download URL combicode-4.1.0-py3-none-macosx_10_12_x86_64.whl
Size 956.5 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
585a9bea2092125f2c27d8291f819314eb6e6c7b424d6906e24a4d9f93b3141d
BLAKE2b-256 checksum
How to use checksums
ebb31506219e26ebac16cb349891411eea336eaaed34389b295840944e7a214a
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

This release

4.1.0 This release

6 release files

4.0.1

6 release files

4.0.0

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