Skip to main content

Project context extraction tool for code analysis and AI workflows

Project description

CodeCtx

CodeCtx scans a project directory and writes a project.ctx.json file with high-signal context that is useful for AI workflows, code reviews, onboarding, and lightweight documentation.

What it does

  • Scans a target directory and builds a project context snapshot.
  • Extracts file structure, functions, APIs, dependencies, environment hints, summaries, and plugin output.
  • Writes the result into the directory where you run the command.
  • Keeps a single rolling backup in project.ctx.json.backup.
  • Auto-initializes its config directory on first run.

Installation

Option 1: local bootstrap

Use the bundled setup script when you want a self-contained local install with its own virtual environment and launchers.

# Windows
setup.bat

# macOS / Linux
./setup.sh

The bootstrap script:

  • creates venv/ if needed
  • generates launchers in bin/
  • prefers a user launcher directory already on PATH, such as ~/.local/bin
  • attempts to update PATH when necessary

Option 2: standard Python install

pip install .

After publishing to PyPI:

pip install pycodectx

For local development:

pip install -e .

You can also run it directly with:

python -m codectx .

The published package name is pycodectx, but the installed CLI command remains codectx.

Publishing

Build locally:

python -m pip install --upgrade pip build
python -m build

The repository includes a GitHub Actions workflow at .github/workflows/release.yml that:

  • builds the source distribution and wheel
  • publishes to PyPI using Trusted Publishing
  • runs when you push a tag like v1.0.0

Typical release flow:

git tag v1.0.0
git push origin v1.0.0

Before the first release, configure a PyPI Trusted Publisher for project pycodectx and point it at .github/workflows/release.yml.

Usage

# Analyze the current directory
codectx .

# Analyze a specific project
codectx /path/to/project

# Show extra detail
codectx . --verbose

# Plugin management
codectx plugin list
codectx plugin add /path/to/plugin.py
codectx plugin remove my_plugin

Output behavior

  • project.ctx.json is written into the directory you analyze.
  • If that file already exists, CodeCtx copies the previous version to project.ctx.json.backup.
  • Only the latest backup is kept.

Configuration

CodeCtx stores configuration in a per-user directory by default:

  • Windows: %LOCALAPPDATA%\CodeCtx
  • macOS: ~/.config/codectx
  • Linux: ~/.config/codectx

To override that location, set CODECTX_CONFIG_DIR.

Example:

CODECTX_CONFIG_DIR=/custom/path/codectx

The generated config.json controls values such as:

  • output_file
  • ignore_dirs
  • ignore_files
  • plugins_enabled
  • auto_backup

Project layout

codectx/
  src/codectx/   Python package
  bin/           generated launchers
  venv/          local virtual environment created by bootstrap
  bootstrap.py   cross-platform setup entry

License

CodeCtx is released under the MIT License. See LICENSE.

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycodectx-1.0.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycodectx-1.0.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file pycodectx-1.0.0.tar.gz.

File metadata

  • Download URL: pycodectx-1.0.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycodectx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4f568ea4e78e67c85565b16b420f0f12ca8dc17a12861971d857dd8458a324ad
MD5 914d89d5c06db7e13d195b01046599f2
BLAKE2b-256 6c5b84f7193c40c52cee7e5e452a24606ccdd1e344386359afab9bd39bb5b7f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycodectx-1.0.0.tar.gz:

Publisher: release.yml on prathmesh284/codectx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycodectx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pycodectx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycodectx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4b3ad5fd03ae0c9ab3d09de507e082b39ca0a99feeb5e339d51bb95afd0e084
MD5 e87d6f765e2658a00a0c003dc34f5418
BLAKE2b-256 a15e5d9e8dd73d0c085a4d23b24f4dbf1abff2c4aa177c2bd7235fde72a94136

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycodectx-1.0.0-py3-none-any.whl:

Publisher: release.yml on prathmesh284/codectx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page