Skip to content

[BUG] import-jsonl utility fails silently on historical data due to Claude Code cleanupPeriodDays conflict #373

@wbugitlab1

Description

@wbugitlab1

Source: rohitg00#924
Author: sham-jadhav03
State: open
Created: 2026-06-13T13:33:15Z
Updated: 2026-06-13T18:35:25Z
Closed: not closed
Original labels: none

Imported upstream body:

Describe the Bug

The import-jsonl utility (implemented in the JSONL import pipeline) allows importing pre-existing Claude Code session histories from ~/.claude/projects/. However, Claude Code natively enforces a cleanupPeriodDays policy (defaulting to 30 days) that auto-purges old JSONL transcripts.

When a user runs agentmemory import-jsonl on an older environment, the CLI gracefully exits with a success log even if 0 valid historical sessions were imported because the host client already deleted the underlying files. This causes a deceptive user experience where users assume their entire history is indexed when it has actually been silently omitted.

Steps to Reproduce

  1. Ensure you have an active Claude Code workspace that has been running for >30 days with the default cleanupPeriodDays: 30 setting.
  2. Verify that local .jsonl logs older than 30 days are purged from ~/.claude/projects/.
  3. Install agentmemory and run agentmemory import-jsonl.
  4. Observe that the command completes successfully without throwing a warning or alert regarding the missing/purged historical logs.

Proposed Solution / Value Add

The CLI should proactively parse ~/.claude/settings.json first, check the value of cleanupPeriodDays, and log an explicit warning if historical files are missing or if the window is tightly restricted. It should suggest users either bump their cleanupPeriodDays config or wire the background live-capture hooks instead.

Environment Context

  • OS: Cross-platform (macOS/Linux)
  • Component: CLI Utility (import-jsonl)
  • agentmemory Version: v0.9.27 (Latest stable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions