Skip to main content

Sync Claude Code conversation logs to Git repository

Project description

ccjournal

Sync Claude Code conversation logs to a Git repository.

日本語

Prerequisites

Required

  • Python 3.11+
  • Git - for committing and pushing logs
  • Claude Code - this tool syncs logs generated by Claude Code

Optional

  • GitHub CLI (gh) - required for public repository detection

Features

  • Automatically sync Claude Code session logs to a Git repository
  • Organize logs by date or project
  • Support for worktrees (groups by Git remote URL)
  • Auto-commit and push to remote
  • Configurable via TOML

Installation

pipx install ccjournal
# or
uv tool install ccjournal

Quick Start

# Initialize configuration
ccjournal init

# Manually sync logs
ccjournal sync

# Show configuration
ccjournal config show

Configuration

Configuration file is located at ~/.config/ccjournal/config.toml.

Quick reference:

[output]
repository = "~/Documents/claude-logs"
structure = "date"                    # "date" or "project"
auto_push = true
allow_public_repository = false       # Security: block push to public repos
allow_unknown_visibility = false      # Security: block push when visibility unknown

[sync]
interval = 300                        # seconds (for daemon)
exclude_system = true                 # exclude system messages
exclude_tool_messages = true          # exclude [Tool: XXX] only messages

[projects.aliases]
"/path/to/project" = "custom-name"    # optional: customize project names

For complete configuration reference, see docs/configuration.md.

Security

Fail-Safe Design

ccjournal includes multiple security layers to prevent accidental exposure of sensitive information:

  1. Public repository protection - Blocks push to public repositories by default
  2. Unknown visibility protection - Blocks push when visibility cannot be determined (non-GitHub repos)
  3. Sensitive data masking - Automatically masks API keys, tokens, passwords in output

Public Repository Protection

By default, ccjournal blocks pushing to public repositories to prevent accidental exposure of sensitive information that may be included in conversation logs, such as:

  • API keys or passwords mentioned in prompts
  • Internal URLs (Notion, Confluence, etc.)
  • Confidential discussion content

If the output repository is detected as public on GitHub, the sync will fail with an error:

Error: Refusing to push to public repository: /path/to/repo

Note: Public repository detection requires GitHub CLI (gh). For non-GitHub repositories, set allow_unknown_visibility = true after confirming the repository is private.

Directory Structure

Date-based (default):

claude-logs/
└── 2026/01/16/
    ├── my-project.md
    └── another-repo.md

Project-based:

claude-logs/
└── github.com-user-my-project/
    ├── 2026-01-16.md
    └── 2026-01-15.md

Commands

Command Description
ccjournal init Initialize configuration interactively
ccjournal sync Sync logs to repository
ccjournal sync --dry-run Preview what would be synced
ccjournal sync --date 2026-01-16 Sync specific date
ccjournal config show Show current configuration
ccjournal config edit Open config in editor
ccjournal list List recent synced logs
ccjournal daemon install Show daemon setup instructions

Automatic Sync

macOS (launchd)

ccjournal daemon install

Follow the instructions to set up automatic sync every 5 minutes.

Linux (systemd)

Create user services for periodic sync. See ccjournal daemon install for details.

cron

# Sync every 5 minutes
*/5 * * * * /usr/local/bin/ccjournal sync

Development

# Clone the repository
git clone https://github.com/TAKEDA-Takashi/ccjournal.git
cd ccjournal

# Install dependencies
uv sync --dev

# Run tests
uv run pytest

# Type check
uv run pyright

# Lint
uv run ruff check

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

ccjournal-0.1.0.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

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

ccjournal-0.1.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ccjournal-0.1.0.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ccjournal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82d2a01889efb5bdfbe66bd6b569e092e9d04792d08ccb373df573edb0d13d28
MD5 cf1e82e3058d36c6e3e056b2cebddf79
BLAKE2b-256 3671d9170bde14d7a75569e92f028742b8c523c8af3508dd546ca9756c2819ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccjournal-0.1.0.tar.gz:

Publisher: publish.yml on TAKEDA-Takashi/ccjournal

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

File details

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

File metadata

  • Download URL: ccjournal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ccjournal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76a70da8bf939a7c11c519e789410904b326077ee965b1932539e773f7e1ec6d
MD5 196c2f11bdc2200717d1466653613f03
BLAKE2b-256 1d038df0e10fda2428cf0254024a68e31527746bfe94821e91a01f15a37b5c07

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccjournal-0.1.0-py3-none-any.whl:

Publisher: publish.yml on TAKEDA-Takashi/ccjournal

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