Skip to main content

Create portable Markdown snapshots from Codex CLI and Claude Code sessions.

Project description

ctx2doc

ctx2doc creates compact, redacted Markdown snapshots from local coding-agent sessions and stores them in your project. It currently supports:

  • Codex CLI via local Codex session logs
  • Claude Code via official MCP + hooks + project skill integration

Install

From PyPI after the first public release:

uv tool install ctx2doc

Or:

pipx install ctx2doc

Until PyPI is live, install from this repository:

uv tool install .

Quickstart

Codex

Inside the target project:

ctx2doc install codex

This will:

  • register the ctx2doc MCP server in Codex
  • install a project-local Codex skill
  • add a small AGENTS.md block with ctx2doc snapshot, ctx2doc resume, and ctx2doc status
  • write .ctx2doc/config.json

Then use it from Codex:

ctx2doc snapshot

Claude Code

Inside the target project:

ctx2doc install claude

This will:

  • create or update .mcp.json
  • create or update .claude/settings.json
  • install a project-local Claude skill at .claude/skills/ctx2doc/SKILL.md
  • enable hook-based logging for Claude sessions

Then use it from Claude Code:

/ctx2doc snapshot

Core commands

ctx2doc snapshot
ctx2doc status
ctx2doc resume
ctx2doc install codex
ctx2doc uninstall codex
ctx2doc install claude
ctx2doc uninstall claude
ctx2doc mcp

Useful flags:

  • --project-root /path/to/project
  • --source auto|codex|claude
  • --output-dir docs/ctx2doc
  • --redaction-mode standard|off

What gets written

  • Snapshots: docs/ctx2doc/*.md
  • Project config: .ctx2doc/config.json
  • Claude runtime event logs: .ctx2doc/runtime/claude/*.jsonl

ctx2doc writes one full snapshot per invocation. It does not overwrite old snapshots.

Privacy and redaction

By default, ctx2doc redacts common secrets before writing snapshots:

  • bearer tokens
  • API keys and token-like assignments
  • private key blocks
  • common GitHub and sk-* token formats

Redaction is configurable with --redaction-mode off if you explicitly want raw content.

Uninstall

ctx2doc uninstall codex
ctx2doc uninstall claude

Uninstall removes integration glue. It does not delete your existing snapshots.

Development

python -m unittest discover -s tests -v
python -m build

Publishing

This repository includes a GitHub Actions workflow for PyPI Trusted Publishing.

Before the first release:

  • create the ctx2doc project on TestPyPI and PyPI
  • add this GitHub repository as a Trusted Publisher on both services
  • publish a tag like v0.2.0

The workflow file is at .github/workflows/publish.yml.

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

ctx2doc-0.2.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

ctx2doc-0.2.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file ctx2doc-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for ctx2doc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 351031940e6a09fb1daf1b3048a105e32d03bb8fc89678c075a5d305855d35b1
MD5 b446e8049468be5c4cdb4f728e2eff06
BLAKE2b-256 2b91de8a5508992547b1707658fdd3ad5d35c8e6beaa9baef0fda40fb519af5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctx2doc-0.2.0.tar.gz:

Publisher: publish.yml on greenblat17/ctx2doc

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

File details

Details for the file ctx2doc-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ctx2doc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2444fb39a7445058aa742c11bbb146bcefccba2cbeebe65122701c77c438cff3
MD5 0f5b3186a7adba511059a2ddc560eb89
BLAKE2b-256 4571a4012841907500acf84985a172224e925e7a7453012a5b8506c0cbd2aa1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctx2doc-0.2.0-py3-none-any.whl:

Publisher: publish.yml on greenblat17/ctx2doc

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