Skip to content

Basic Usage

The codectx CLI is designed around simplicity and powerful defaults.

The core command you will use 99% of the time is analyze.

Terminal window
codectx analyze <path>

By default, the context file is created as CONTEXT.md in the target directory. You can specify a different output path:

Terminal window
codectx analyze . -o /tmp/custom-context.md

LLMs have finite context windows. To ensure your context fits cleanly into your target model, use the --tokens flag.

codectx will intelligently compress files and strip lower-tier dependencies to fit within this budget.

Terminal window
codectx analyze . --tokens 60000

If you’re iterating locally alongside an agent, you can have codectx continually update the file as you code:

Terminal window
codectx watch .

This ensures your CONTEXT.md is always up to date without needing to manually run analyze every time you add an import.

For advanced configurations, see the CLI Reference.