convez.ai
AgenteProdutividadeIniciante
Laotree

Logs Locally Plugin

Laotree/logs-locally-plugin

Histórico automático de sessões de IA em SQLite com UI web local

Ver no GitHub
InicialPluginScore · de 0 a 100

Agent que captura automaticamente sessões de Claude Code, Pi e Codex em banco SQLite local com interface web para busca e análise. Funciona sem configuração, sem daemon e sem enviar dados para a nuvem — tudo fica na sua máquina.

Instalação

$npx convez-ai Laotree/logs-locally-plugin

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
4
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
v0.12.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Revisar e pesquisar histórico completo de sessões de coding
  • Analisar qualidade de sessões com scoring automático (7 dimensões)
  • Auditar sessões para segurança (scrubbing automático de credenciais)

Veredito

Solução robusta e bem pensada para quem usa Claude Code frequentemente. A abordagem zero-config com SQLite local e UI web é prática; o scrubbing automático de credenciais é um diferencial de segurança. Recomendado para desenvolvedores que querem auditoria local de sessões de IA sem overhead.

README

A tradução para o português deste README ainda está na fila.

Plugin MIT License

llp — zero-config session history for AI coding agents

Claude Code, Pi agent, Codex CLI, and opencode sessions vanish the moment you close the terminal. llp saves every one of them to a local SQLite database and gives you a searchable web UI — automatically, after every session. Zero config. No daemon. No cloud. No API key.

Homepage · Installation · GitHub

llp demo — install, import a session, and browse it in the web UI

# Install (macOS / Linux)
brew tap Laotree/tap && brew install llp

# Save your latest session right now
llp import

# Browse all sessions at http://127.0.0.1:8484
llp serve

Then add one line to ~/.claude/settings.json so it runs automatically on every session exit:

{
  "hooks": {
    "Stop": [{ "hooks": [{ "type": "command", "command": "llp import" }] }]
  }
}

That's it. No daemon, no cloud, no API key.


What is "plugin"? The name reflects that llp integrates with Claude Code's Stop hook — but it's a plain CLI binary. No marketplace or plugin runtime required. Install with Homebrew or cargo install and it works.

Logs Locally web UI — session list and conversation detail

What you get

  • Full session history — every Claude Code, Pi agent, Codex CLI, and opencode session stored in SQLite
  • Searchable web UI — filter by model, time, keyword, or quality score
  • Automatic quality scoring — 7 dimensions (security, efficiency, planning…) with letter grades
  • Privacy-first — API keys, tokens, and email addresses are scrubbed before storage; nothing leaves your machine

How It Works

Each time Claude Code exits, the Stop hook triggers llp import, which:

  1. Finds the most recent .jsonl session file in ~/.claude/projects/<project>/
  2. Parses messages, models, token usage, and session metadata
  3. Upserts into a local SQLite database (deduplicated by session ID)
  4. Also imports the latest Pi agent session for the same project (if piJsonlDir is configured)
  5. Also imports the latest Codex CLI session (if codexSessionsDir is configured)
  6. Also imports the latest opencode session (if opencodeStorageDir is configured)
  7. Scores each session across 7 quality dimensions (security, effectivity, solidity, efficiency, planning, recovery, accuracy)
  8. Scrubs sensitive data (API keys, tokens, credentials, home paths, emails) before storage

The serve command starts a web UI at http://127.0.0.1:8484 for browsing and searching sessions.

Installation

Option 1: Homebrew (recommended)

brew tap Laotree/tap
brew install llp

Option 2: Install from source

cargo install --git https://github.com/Laotree/logs-locally-plugin

Option 3: Build locally

cargo build --release
cp target/release/llp ~/.local/bin/llp

Make sure ~/.local/bin is in your PATH.

Configuration

Claude Code Hook (auto-import on exit)

mkdir -p ~/.claude

Add to ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "llp import"
          }
        ]
      }
    ]
  }
}

Optional: config.json

Create config.json in the working directory or pass a custom path with llp --config <path>:

{
  "db_path": "~/.local/share/logs-locally-plugin/logs.db",
  "db_paths": [
    "~/.local/share/logs-locally-plugin/logs.db",
    "~/path/to/secondary/logs.db"
  ],
  "claude_projects_dir": "~/.claude/projects",
  "piJsonlDir": "~/.pi/agent/sessions",
  "codexSessionsDir": "~/.codex/sessions",
  "opencodeStorageDir": "~/.local/share/opencode/storage",
  "host": "127.0.0.1",
  "port": 8484
}

All fields are optional — defaults are shown above.

FieldDescriptionDefault
db_pathPrimary SQLite database path~/.local/share/logs-locally-plugin/logs.db
db_pathsMultiple DB paths (import writes to all, serve reads the first)falls back to db_path
claude_projects_dirClaude Code sessions directory~/.claude/projects
piJsonlDirPi agent sessions directory (optional — omit to skip pi imports)none
codexSessionsDirCodex CLI sessions directory (optional — omit to skip codex imports)none
opencodeStorageDiropencode storage directory (optional — omit to skip opencode imports)none
hostWeb server bind address127.0.0.1
portWeb server port8484

Usage

Import the latest session

cd /path/to/your/project
llp import

This auto-detects the Claude Code project from the current working directory and imports the most recent session (plus Pi agent, Codex CLI, and opencode sessions if configured).

You can also import a specific JSONL file:

llp import /path/to/specific/session.jsonl

Import all historical sessions

llp import-all /path/to/your/project

Imports every past session (Claude, Pi, Codex, and opencode) for the given project directory.

Browse logs

llp serve
# Open http://127.0.0.1:8484
llp serve --port 9090   # override port

Features:

  • Session list with search and filters (by model, source, time range, keyword)
  • Message detail view with thinking blocks and tool calls
  • Session scoring (7 quality dimensions with letter grades S/A/B/C/D/F)
  • Multi-agent support — browse Claude Code, Pi agent, Codex CLI, and opencode sessions in one UI
  • Live auto-refresh (10s polling)
  • Statistics dashboard (token usage by model, score aggregates)
  • Dark theme, Claude web-inspired design

Re-score sessions

llp rescore

Re-evaluates session quality scores. Useful after upgrading from a version that didn't include session scoring. Trivial sessions (single commands, empty exchanges) are marked N/A.

Command reference

Usage: llp [OPTIONS] <COMMAND>

Commands:
  import       Import the latest Claude Code, Pi, Codex, or opencode session into SQLite
  serve        Start the local web server for browsing logs
  import-all   Import all existing sessions from a project
  rescore      Re-score all sessions in the database
  help         Print help

Options:
  -c, --config <FILE>  Path to config file [default: config.json]
  -h, --help           Print help

Build

# Build the release binary
cargo build --release

# Install to ~/.local/bin
cp target/release/llp ~/.local/bin/llp

# Or install from source in one step
cargo install --git https://github.com/Laotree/logs-locally-plugin

Makefile targets

make build    # cargo build
make release  # cargo build --release
make install  # build release + copy to ~/.local/bin + install hooks
make test     # cargo test
make serve    # cargo run -- serve
make import   # cargo run -- import
make rescore  # cargo run -- rescore
make fmt      # cargo fmt
make lint     # cargo clippy
make clean    # cargo clean

Database

Sessions and messages are stored in a SQLite database at ~/.local/share/logs-locally-plugin/logs.db (configurable). Imports can write to multiple DBs simultaneously (db_paths config).

-- Sessions table
CREATE TABLE sessions (
    id TEXT PRIMARY KEY,
    title TEXT,
    model TEXT,
    created_at TEXT NOT NULL,
    updated_at TEXT NOT NULL,
    message_count INTEGER DEFAULT 0,
    token_count INTEGER DEFAULT 0,
    cwd TEXT,
    git_branch TEXT,
    version TEXT,
    source TEXT NOT NULL DEFAULT 'claude'   -- 'claude' | 'pi' | 'codex' | 'opencode'
);

-- Messages table
CREATE TABLE messages (
    id TEXT PRIMARY KEY,
    session_id TEXT NOT NULL REFERENCES sessions(id),
    role TEXT NOT NULL,
    content TEXT NOT NULL,
    created_at TEXT NOT NULL,
    token_count INTEGER DEFAULT 0,
    parent_id TEXT,
    model TEXT
);

-- Scoring table (auto-scored on import)
CREATE TABLE scores (
    session_id TEXT PRIMARY KEY REFERENCES sessions(id),
    total_score INTEGER NOT NULL,
    security INTEGER NOT NULL,
    effectivity INTEGER NOT NULL,
    solidity INTEGER NOT NULL,
    efficiency INTEGER NOT NULL,
    planning_quality INTEGER NOT NULL,
    recovery_ability INTEGER NOT NULL,
    hallucination_rate INTEGER NOT NULL,
    grade TEXT NOT NULL,            -- S/A/B/C/D/F
    scored_at TEXT NOT NULL
);

Scoring dimensions

Each session is scored on 7 dimensions (max 100 total):

DimensionMaxWhat it measures
Security15Dangerous commands (rm -rf, pipe-to-shell, etc.)
Effectivity15Completion rate, failure vs. success signals
Solidity10Test coverage: test execution > test references > code generation
Efficiency15Correction loops, token bloat, short clean sessions
Planning15Structured plans, numbered steps, sequential thinking
Recovery15Error handling, self-correction rate
Accuracy15User satisfaction vs. corrections and confusion

Trivial sessions (single commands, empty exchanges) are marked N/A instead of scored.

Security & privacy

Before storage, all content is scrubbed for sensitive data:

  • API keys (Anthropic, OpenAI, GitHub, AWS)
  • Bearer tokens and credentials in URLs
  • Environment variable secrets (names ending in KEY/SECRET/TOKEN/PASSWORD)
  • Home directory paths (/Users/name → ~)
  • Email addresses
Ver o original no GitHub

Bom para

Relacionados