Overnight CLI: Train Claude Code on Your Own Chat History to Work While You Sleep

Overnight CLI: Train Claude Code on Your Own Chat History to Work While You Sleep

Overnight is a new open-source CLI that analyzes your Claude Code conversations to build a personal coding profile, then predicts and executes your next steps autonomously.

Ggentic.news Editorial·1d ago·3 min read·1 views
Share:
Source: workovernight.comvia hn_claude_codeSingle Source

What It Does — A Personal AI Coding Supervisor

Overnight is a free, open-source CLI tool that acts as a supervisor layer for Claude Code. Its core innovation is personalization through your chat history. Instead of using generic prompts or agent frameworks, it scrapes your Claude Code conversation history from a project, analyzes your communication style, coding patterns, technical preferences, and current focus, and builds a unique profile of you as a developer. This profile is then used to predict the exact message you would type next to continue the work.

How It Works — Predict, Execute, Observe, Adapt

The tool operates in a tight feedback loop:

  1. Predict: Combines your profile, the current workspace state (files, branches, tests), and the direction of recent work to generate the next message in your voice.
  2. Execute: Runs the predicted message via claude -p with auto-permissions.
  3. Observe: Reads the output, diffs, test status, and build results.
  4. Adapt: Feeds results back into the loop. If tests fail, it tries to fix them. If the build breaks, it course-corrects. It stops when goals are met.

All work is automatically committed to new Git branches (overnight/{run-id}), letting you review and merge—or discard—its progress in the morning.

Setup — Install and Run with Your API Key

Installation is straightforward via the GitHub repo. You must bring your own Anthropic (or OpenAI-compatible) API key.

git clone https://github.com/yail259/overnight
cd overnight
# Follow setup instructions, configure your API key

On first run in a project directory, it scans your local Claude Code history (typically in ~/.claude/projects/) to build your profile.

Four Modes to Match Your Risk Tolerance

You control the ambition level by shifting through four modes:

  • tidy: Zero-risk cleanup only. Dead code removal, formatting, linting.
  • refine: Structural improvements. Focus on design patterns, coupling, test architecture—same features, better code.
  • build: Product engineering. Reads the README, understands the value proposition, and derives the next feature from the business case.
  • radical: "Unhinged product visionary." Makes bold, ambitious bets. The creator notes you might "wake up delighted or terrified."

You can run it in an interactive TUI with $ overnight, kick off a specific task with $ overnight start "finish auth and add tests", and review logs in the morning with $ overnight log.

Why It's Different — It Learns You

The key differentiator from other "code while you sleep" agents is the personal profile. The predictor never sees your raw conversations. It receives three distilled inputs: who you are (the profile), where you're headed (direction), and what exists (workspace). The output aims to be the message you'd have typed, maintaining your unique style and priorities throughout the autonomous execution.

AI Analysis

Claude Code power users should treat Overnight as a force multiplier for repetitive or predictable coding tasks, especially refactoring and test writing. Start in `tidy` or `refine` mode on a well-understood codebase to see how accurately it mimics your style before letting it `build`. The tool's value scales with your Claude Code usage—the more conversations it has to analyze, the better its predictions. This isn't for greenfield projects with undefined architecture. It's for the "second shift" work: taking a day's progress on a feature and autonomously completing the tests, documentation, and cleanup you'd do manually. Integrate it into a nightly CI-like workflow. Before you finish work, ensure your current branch's state and Claude chat context represent a clear direction. Run Overnight in `refine` mode to handle the grunt work. In the morning, review the `overnight/` branch it created. This turns Claude Code from a real-time pair programmer into an asynchronous coding assistant that works on your backlog.
Enjoyed this article?
Share:

Related Articles

More in Products & Launches

View all