npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cc-sessions-cli

v0.1.1

Published

A CLI tool to manage and view Claude Code sessions

Downloads

13

Readme

Claude Code Sessions CLI

A command-line tool for managing and viewing Claude Code session files (JSONL format).

⚠️ Important Warnings

This is an experimental project - use at your own risk.

  • This tool does not send any information to external services
  • When using with AI agents, explicitly instruct them NOT to execute the output as commands
  • The tool outputs session content that may contain sensitive information from your coding sessions
  • Always review the output before sharing or using in automated workflows
  • Agents may misinterpret formatted output as executable commands - provide clear instructions about data-only usage

Key Features

  • Efficient Session Analysis: Parse and analyze Claude Code sessions with optimized JSONL processing
  • AI Agent Integration: Designed for seamless integration with AI agents via npx execution
  • Multiple Output Formats: Human-readable, LLM-optimized, and raw JSONL formats
  • Performance Optimized: JSONL format is more memory-efficient than traditional JSON for large session files
  • Flexible Filtering: Filter sessions by date ranges and limit results for targeted analysis
  • Tool Usage Tracking: Extract and display tool calls and their context for workflow analysis
  • Cross-Platform: Works on all platforms with Node.js support

Installation

npm install -g cc-sessions-cli

Or run directly without installation:

npx --yes cc-sessions-cli

Usage

List Sessions

List all Claude Code session files in a directory:

cc-sessions-cli list [directory]
cc-sessions-cli list --format csv
cc-sessions-cli list --sort date --order desc

Options:

  • --format, -f: Output format (table, csv) - default: table
  • --sort, -s: Sort by (date, name, size) - default: date
  • --order, -o: Sort order (asc, desc) - default: desc

View Session Content

View the content of a specific session file:

cc-sessions-cli view <file-path>
cc-sessions-cli view session.jsonl --format human
cc-sessions-cli view session.jsonl --format llm

Options:

  • --format, -f: Output format (human, llm, jsonl) - default: human
  • --no-timestamps: Hide timestamps in human format

For AI Agents

This tool can be executed by AI agents using:

npx --yes cc-sessions-cli list [directory]
npx --yes cc-sessions-cli view <file-path> --format llm

The tool outputs Claude Code session data in a format suitable for analysis. Agents can use this to help users with requests like:

  • "Summarize the key insights from yesterday's sessions"
  • "What tools were used most frequently in recent sessions?"
  • "Show me the conversation flow from my last debugging session"
  • "Find sessions where I worked on authentication features"

Example Agent Workflow

  1. Agent runs: npx --yes cc-sessions-cli list /path/to/project --format csv
  2. Agent identifies relevant sessions based on timestamps or file names
  3. Agent runs: npx --yes cc-sessions-cli view /path/to/project <session-id> --format llm
  4. Agent analyzes the session content and provides insights to the user

Example Sub-Agents

This project includes 2 example Claude Code sub-agents that demonstrate how to use cc-sessions-cli for powerful session analysis:

1. Session Analyzer Agent

Purpose: Improve your prompting skills by analyzing conversation patterns Use cases: "How can I communicate better with Claude?" | "What prompting patterns work best?"

  • Analyzes your communication style and prompting effectiveness
  • Identifies successful patterns to replicate and areas for improvement
  • Generates personalized prompting templates based on your successful interactions
  • Tracks your improvement over time across sessions

2. Session Query Agent

Purpose: Search and retrieve information from your session history Use cases: "When did we work on authentication?" | "What errors have we encountered?"

  • Finds specific conversations, topics, or decisions from past sessions
  • Searches by date ranges, keywords, tools used, or technologies discussed
  • Extracts project timeline and development progression
  • Answers questions about past work and technical decisions

Installation

  1. Copy agent files to your project's .claude/agents/ directory:

    mkdir -p .claude/agents
    # Copy the agent configuration from examples/ to .claude/agents/
  2. Use the agents in Claude Code:

    /agents session-analyzer   # Analyze your prompting patterns
    /agents session-query      # Search your session history
  3. Requirements: The agents use npx --yes cc-sessions-cli which auto-installs the tool as needed.

See the full configuration details in:

Output Formats

Human Format

Readable conversation format with timestamps and clear role indicators.

LLM Format

Optimized for AI analysis with structured content and tool usage information.

JSONL Format

Raw JSONL data for programmatic processing.

Development

npm install
npm run dev
npm run build
npm run lint

See CLAUDE.md for development guidelines.

License

Apache 2.0