A Codex plugin that saves and shares coding sessions to GitHub as readable Markdown.
- Converts Codex JSONL session logs into clean, readable Markdown
- Includes user and Codex messages with collapsible tool calls
- Excludes system and developer instructions
- Creates a local preview for review before anything is published
- Commits and pushes approved sessions to any GitHub repository
- Organizes exports by GitHub username under
sessions/codex/ - Supports optional descriptions for clearer titles and filenames
- Python 3.10+
- Codex
- GitHub CLI (
gh) installed and authenticated - A GitHub repository for session exports (public or private)
For PostHog, run:
curl -fsSL https://raw.githubusercontent.com/PostHog/codex-share-plugin/main/install.sh | bashThis installs the plugin and configures the private PostHog/agent-sessions repository. Restart Codex and start a new thread after installation.
To publish somewhere else:
curl -fsSL https://raw.githubusercontent.com/PostHog/codex-share-plugin/main/install.sh | \
bash -s -- --codex-share-repo owner/repositoryReplace owner/repository with the repository where sessions should be stored. The installer detects your GitHub username with gh and saves the repository to ${CODEX_HOME:-~/.codex}/share-plugin-config.json.
codex plugin marketplace add PostHog/codex-share-plugin
codex plugin add codex-share-plugin@codex-share-pluginFrom a local checkout, run:
codex plugin marketplace add /absolute/path/to/codex-share-plugin
codex plugin add codex-share-plugin@codex-share-pluginRestart Codex and start a new thread after installing.
Ask Codex to share the current session:
Share this session.
Add a description to create a more useful title and filename:
Share this session as “fixing authentication”.
Codex writes a local Markdown preview first. Review it, then approve publishing when prompted. You can also invoke the installed share-session skill explicitly.
Published sessions are organized like this:
your-sessions-repo/
└── sessions/
└── codex/
└── github-username/
├── 20260721-142530-fixing-authentication.md
├── 20260721-153245-adding-tests.md
└── ...
The same repository can hold exports from multiple agents by giving each one its own namespace, such as sessions/claude/ and sessions/codex/.
# Fixing authentication
**Exported:** 2026-07-21 14:25:30 UTC
## User
Can you help me fix the authentication bug?
## Codex
I'll investigate the authentication flow and start with the relevant files.
<details>
<summary><code>exec_command</code></summary>
```json
{
"cmd": "rg -n authentication src"
}
```
</details>The quick installer writes the target repository to ${CODEX_HOME:-~/.codex}/share-plugin-config.json.
To change it later, ask Codex:
Configure session sharing to use
owner/repository.
Or run the bundled script directly from this repository:
python3 plugins/codex-share-plugin/scripts/share_session.py \
--configure-repo owner/repositoryCODEX_SHARE_REPO overrides the configured repository. The publishing script also supports --repo, --branch, and --base-path overrides when run directly.
- Finds the latest Codex session associated with the current working directory.
- Converts user messages, Codex responses, and tool calls to Markdown.
- Writes a local preview and waits for explicit approval.
- Clones the configured repository into a temporary directory.
- Commits the session under
sessions/codex/{github-username}/and pushes it. - Returns a direct GitHub link to the published transcript.
Session transcripts may contain prompts, source code, tool inputs, local paths, or secrets. Review every preview before publishing and prefer a private repository for sensitive work.
The plugin uses your existing GitHub CLI authentication and never publishes without a preview and explicit approval.
Re-run the installer with a repository:
curl -fsSL https://raw.githubusercontent.com/PostHog/codex-share-plugin/main/install.sh | \
bash -s -- --codex-share-repo owner/repositoryOr use the configuration command shown above.
Check that the GitHub CLI is installed and authenticated:
gh --version
gh auth statusIf needed, run gh auth login and confirm that your account has write access to the target repository.
Confirm that:
- The repository exists and uses the
owner/repositoryformat. - Your GitHub account can access and write to it.
- The configured branch exists. The default is
main. - Your authentication has not expired. Run
gh auth refreshif necessary.
Run the test suite:
python3 -m unittest discover -s testsAfter changing an installed local plugin, upgrade the marketplace and reinstall the plugin before testing it in a new Codex thread.
MIT