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

@claude-sessions/core

v0.3.3

Published

Core library for Claude Code session management

Readme

@claude-sessions/core

Core library for Claude Code session management.

Installation

npm install @claude-sessions/core
# or
pnpm add @claude-sessions/core

Usage

import { Effect } from 'effect'
import {
  listProjects,
  listSessions,
  readSession,
  searchSessions,
  deleteSession,
  renameSession,
} from '@claude-sessions/core'

// List all projects
const projects = await Effect.runPromise(listProjects())

// List sessions in a project
const sessions = await Effect.runPromise(listSessions(projectName))

// Read session messages
const messages = await Effect.runPromise(readSession(projectName, sessionId))

// Search sessions (title only)
const titleResults = await Effect.runPromise(
  searchSessions('query', { searchContent: false })
)

// Search sessions (title + content)
const allResults = await Effect.runPromise(
  searchSessions('query', { searchContent: true })
)

// Rename a session
await Effect.runPromise(renameSession(projectName, sessionId, 'New Title'))

// Delete a session (moves to backup)
await Effect.runPromise(deleteSession(projectName, sessionId))

API

Session Operations

| Function | Description | |----------|-------------| | listProjects() | List all Claude Code projects | | listSessions(projectName) | List sessions in a project | | readSession(projectName, sessionId) | Read all messages in a session | | searchSessions(query, options?) | Search sessions by title or content | | renameSession(projectName, sessionId, title) | Rename a session | | deleteSession(projectName, sessionId) | Delete a session (backup) | | deleteMessage(projectName, sessionId, uuid) | Delete a message | | splitSession(projectName, sessionId, uuid) | Split session at a message | | moveSession(source, sessionId, target) | Move session to another project | | getSessionFiles(projectName, sessionId) | Get files changed in session | | previewCleanup(projectName?) | Preview cleanup candidates | | clearSessions(options) | Clear empty/invalid sessions |

Path Utilities

| Function | Description | |----------|-------------| | getSessionsDir() | Get Claude Code sessions directory | | getTodosDir() | Get Claude Code todos directory | | folderNameToDisplayPath(name) | Convert folder name to display path | | displayPathToFolderName(path) | Convert display path to folder name |

Message Utilities

| Function | Description | |----------|-------------| | extractTextContent(message) | Extract text from message content | | extractTitle(messages) | Extract session title from messages | | isInvalidApiKeyMessage(message) | Check if message has invalid API key error | | isContinuationSummary(message) | Check if message is a continuation summary |

Agent & Todo Management

| Function | Description | |----------|-------------| | findLinkedAgents(projectName, sessionId) | Find agents linked to session | | findOrphanAgents(projectName?) | Find orphan agent files | | deleteOrphanAgents(projectName?) | Delete orphan agents | | findLinkedTodos(projectName, sessionId) | Find todos linked to session | | sessionHasTodos(projectName, sessionId) | Check if session has todos | | findOrphanTodos(projectName?) | Find orphan todo files | | deleteOrphanTodos(projectName?) | Delete orphan todos |

License

MIT