Basic Usage
The codectx CLI is designed around simplicity and powerful defaults.
The analyze command
Section titled “The analyze command”The core command you will use 99% of the time is analyze.
codectx analyze <path>Specifying Output
Section titled “Specifying Output”By default, the context file is created as CONTEXT.md in the target directory. You can specify a different output path:
codectx analyze . -o /tmp/custom-context.mdRespecting Token Limits
Section titled “Respecting Token Limits”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.
codectx analyze . --tokens 60000Watching for Changes
Section titled “Watching for Changes”If you’re iterating locally alongside an agent, you can have codectx continually update the file as you code:
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.