Skip to content

Instantly share code, notes, and snippets.

@bdougie
Created March 13, 2026 12:08
Show Gist options
  • Select an option

  • Save bdougie/db76a611e550c98d5da03dc1750ab694 to your computer and use it in GitHub Desktop.

Select an option

Save bdougie/db76a611e550c98d5da03dc1750ab694 to your computer and use it in GitHub Desktop.
Claude Code skill for querying local tapes agent session data
name description
tapes
Use when the user says "check the tapes", "search tapes", "tapes search", or wants to look up past agent sessions. Starts tapes services if needed and queries the local SQLite store at ~/.tapes/.

Tapes

Query local tapes session data. The tapes SQLite database lives at ~/.tapes/ and contains recorded LLM agent sessions across all projects.

Trigger phrases

  • "check the tapes"
  • "search tapes for ..."
  • "tapes search ..."
  • "look up sessions about ..."
  • "what did I work on ..."

Ensure services are running

Before searching, the tapes API server must be running. Start it in the background if it isn't already:

# Check if already running
curl -sf http://localhost:8081/health > /dev/null 2>&1

# If not running, start it in the background pointing at the global sqlite db
tapes serve api --sqlite ~/.tapes/tapes.db &

Use the Bash tool with run_in_background for the serve command so it doesn't block the conversation.

Search

Run searches with the tapes CLI:

tapes search "<query>" --api-target http://localhost:8081 --top 5
  • Adjust --top based on how broad or narrow the user's question is
  • Use --quiet when piping results to other commands like tapes skill generate

Deck (session overview)

To show session summaries and costs:

tapes deck --sqlite ~/.tapes/tapes.db --since 24h

Useful flags:

  • --since 24h / --since 7d for time windows
  • --sort cost|time|tokens|duration
  • --model <name> to filter by model
  • --project <name> to filter by project
  • --session <id> to drill into a specific session

Workflow

  1. Check if the API is already listening on port 8081
  2. If not, start tapes serve api --sqlite ~/.tapes/tapes.db in the background
  3. Run the search or deck command the user asked for
  4. Present results concisely
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment