Altered Craft

Altered Craft

Zero Lines of Python

What happened when I replaced my API with a prompt

Sam Keen's avatar
Sam Keen
Jan 08, 2026
∙ Paid

I wanted help keeping a dev journal.

I use Claude Code for most of my development on research projects now. The side effect: I accomplish more in a week than I can remember. That sounds like a humble brag. It isn’t. It’s a problem. When Friday arrives and I try to reflect on what happened, I’m doing archaeology. Manual journaling doesn’t work for me. By the time I remember to write things down, the context has evaporated.

Here’s what I realized: Claude Code already knows what I did. Every session is logged. Every tool call, every file touched, every todo created. The data exists in ~/.claude/. It’s just not exposed in a way I can use.

So I built an API. About 2,800 lines of Python. Then I tried the same task with just a system prompt and Claude Code’s existing tools. The results were comparable.

This is a story about that discovery, and what it might mean for how we build with AI.


Context: this is a personal productivity experiment. Your workflow will shape how these patterns apply.

Mapping the Data

I started by mapping what’s actually in ~/.claude/. Turns out it’s a treasure trove:

Session transcripts (~/.claude/projects/[project-id]/*.jsonl): every conversation, preserved with timestamps, tool calls, and reasoning.

File history (~/.claude/file-history/[session-uuid]/): versioned backups of everything Claude touched (used for rollbacks).

Todos (~/.claude/todos/): task lists from each session with completion states.

Stats (~/.claude/stats-cache.json): aggregated metrics like message counts, session durations, and model usage.

Each session has a UUID that correlates across all these directories. Cross-reference by UUID, and you can reconstruct exactly what happened.

I documented my current understanding in detail, covering file formats, message types, and correlation patterns: Gist link

This research phase turned out to be the most valuable part of the entire project. But I didn’t know that yet.


Building the Abstraction

With the data structures mapped, I did what developers do: I built an abstraction layer.

A FastAPI server that reads from ~/.claude/, applies the research domain logic, and exposes REST endpoints:

  • GET /activity/summary: activity across date ranges

  • GET /projects/{id}/sessions: sessions for a project

  • GET /sessions/{id}/messages: full conversation

  • GET /sessions/{id}/todos: correlated task lists

Then I built a Claude Code Skill: a system prompt that knew how to call this API via a Python proxy script. The proxy was necessary because Claude Code’s sandbox restricts network access. [Skill system prompt gist →]

Skill with prompt instructions to use the custom built API
User's avatar

Continue reading this post for free, courtesy of Sam Keen.

Or purchase a paid subscription.
© 2026 Sam Keen · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture