惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
量子位
V
V2EX
S
SegmentFault 最新的问题
月光博客
月光博客
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
博客园_首页
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
Y
Y Combinator Blog
The Cloudflare Blog
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
B
Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
Small tools, shared with agents: a CloudWatch Insights ex...
simonkagedal · 2026-05-01 · via Hacker News: Show HN

I've always enjoyed making small tools for myself to improve daily life as a software developer. Most of the time they are CLI tools, since the command line is where I live most of my life.

With the advent of agentic coding, this tendency of mine has multiplied. I'm writing more tools now. Agents are really good at writing small, self-contained tools, and you can kick one off from the Claude app on the phone as you sit on the loo. That's nice.

But it has also multiplied in another way, because agents love to use CLI tools as much as I do. So I don't just build them for my own direct use; I also use them indirectly, through Claude Code (mostly). Some people would advocate the use of MCP for that type of integration. I don't see much reason for that1 when the agent can just invoke the same tools I use myself. Same artifacts, same interface, easier to follow what it's doing.

The cloudwatch-insights tool

One recent addition to my belt is a tool for fetching logs from CloudWatch Insights. There are existing tools for this2, but I want one that fits my workflows.

The foundation of the tool is to execute queries against CloudWatch Insights and store the results locally as JSONL. Queries are templated, with variables filled in from the working directory's context. A typical workflow: I get an alarm in some service, want to investigate error logs, and want to relate them back to the code. So I cd into that service's repo and run the tool from there. The repo carries per-service configuration – which log groups, which app filter – and the tool picks it up automatically.

cd ~/code/some-service
cloudwatch-insights query --new --env prod

This creates a query file from a template, fills it in with values from the command line and from repo-level settings, and opens it in my $EDITOR. It can look like this:

time = "1h"
env = "prod"
app = "some-service-app"
log-group = "/logs/{{ env }}/services"
---
fields @timestamp, @message
| sort @timestamp desc
| filter app = '{{ app }}'
| filter level in ['ERROR']
| limit 200

If you have used Cloudwatch Insights before, you might recognize the second part here as a query in what they call the Logs Insights QL language. The section before that – the "front-matter" – contains various settings on how the query is run, and certain variables that will be replaced in the query.

  • time is the time range to run the query against, in a human-friendly format.
  • env and app are two pre-defined variables that can be used in the query, or in other variables (as we see here with log-group).
  • log-group is the log group – or, if you pass a TOML array, several log groups – to run the query against.

After you have tweaked as needed, you save and exit the editor, and the tool runs the query. The tool will say something like this:

AWS region:  eu-north-1
Log groups:  /logs/prod/services
Time range:  1h
Status:      Complete (scanned 5.7k records, 26.5 KiB, 200 rows)

Use cloudwatch-insights show to view results. (Open in AWS)

The results are written as a JSONL file under ~/.skagedal-tools/. All query results are saved, with a latest-run.jsonl that always symlinks to the most recent run (that's the one that shows with the cloudwatch-insights show command). From there I can just hand things to claude – I'm already in the right codebase:

$ claude -p 'Run "cloudwatch-insights show" and fix the errors.'

Of course, I can also do any other usual JSON processing on the results (jq and fx3 and friends).

Obviously, this is nowhere near replacing the full Cloudwatch Insights console. I do intend for it to replace some of the use cases, but not all. Going back and forth from this tool to the console is therefore something I want to support as a first-class use case, and for that I have the copy-link and paste-link subcommands: copy-link it transforms the current query into one of those gnarly Cloudwatch Insight URLs (if you know you know) and puts it on the pasteboard4. And then paste-link is the reverse – copy a Cloudwatch Insights URL and put it into the current query file.

You may have noticed the (Open in AWS) output from cloudwatch-insights query above, which is a shortcut to the copy-link --open functionality. That's a hyperlink, directly clickable in the terminal using the OSC 8 protocol. I didn't know this existed until I saw Claude Code and friends use it.

Implementation notes and future plans

  • When I build these integrations, I often wrap an existing CLI to avoid reimplementing auth – gh for GitHub, for example. AWS is one exception: the SDK is good enough, and the profile-based auth standardized enough, that calling it directly is preferable. I first wrote this thing in Typescript, even though many of my similar CLI tools are written in Rust, because I forgot that there's also an AWS SDK for Rust now. Then as I got annoyed with the startup time and various other Node ecosystem stuff and asked Claude to rewrite it in Rust. Much happier.
  • The tool has this statefulness idea around a "current query", although it also supports running arbitrary query files. I do want to better support having multiple ongoing queries. And also a flexible way of having a library of templates.
  • There are various UX warts that I want to smoothen out.
  • The tool will not be a log viewer. That's not its purpose. I am working on a separate log viewing tool that's independent of Cloudwatch Insights.

The cloudwatch-insights tool is available here, along my other tools. All are developed under the assumption that I'm the only user, so anything might break at any time – let me know if anything looks interesting to you.

Footnotes

  1. This isn't just my take about MCP (Model Context Protocol), see for example this blog post. The pi.dev tool also seems to be going in the direction.

  2. Most obviously, the aws cli itself. A few others worth mentioning: saw and cw, both Go CLIs focused on tailing and searching log groups, and awslogs, a long-standing Python tool in the same space. I think all of these are more oriented toward log streaming than Insights queries, though. For log streaming, I tend to use Kubernetes.

  3. If you're not friends with fx, I mentioned it in this blog post.

  4. Or use --raw if you just want it output to the terminal, or use --open to open it in default browser.