Readit News logoReadit News
ksri commented on How and where will agents ship software?   instantdb.com/essays/agen... · Posted by u/stopachka
stopachka · 2 months ago
> as well as prompts if you're comfortable?

This made me wonder: can I share Claude Code's conversation history? Turns Claude stores them.

So I made a full-stack "snippet" app with Claude and Instant. You can:

1. Upload jsonl files 2. Share them in a nice UI

(Going meta) here's the first conversation I had with Claude in order to build it:

https://claude-code-viewer.vercel.app/view/c4ca91ac-9624-40f...

After I deployed, I asked it to fix the tool use UI:

https://claude-code-viewer.vercel.app/view/faf9b2cc-c3cf-4d0...

I used Instant's auth to gate uploads. Views are public, but limited only to the snippets you know (i.e have links for).

If you want to upload your own conversations:

1. They live in ~/.claude. Head on over and grab a file 2. Go to https://claude-code-viewer.vercel.app and sign up 3. Start uploading : )

Some notes:

* Be careful when sharing log files. Claude can include secrets in there. Some hackers may notice an adminToken in the convo. I rotated it before we pushed.

* It was fun to see Claude use the query language. It thought we had a `$startsWith` modifier. Right now we only have $like. But `$startsWith` is a great idea, we may just implement it real quick!

ksri · a month ago
Claude code now has an /export command for this use case. You can run it from within a session.
ksri commented on Writing Code Was Never the Bottleneck   ordep.dev/posts/writing-c... · Posted by u/phire
andrelaszlo · 2 months ago
My most recent example of this is mentoring young, ambitious, but inexperienced interns.

Not only did they produce about the same amount of code in a day that they used to produce in a week (or two), several other things made my work harder than before:

- During review, they hadn't thought as deeply about their code so my comments seemed to often go over their heads. Instead of a discussion I'd get something like "good catch, I'll fix that" (also reminiscent of an LLM).

- The time spent on trivial issues went down a lot, almost zero, the remaining issues were much more subtle and time-consuming to find and describe.

- Many bugs were of a new kind (to me), the code would look like it does the right thing but actually not work at all, or just be much more broken than code with that level of "polish" would normally be. This breakdown of pattern-matching compared to "organic" code made the overhead much higher. Spending decades reviewing code and answering Stack Overflow questions often makes it possible to pinpoint not just a bug but how the author got there in the first place and how to help them avoid similar things in the future.

- A simple, but bad (inefficient, wrong, illegal, ugly, ...) solution is a nice thing to discuss, but the LLM-assisted junior dev often cooks up something much more complex, which can be bad in many ways at once. The culture of slowly growing a PR from a little bit broken, thinking about design and other considerations, until its high quality and ready for a final review doesn't work the same way.

- Instead of fixing the things in the original PR, I'd often get a completely different approach as the response to my first review. Again, often broken in new and subtle ways.

This lead to a kind of effort inversion, where senior devs spent much more time on these PRs than the junior authors themselves. The junior dev would feel (I assume) much more productive and competent, but the response to their work would eventually lack most of the usual enthusiasm or encouragement from senior devs.

How do people work with these issues? One thing that worked well for me initially was to always require a lot of (passing) tests but eventually these tests would suffer from many of the same problems

ksri · 2 months ago
Struggling with the same issues with junior developers. I've been asking for an implementation plan and iterating on it. Typical workflow is to commit the implementation plan and review it as part of a pr. It takes 2-3 iterations to get right. Then the developer asks claude code to implement the based on the markdown. I've seen good results with this.

Another thing I do is ask for the claude session log file. The inputs and thought they provided to claude give me a lot more insight than the output of claude. Quite often I am able to correct the thought process when I know how they are thinking. I've found junior developers treat claude like a sms - small ambiguous messages with very little context, hoping it would perform magic. By reviewing the claude session file, I try to fix this superficial prompting behaviour.

And third, I've realized claude works best of the code itself is structured well and has tests, tools to debug and documentation. So I spend more time on tooling so that claude can use these tools to investigate issues, write tests and iterate faster.

Still a far way to go, but this seems promising right now.

ksri commented on SmolLM2   simonwillison.net/2024/No... · Posted by u/edward
ksri · 10 months ago
Is there a way to run this in the browser as yet? Transformers js doesn't seem to support this. Is there another way to run this in the browser?
ksri commented on Simple SQL in Python   github.com/nackjicholson/... · Posted by u/polyrand
krick · 5 years ago
Looks kinda nice, but can it handle "IN (...)" statements correctly? Or conditionally adding some WHERE param? If not, this is rather simplistic and couldn't replace writing inline queries, and then I think I'd rather not mix together 2 approaches.
ksri · 5 years ago
Take a look at JinjaSQL (https://github.com/hashedin/jinjasql). Supports conditional where clauses as well as in statements. It uses Jinja templates, so you get a complete template language to create the queries.
ksri commented on A REST View of GraphQL   hasura.io/blog/rest-view-... · Posted by u/wawhal
gautambt · 5 years ago
This looks really cool! Particularly for the embedded analytics use case.

Do you have an example of how this would work on the front end with relationships. For example if I want to fetch posts and their comments how would the front code look like?

ksri · 5 years ago
Yes, following relationships is a key feature of Squealy. Here is an example for a recent-questions API - https://github.com/hashedin/squealy/blob/master/squealy-app/....

In short, with 1 GET API call that uses 3 SQL queries, you are getting a list of questions, related answers and related comments.

You should parse that example as follows - 1. The first SQL query fetches all the questions, filtered by API parameters 2. The second SQL query fetches all comments for the questions selected in the first query. See the `WHERE c.postid in {{ questions.id | inclause }}` part - questions.id is coming from the output of the first query 3. The output of the first and second query is merged together on the basis of the questionid that is present in both the query output. 4. Similar approach is used for all the answers

ksri commented on A REST View of GraphQL   hasura.io/blog/rest-view-... · Posted by u/wawhal
ksri · 5 years ago
I have been working on an idea to leverage SQL + REST APIs instead of GraphQL to solve the similar problems, and I would love to get some feedback on it.

GraphQL is great during development, but in production you often use "persisted queries" to prevent abuse. Persisted queries are also a way to use HTTP GET instead of POST, and thereby leverage HTTP caching. As such, if you swap out graphql and use sql during the development phase, you perhaps can get similar benefits.

My solution (https://github.com/hashedin/squealy) uses SQL queries to generate the API response. Squealy uses a template language for the sql queries, so you can directly embed where clause from the API parameters. The library internally binds the parameters, and is free from SQL injection.

Handling many-to-many relation, or many one-to-many relations is done in-memory after fetching data from the relational database. This provides the same flexibility as GraphQL, but of course requires you to know SQL.

Here is an example that builds various StackOverflow APIs using just a YAML+SQL based DSL - https://github.com/hashedin/squealy/blob/master/squealy-app/...

Squealy is still work in progress, so don't use it in production. But I would love to get some feedback!

ksri commented on Modularizing SQL? (2007)   lambda-the-ultimate.org/n... · Posted by u/Kinrany
ksri · 5 years ago
I have been working JinjaSQL[1] for a while to simplify complex SQL Queries.

JinjaSQL is a templating language, so you can use interpolation, conditionals, macros, includes and so on. It automatically identifies bind parameters, so you don't have you to keep track of them.

1. https://github.com /hashedin/jinjasql

u/ksri

KarmaCake day383September 3, 2011View Original