Sharing Claude Code Sessions

I've been using Claude Code (CC) quite extensively in recent weeks, and apart from a few fails it's been a blast. I want to write about a few of the things I got it to do successfully, but in order to do that I need to be able to share the session logs.

Unfortunately, there is no straight-forward way to do this. The logs are saved as .jsonl files in $HOME/.claude/projects/-path-to-your-work-directory/ and when using the online version of CC, all one to do is use the Open in CLI button and continue locally, then the .jsonl with the whole session will show up in the project folder.

These file are a bit unweildy. For example, they contain the whole content of files that CC reads and a buch of distracting metadata. I tried Simon Willison's claude_to_markdown.py but that was not quite what I wanted, which is a static HTML file with embedded JavaScript (JS) to hide the long reads and outputs by default, but make them expandable if needed.

What better way to achieve this than just let CC do it? Very meta, I know. So I donwloaded the JS from https://claude.ai/code/ (after all, they have solved the same task there already) and put it into a fresh repo with an example session log. This is the outline I wrote and added to the repo:

# main goal
a script, python or other, that takes session logs from Claude Code (CC)
and converts them into HTML.

## example data
- a06171f9-5f33-4258-84e1-4dc70e84c6dd.jsonl an example session log. all
  input files will have this format.
- Screenshot, two example screenshots of how it looks on CC web.
- CCweb_example.html and CCweb_example_files/ , the saved web page of CC
  that should contain useful routines to render the session. Ignore the 
  left half of the page and session management, only the session part 
  itself is needed.

## requirements
- the output should be a single html-file, named like the input but ending
  .jsonl exchanged to .html
- all javascript should be inlined.
- the script does not need to be self-contained, can e.g. read js files or
  templates to make the output.
- the html should look similar to the screenshots, i.e. compact with 
  unnecessary information skipped, file reads hiden, and long diffs
  shortened but expandable.

Then all that was let do do was to point CC to the repository and tell it to get crackin'.

This is how it went.

I wasn't a perfect one-shot success, as you can see. But with just a little prodding CC figured it out. I then continued in a new short session to have it sum up the elapsed working time and put that on top of the HTML. Not bad at all, I would say. Feel free to check it out on gitHub.

Tagged ,

Sawmill

sawmill

Old meets new, the tractor and wire crane from the 80s put a log onto the brand-new sawmill.

Tagged ,

Ai Bubbling

Quoting Patrick Boyle:

For AI users, this frenzy is a gift. Competition has meant that the models improve rapidly and their prices stay low. There is no reason not to use these products while they are free or almost free.

I fully agree and get lots of value from my 20$ Claude subscription, mostly via ClaudeCode. More on that later, but I am happy to take investors' money by buying a product that is sold under break-even price. May it last as long as possible. But to continue the quote:

For AI investors, the economics are unforgiving. Better chips make models faster—and make yesterday’s chips worthless. Every leap forward accelerates depreciation on the collateral lenders are asked to finance. That is why banks refuse to lend, they prefer assets that last longer than a news cycle.

Tagged ,

Ukraine Analysis

If you are even remotely interested in the war on Ukraine, and don't know about Danish analyst Anders Puck Nielsen yet, make sure to check out his Youtube channel where he does an excellent job of explaining context and presenting his view on things. No fluff videos that will leave you more informed that following the news.

Start with the latest video on the current situation with the "peace plan".

Tagged ,

Bestbo Gård

Oh my! This site has been somewhat neglected, hasn't it? More than a year since the last post. The house and woodshed in that picture not even ours any more! We bought a farm outside of Östhammar this spring, and spent an awful lot of time moving and getting settled.

Taking over such a large place is no easy task, but I now get to do fun things like driving my tractor into my forest to get timber and firewood. bestbo-gard

The farm has its website at https://www.bestbo.se and there you find the social media links, and some occasional updates.

Tagged , ,

Woodshed

woodshed

The aforementioned freshly-built woodshed. Apart from the three old pallets that serve as floor, this is made completely from lumber that I made myself, from trees that needed to be taken down because of bark bettles.

Not sure yet, if it will get plainted in the same Falu red as the house, or allowed to grey on its own.

Tagged , ,

Back

You probably have not noticed, but this site was offline for twelve days. And so was I.

This is because the glass fiber link that leads to our home in the forest was broken in connection with some work further down the road. Then the usual fuckups of privatized and distributed responsibilities ensued. Meaning that I had to lean hard on our network provider (ISP) to finally refer the issue to the network operator after 5 days. And then another week to get the technician to diagnose, and talk to the other company that caused the fault.

This is the kind of thing that would have easily annoyed the hell out of younger me - things not working as they should! The world is mean to me!!

This time, though, I was quite fine with it. I am on holidays anyway and can in fact build a new shed for firewood without internet access (pics will follow!). The notifications for emails had been turned off anyway and for urgent stuff we still had the 4G of our phones - so there really only remained the inconvenience that we imagined ourselves.

Still, it's good to be back online.

Tagged ,

Lighter Reading

A few weeks ago, I bought and started reading The World of the Crusades by Christopher Tyerman. I don't even remember where I saw the book recommended or what made it sound like a good idea, but I admit that the crusades have always been a bit of a gap in my overall layman's picture of history. What were they, actually, how important, and most of all why

This book is a bit dense though. While well made, written and illustrated, I rarely make it more than ten pages per night, before I fall asleep. The author has a tendency toward unnecessarily high-brow language but I think it is more the choice of which details to highlight, and the lack of connection between them, that makes it feel tedious to me.

Thus, I will put it aside for a while and dive into some lighter summer reading: The Culture series by Iain M. Banks, which I have heard many good things about over the years but never read.

Tagged , ,

Felled

felled

I spent the morning felling another four trees that were taken over by bark beetles. In order to prevent the larvae from developping into bugs and then spreading to neighbouring trees, one has to remove all the bark from the tree. This quite tedious but it helps to have a really sharp knife that is designed for that purpose.

Tagged ,