Skip to content

Harsh9005/ai-session-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | Deutsch

AI Session Logger

Persistent session memory for AI coding agents. Track files, decisions, and progress across conversations.

License: MIT Claude Code Zero Config

Your AI agent forgets everything between sessions. This fixes that.


The Problem

Every time you start a new AI coding session:

  • The agent has zero memory of what you did yesterday
  • You re-explain the same context every time
  • Decisions made in previous sessions are lost
  • File changes are forgotten — the agent explores the same code again
  • Complex multi-session projects lose continuity

The Solution

Three commands. Full session memory.

/log start    → Begin tracking everything
/log update   → Checkpoint progress mid-session
/log end      → Finalize, index, and create resume context

The session logger automatically tracks:

  • Every file touched or created
  • Every decision made and why
  • Every blocker encountered
  • Progress milestones
  • Skills and tools used

And produces a resume prompt you can paste into your next session for instant context recovery.

Features

Feature What It Does
Automatic File Tracking Logs every file read, created, or modified during the session
Decision Log Captures what was decided and why — no more re-debating
Progress Checkpoints Timestamped milestones so you know where you left off
Session Index Rolling index of all sessions (capped at 200, auto-archived)
Recent Work Summary Last ~20 sessions in ~100 lines — cheap context for any conversation
Resume Prompt Copy-paste context block for seamless next-session handoff
Multi-Directory Support Works across multiple project directories in one session
Midnight-Spanning Handles sessions that cross midnight correctly
Retroactive Logging Call /log end without /log start — it reconstructs what happened

Quick Start

1. Install as a Claude Code skill

# Copy SKILL.md to your skills directory
cp SKILL.md /path/to/your/skills/session-logger/SKILL.md

2. Configure paths

Edit SKILL.md and set your workspace paths:

# Find this line and update:
~/your-workspace/session_logs/SESSION_INDEX.md
~/your-workspace/session_logs/RECENT_WORK.md

3. Use it

You: /log start
Agent: Session 20250321-143022 started. Tracking files, decisions, and progress.

You: [... do your work ...]

You: /log update
Agent: Checkpoint saved. 5 files modified, 3 decisions logged.

You: /log end
Agent: Session finalized. Index updated. Resume prompt ready.

How It Works

Session Lifecycle

graph LR
    A["log start"] --> B["Active Session"]
    B --> C["Auto-track files"]
    B --> D["Auto-track decisions"]
    B --> E["Auto-track progress"]
    C --> F["log update"]
    D --> F
    E --> F
    F --> B
    B --> G["log end"]
    G --> H["Write Summary"]
    G --> I["Update Index"]
    G --> J["Update Recent Work"]
    G --> K["Generate Resume Prompt"]
Loading

What Gets Logged

## Session: 20250321-143022
**Directory:** ~/projects/my-api
**Duration:** 2h 15m

### Progress Log
| Time | Event |
|------|-------|
| 14:30 | Started implementing authentication module |
| 14:45 | Created auth middleware with JWT validation |
| 15:20 | Added rate limiting (token bucket algorithm) |
| 16:00 | Fixed edge case in token refresh flow |
| 16:45 | All tests passing, session complete |

### Files Tracker
| File | Action | Notes |
|------|--------|-------|
| src/auth/middleware.ts | Created | JWT validation + role checking |
| src/auth/rate-limiter.ts | Created | Token bucket, 100 req/min default |
| src/auth/tests/auth.test.ts | Created | 12 test cases, all passing |
| src/config.ts | Modified | Added auth config section |

### Decisions Log
| Decision | Rationale |
|----------|-----------|
| Token bucket over sliding window | Simpler, sufficient for our scale |
| JWT in httpOnly cookie | More secure than localStorage |
| 100 req/min default | Industry standard, configurable |

### Resume Prompt
> Last session: Implemented auth middleware with JWT + rate limiting.
> All tests passing. Next: integrate with user routes in src/routes/users.ts.
> Key files: src/auth/middleware.ts, src/auth/rate-limiter.ts

Infrastructure

your-project/
├── .session_log.md          ← Current session (hidden file)
└── ...

your-workspace/
└── session_logs/
    ├── SESSION_INDEX.md      ← All sessions (200 row cap, auto-archive)
    ├── RECENT_WORK.md        ← Last ~20 sessions (~100 lines)
    └── SESSION_INDEX_ARCHIVE.md  ← Overflow archive

Comparison

Feature This Tool Git Log Manual Notes Vector Memory (e.g., Mem0)
Decision tracking ✅ With rationale ⚠️ If you remember
File change tracking ✅ Automatic ✅ After commit ❌ Manual
Progress milestones ✅ Timestamped ⚠️ Manual
Cross-session context ✅ Resume prompt ⚠️ If maintained ✅ Semantic search
Session index ✅ Rolling 200
Zero config ❌ Needs embedding DB
Works offline
Human-readable ✅ Markdown ⚠️ ❌ Vectors
Retroactive

Configuration

This tool requires no API keys, databases, or external services. Everything is stored as plain Markdown files.

To customize:

  • Timezone: Edit the timezone setting in SKILL.md (default: UTC)
  • Index cap: Change the 200-row limit for SESSION_INDEX.md
  • Log paths: Set your preferred session_logs directory path

Use Cases

  • Multi-day projects — Pick up exactly where you left off
  • Team handoffs — Share session logs with collaborators
  • Debugging journal — Track what you tried and what worked
  • Progress reporting — Auto-generated work summaries
  • Audit trail — Record of all AI-assisted changes

Privacy

All data stays local on your machine. No data is sent anywhere. Session logs are plain Markdown files you fully control.

Contributing

Contributions welcome! Open an issue or submit a PR.

License

MIT License — see LICENSE for details.

About

Persistent session memory for AI coding agents. Track files, decisions, and progress across conversations. Zero config, plain Markdown, fully local.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors