An open API service indexing awesome lists of open source software.

https://github.com/melagiri/code-insights

Turn your AI coding sessions into knowledge.
https://github.com/melagiri/code-insights

agent-rules ai-coding ai-coding-tools developer-tools prompt-engineering

Last synced: 10 days ago
JSON representation

Turn your AI coding sessions into knowledge.

Awesome Lists containing this project

README

          


Code Insights logo

Code Insights


npm version
npm downloads
license
node version
Socket Badge


Turn your AI coding sessions into knowledge.

Extract decisions, learnings, and prompt quality scores. Detect patterns. Get better at working with AI.

```bash
npx @code-insights/cli
```


Patterns — friction points, effective patterns, prompt quality, working style

Analyzes your sessions from **Claude Code, Cursor, Codex CLI, Copilot CLI, and VS Code Copilot Chat** to extract structured insights — decisions with trade-offs, learnings with root causes, prompt quality with actionable feedback, and cross-session patterns that surface what's working and what's not. All stored locally in SQLite, browsable through terminal analytics and a built-in dashboard.

**No accounts. No cloud. No data leaves your machine.**

---

> **Claude Code users: zero-config analysis, zero cost.**
> Install the hook once. Every session gets analyzed automatically using your Claude subscription.
> ```bash
> code-insights install-hook
> ```

---

> **Works with Ollama — free, local, zero API keys.**
> If you have [Ollama](https://ollama.com) installed, `code-insights` will detect it automatically and use it for AI analysis. No account, no cost, no data leaves your machine.
>
> ```bash
> ollama pull llama3.3 # recommended
> npx @code-insights/cli # Ollama detected automatically
> ```

---

## What You Get

### Decisions, Learnings & Prompt Quality

Each session is analyzed to extract structured insights — decisions with trade-offs and alternatives, learnings with root causes, and prompt quality scores across 5 dimensions with actionable before/after takeaways.


Session detail — insights, prompt quality, summary, decisions

### Cross-Session Patterns

Weekly synthesis detects friction points, effective patterns, and prompt quality trends across all your sessions. Navigate week-by-week to see how your habits evolve — and export generated rules for your CLAUDE.md or .cursorrules.


Patterns — friction points, effective patterns, generated rules

### AI Fluency Score

All of the above rolls up into your AI Fluency Score — a shareable snapshot of your coding fingerprint, working style, and top patterns.


AI Fluency Score — your coding fingerprint

### Analytics & Cost Tracking

Activity charts, cost breakdown by project and model, session types, and multi-tool usage — all in one dashboard.


Analytics — activity charts, model usage, cost breakdown, project table

### Terminal Analytics

Don't need a browser? `code-insights stats` gives you the full picture from the terminal.


Terminal stats — sessions, cost, activity chart, top projects

---

## Supported AI Tools

| Tool | Data Location |
|------|---------------|
| Claude Code | `~/.claude/projects/**/*.jsonl` |
| Cursor | Workspace storage SQLite (macOS, Linux, Windows) |
| Codex CLI | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` |
| Copilot CLI | `~/.copilot/session-state/{id}/events.jsonl` |
| VS Code Copilot Chat | Platform-specific Copilot Chat storage |

Sessions from all tools are discovered automatically during sync.

---

## Quick Start

```bash
# Try instantly (no install needed)
npx @code-insights/cli

# Or install globally
npm install -g @code-insights/cli
code-insights # sync sessions + open dashboard
code-insights install-hook # auto-sync + auto-analyze on session end
```

### Common Commands

```bash
code-insights # sync + open dashboard (zero-config)
code-insights stats # terminal analytics (last 7 days)
code-insights stats today # today's sessions
code-insights stats cost # cost breakdown by project and model
code-insights dashboard # start dashboard server
code-insights sync # sync sessions only
code-insights sync --source cursor # sync from a specific tool
code-insights reflect # cross-session pattern synthesis
code-insights reflect --week 2026-W11 # reflect on a specific week
code-insights config llm # configure LLM provider
code-insights install-hook # auto-sync + auto-analyze when sessions end
```

See [`cli/README.md`](cli/README.md) for the full CLI reference.

---

## Architecture

```
Session files (Claude Code, Cursor, Codex CLI, Copilot CLI, VS Code Copilot Chat)


┌──────────────────┐
│ CLI Providers │ discover + parse sessions
└──────────────────┘


┌──────────────────┐
│ SQLite Database │ ~/.code-insights/data.db
└──────────────────┘
│ │
┌─────────┘ └──────────┐
▼ ▼
┌───────────────┐ ┌──────────────────┐
│ stats/reflect │ │ Hono API server │
│ (terminal) │ │ + React SPA │
└───────────────┘ │ localhost:7890 │
└──────────────────┘


┌──────────────────┐
│ LLM Providers │ analysis, facets,
│(API key or Ollama)│ reflect, export
└──────────────────┘
```

The monorepo contains three packages:
- **`cli/`** — Node.js CLI, session providers, SQLite writes, terminal analytics
- **`server/`** — Hono API server, REST endpoints, LLM proxy (API keys stay server-side)
- **`dashboard/`** — Vite + React SPA, served by the Hono server

## Development

```bash
git clone https://github.com/melagiri/code-insights.git
cd code-insights
pnpm install
pnpm build
cd cli && npm link
code-insights --version
```

See [`cli/README.md`](cli/README.md) for the full CLI reference, and [`CONTRIBUTING.md`](CONTRIBUTING.md) for contribution guidelines.

## Privacy

Session data stays on your machine in `~/.code-insights/data.db`. No accounts, no cloud sync. Anonymous usage telemetry is opt-out (`code-insights telemetry disable`). LLM analysis uses your own API key (or Ollama locally) — session content goes only to the provider you configure.

## License

MIT — see [LICENSE](LICENSE) for details.