claudemigrate

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package claudemigrate discovers Claude Code assets and imports compatible local sessions into Codog's workspace-scoped session store.

Index

Constants

View Source
const (
	// DefaultMaxSessions bounds the number of recent Claude Code sessions
	// selected by one migration.
	DefaultMaxSessions = 50
	// DefaultMaxAge bounds session discovery to recently modified transcripts.
	DefaultMaxAge = 30 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func DefaultSourceHome

func DefaultSourceHome() (string, error)

DefaultSourceHome returns the Claude Code data directory selected by the standard environment variable or the current user's home directory.

func ParseMaxAge

func ParseMaxAge(value string) (time.Duration, error)

ParseMaxAge converts a non-negative day count into a discovery duration.

Types

type Asset

type Asset struct {
	Kind    string   `json:"kind"`
	Mode    string   `json:"mode"`
	Count   int      `json:"count"`
	Sources []string `json:"sources,omitempty"`
}

Asset describes one class of Claude Code data visible to Codog.

type Options

type Options struct {
	SourceHome   string
	Workspace    string
	SessionStore *session.Store
	MaxSessions  int
	MaxAge       time.Duration
	Apply        bool
}

Options controls Claude Code asset discovery and session migration.

type Report

type Report struct {
	Kind               string          `json:"kind"`
	Action             string          `json:"action"`
	Status             string          `json:"status"`
	SourceHome         string          `json:"source_home"`
	Workspace          string          `json:"workspace"`
	Assets             []Asset         `json:"assets"`
	SessionsDiscovered int             `json:"sessions_discovered"`
	SessionsEligible   int             `json:"sessions_eligible"`
	SessionsImported   int             `json:"sessions_imported"`
	SessionsSkipped    int             `json:"sessions_skipped"`
	SessionsFailed     int             `json:"sessions_failed"`
	Sessions           []SessionResult `json:"sessions"`
	Notes              []string        `json:"notes"`
}

Report is the stable machine-readable result of a migration inspection or run.

func Run

func Run(opts Options) (Report, error)

Run discovers compatible assets and optionally imports eligible sessions.

type SessionResult

type SessionResult struct {
	Source       string `json:"source"`
	SessionID    string `json:"session_id,omitempty"`
	ModifiedAt   string `json:"modified_at,omitempty"`
	MessageCount int    `json:"message_count,omitempty"`
	Status       string `json:"status"`
	Reason       string `json:"reason,omitempty"`
	Target       string `json:"target,omitempty"`
}

SessionResult describes one discovered Claude Code transcript.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL