Repository navigation
feat: add experimental Chat Export lab - #20
Conversation
Export local Claude Code, Codex, Cursor and Grok Bot chat history to one Markdown file per conversation so any agent can search it. Stdlib-only, read-only, incremental, with best-effort credential redaction. Synthetic-fixture tests run in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exported chats are private: set umask 077 and tighten export directories to 0700 so other local users cannot read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1f3213ecf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Verify Chat Export fixtures | ||
| run: python3 labs/chat-export/tests/run.py |
There was a problem hiding this comment.
Trigger the workflow for Chat Export changes
When a later PR changes only labs/chat-export/**, this fixture step will never run because this workflow's pull_request.paths filter includes labs/opc-company/** and the READMEs, but not the new lab. Add the Chat Export path to the filter so changes to these exporters are actually covered by their CI test.
Useful? React with 👍 / 👎.
|
|
||
| # Credentials are redacted before anything touches disk. Most specific patterns first. | ||
| REDACTIONS = [ | ||
| (re.compile(r"0x[a-fA-F0-9]{64}\b"), "<REDACTED_PRIVKEY>"), |
There was a problem hiding this comment.
Redact PEM private keys before writing exports
When a chat contains a conventional PEM private key, it is written verbatim: this rule only covers 64-hex-character blockchain keys, while the generic base64 rule does not match PEM bodies because they are normally wrapped into short lines. This contradicts the documented promise that private keys are replaced before export, so add a multiline PEM-key rule (and a fixture) rather than relying on the contiguous-base64 pattern.
AGENTS.md reference: AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
What
Adds
labs/chat-export, an experimental lab that exports local Claude Code, Codex, Cursor and Grok Bot (macOS app) chat history to one Markdown file per conversation, so any agent can search past conversations withrgor a full-text index.Main README (zh/en) gets one entry line each; CI runs the new synthetic-fixture tests.
Verification
python3 labs/chat-export/tests/run.py→CHAT_EXPORT_TEST_OK(synthetic fixtures only)./scripts/verify.sh→VERIFY_OKChat logs stay retrieval hints; files remain the source of truth.
🤖 Generated with Claude Code