claude-story
v1.4.2
Published
Automatic conversation history manager for Claude Code. Auto-saves all Claude conversations to markdown files with SQLite database tracking, just like SpecStory for Cursor.
Downloads
96
Maintainers
Readme
Claude Story
Automatic conversation history manager for Claude Code. Auto-saves all Claude conversations to markdown files with SQLite database tracking, just like SpecStory for Cursor.
🚀 Quick Start
# Install globally from npm
npm install -g claude-story
# Start monitoring (run once)
claude-story start
# Check status
claude-story statusThat's it! Claude Story will now automatically save all your Claude Code conversations to .claude-story/ directories in each project.
🧪 Want to verify security? Run
npm testafter cloning to see all 32 security tests pass!
✨ Features
- 🤖 Automatic Monitoring - Detects all Claude Code conversations without manual setup
- 📁 Project Auto-Detection - Creates
.claude-story/directories in each project automatically - 💾 SQLite Database - Stores conversation metadata with unique IDs and timestamps
- 📄 Markdown Export - Auto-exports conversations to readable markdown files
- 🔍 Cross-Project Search - Compatible with MCP servers for enhanced search capabilities
- ⚡ Real-time Sync - Conversations saved as you chat with Claude
- 🙈 Git Integration - Automatically adds
.claude-story/to .gitignore when created
🎯 How It Works
Claude Story monitors the ~/.claude/projects/ directory where Claude Code stores conversation data. When you use Claude Code in any project, it automatically:
- Detects the conversation in real-time
- Creates a
.claude-story/directory in your project - Saves the conversation to a SQLite database
- Exports to markdown files in
history/folder
📂 File Structure
After installation, your projects will have:
your-project/
├── .claude-story/
│ ├── conversations.db # SQLite database
│ ├── history/ # Markdown exports
│ │ ├── 2025-01-15T10-30-45Z-building-new-feature.md
│ │ └── 2025-01-15T14-22-10Z-debugging-issue.md
│ └── .what-is-this.md # Documentation🛠 Commands
# Start monitoring (runs continuously)
claude-story start
# or
cs start
# Check detection status
claude-story status
# or
cs status
# Stop monitoring
claude-story stop
# or
cs stop
# Show help
claude-story help
# or
cs help📦 Installation
Claude Story is available as an npm package:
npm install -g claude-story🔧 Requirements
- Node.js >= 16.0.0
- Claude Code installed and used at least once
- macOS/Linux (Windows support coming soon)
🆚 Claude Story vs SpecStory
| Feature | SpecStory (Cursor) | Claude Story (Claude Code) |
|---------|-------------------|---------------------------|
| Auto-detection | ✅ | ✅ |
| SQLite database | ✅ | ✅ |
| Markdown export | ✅ | ✅ |
| Project directories | .specstory/ | .claude-story/ |
| Setup required | None | claude-story start |
🔍 MCP Server Integration
Claude Story outputs standard markdown files that can be indexed by any MCP (Model Context Protocol) server for enhanced search and retrieval across projects. The organized file structure makes it easy to integrate with existing workflow tools.
🚨 Security & Privacy
Claude Story has been thoroughly security-tested and hardened:
🔒 Security Features
- Local only - All data stays on your machine
- No network requests - Works completely offline
- Path validation - Prevents directory traversal and symlink escape attacks
- Content sanitization - Automatically redacts API keys, tokens, and passwords
- Rate limiting - Protects against resource exhaustion attacks
- JSON size limits - Prevents DoS via oversized payloads
- SQL injection protection - Uses parameterized queries exclusively
🧪 Security Testing
- 48 comprehensive unit tests covering all security functions
- Memory exhaustion testing with large file inputs
- Symbolic link escape testing for directory traversal prevention
- TOCTOU race condition testing for file system attacks
- Property-based testing with thousands of random inputs
- Performance stress testing under adversarial conditions
🛡️ Vulnerability Mitigations
- ✅ Directory Traversal: Blocked via path validation and symlink resolution
- ✅ Symlink Attacks: Prevented using
fs.realpathSync()resolution - ✅ TOCTOU Races: Mitigated through parent directory validation
- ✅ Content Exposure: Sensitive data automatically sanitized
- ✅ Resource Exhaustion: Rate limiting and size constraints applied
- ✅ Code Injection: No dynamic code execution or shell commands
Run npm test to verify all security tests pass.
📝 License
MIT © ryanriggin & claude code
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Install dependencies:
npm install - Run tests:
npm test - Run tests with coverage:
npm run test:coverage - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🧪 Testing
Claude Story includes a comprehensive test suite covering security, database operations, and configuration management.
Test Coverage:
- 24 passing tests across 3 test suites
- 34% overall coverage with focused testing on critical security functions
- 85% database coverage - core functionality thoroughly tested
- 81% config coverage - configuration management validated
Test Categories:
- Security Tests: Path validation, content sanitization, rate limiting
- Database Tests: Conversation lifecycle, exports, message handling
- Config Tests: Configuration management and persistence
Development Scripts
npm test # Run all security tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm start # Start the daemon
npm run status # Check daemon status🐛 Issues
Found a bug? Report it here
Made with ❤️ for the Claude Code community
