Skip to main content

Capture and restore AI coding context across sessions

Project description

PJContext (pjctx)

Capture and restore AI coding context across sessions. Stop wasting 10-15 minutes re-explaining your project every time you start a new AI coding session.

Installation

pip install pjctx
# or
pipx install pjctx

Via npm (for Node.js developers)

npm install -g pjctx

Requires Python 3.9+ and pip. The npm package automatically installs the Python package during setup.

For development:

git clone <repo-url>
cd pjctx
pip install -e ".[dev]"

Quick Start

# Initialize in your git repo
pjctx init

# Save context (interactive)
pjctx save

# Save context (quick, one-liner)
pjctx save "Refactoring payment service to event sourcing"

# Save context (auto-detect from git)
pjctx save --auto

# Resume — copies prompt to clipboard, paste into any AI tool
pjctx resume

# Resume with specific format
pjctx resume --format xml
pjctx resume --format compact
pjctx resume --no-copy  # print to stdout

Commands

pjctx init

Initialize .pjctx/ in the current git repo. Adds .pjctx/ to .gitignore.

pjctx save [message]

Save current coding context. Three modes:

  • Interactive (no args): Rich prompts walk through task, approaches, decisions, next steps
  • Quick (pjctx save "message"): Auto-fill git data, message only
  • Auto (--auto): No prompts, git-detected changes, carries forward previous context

Options: --auto, -t/--tag TAG (repeatable)

pjctx resume

Generate a resume prompt from the latest context and copy it to clipboard. Paste into any AI coding tool (Cursor, Claude Code, Copilot, Windsurf) to instantly restore context.

Options: -f/--format [default|xml|compact], --no-copy, -b/--branch BRANCH

pjctx log

Show context history as a table.

Options: -b/--branch BRANCH, -n/--limit N, --all

pjctx diff

Show changes since last context save.

Options: --stat (default), --full

pjctx handoff [@user]

Create a handoff context for another developer. Carries forward all context fields and adds handoff note.

pjctx share

Remove .pjctx/ from .gitignore and commit it to git for team sharing.

pjctx watch

Watch for file changes and auto-save context at intervals.

Options: -i/--interval SECONDS (default: 300)

pjctx hook install|uninstall|status

Manage git post-commit hook for automatic context saving after each commit.

Storage

Context is stored locally in .pjctx/ within your repo, scoped by branch:

.pjctx/
├── config.json
├── contexts/
│   ├── main/
│   │   ├── 2024-01-15T10-30-00.json
│   │   └── latest.json
│   └── feature/payment-refactor/
│       └── latest.json
└── hooks/

Prompt Formats

  • default: Markdown briefing document with headers
  • xml: Structured XML for tools that parse it
  • compact: Dense single paragraph for token-limited contexts

License

MIT

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

pjctx-0.1.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

pjctx-0.1.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file pjctx-0.1.0.tar.gz.

File metadata

  • Download URL: pjctx-0.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pjctx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b9f4455fc6b0962f56f3fbcf3eba5a6ed5c295443f3d4dddc0c3f1ec2337365
MD5 74e094e7619e4a15affec177448b8127
BLAKE2b-256 39855c7a3502513b5f9a16b49a03e0ceaa8ac44f66bbdc96e361679390969a36

See more details on using hashes here.

File details

Details for the file pjctx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pjctx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pjctx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c1b4d89e810af5dfbfb14d8193c7a7d4dc1814d813a546145d16ed80b09d92a
MD5 aa6017eb72b9237253772240d782cd7f
BLAKE2b-256 8882c10a8758cd136b9605c36fe32ee3153f395edb02201a91ef8d22b21c2452

See more details on using hashes here.

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