articledjh

thoughts


Claude Code Questionnaires

One thing I’ve noticed about Claude Code is it will sometimes ask you questions, especially at the start of new projects, some clarifying things it wants to know so it can feed into the plan input, for example if you was creating a frontend project it might ask you what framework(s) you want to use.

I thought that was a neat feature but didn’t realise you can get the assistant to do this for your own stuff just by specifying it in prompts.

This came apparent to me when I was looking at automating adding new self-hosted services to my server. I have a bunch of configuration files for my homelab (nixos) and adding a new service requires a modifying a few things like reverse proxy configuration, docker-compose and some other minor bits. I wanted to automate these steps with Claude Code but there’s obviously a bunch of context it needs, but just by adding this to my CLAUDE.md

When deploying a new self-hosted service, ask the user:

1. What domain the service should be accessible at (e.g., `foo.bar.com`)
2. Which server it should be hosted on (typically `myserver`)
3. What port the service listens on inside its container (the conta
iner port)
4. What dashboard section to add it to (Apps, Home, Finance, Media,
 or Infrastructure)
5. Does the container need any volumes for persistent data (e.g., `
/opt/data/servicename:/data`)
6. The docker image name (e.g. `foo:latest`)

and saying in my prompt that I wanted to deploy my service to the server - it popped up the same lil’ survey interface with the questions I want the assistant to ask.

That’s pretty cool, I can see myself using this pattern quite a lot when automating some workflows.