As code-focused large language models support ever-longer context windows (the recently released Claude Opus/Sonnet 4.6 and GPT 5.3 CodeX are big improvements; previously anything over ten thousand lines of context basically triggered “Alzheimer’s”), it’s becoming more common to just copy entire projects into a prompt and feed them to an LLM. Automated coding tools like OpenCode are token-hungry monsters; one big advantage of manual prompting is that you can curate a PLAN-BUILD flow yourself and save money. Manually copying code file by file is obviously tedious, and many nonstandard doc comments don’t include file hierarchy info, which can leave the model confused. There are already similar tools out there, but many are quite heavy. I wrote a lightweight, few-hundred-line binary tool called pmc (pack-my-code) that makes it easy to package your project’s code into a prompt. GitHub. You can download the binaries from Releases and add them to your PATH. It’s packaged with luainstaller.
Usage
It’s simple and intuitive.
Basic usage, in the directory you want to export:
pmc
Then press Ctrl+Shift+C. Of course, pmc also supports some slightly more advanced features. In fact, even in the default case above, it already does the following:
- Equivalent to pmc . (the current working directory)
- Respects .gitignore (requires a git environment)
- Prints to the terminal instead of redirecting to a file
- Does not output a tree structure
- Does not output statistics
- Wraps each file’s code in standard Markdown code blocks
- Displays file paths relative to the execution directory
- Does not additionally exclude or include only specific file types
These behaviors are configurable. Check the README for more usage details, or run with the -h flag after installation, including the special YAML mode. Overall it’s a very simple little tool, but at least for me it’s quite handy. :)
Top comments (0)