Format markdown and YAML files with deno fmt

This commit is contained in:
2025-12-18 19:42:05 +01:00
parent 0638707349
commit 99ad5b9d7f
3 changed files with 34 additions and 19 deletions

View File

@ -1,10 +1,14 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This file provides guidance to Claude Code (claude.ai/code) when working with
code in this repository.
## Project Overview
This is a custom status line binary for Claude Code, written in Go. It replaces shell-based status line scripts with a compiled binary for better performance. The binary reads JSON from stdin (provided by Claude Code) and outputs a formatted status line with ANSI colors.
This is a custom status line binary for Claude Code, written in Go. It replaces
shell-based status line scripts with a compiled binary for better performance.
The binary reads JSON from stdin (provided by Claude Code) and outputs a
formatted status line with ANSI colors.
## Build and Development Commands
@ -35,7 +39,8 @@ task clean # Remove bin/ directory
Single-file Go application (`main.go`) that:
1. **Reads JSON from stdin** - Parses Claude Code's status hook payload (`StatusInput` struct)
1. **Reads JSON from stdin** - Parses Claude Code's status hook payload
(`StatusInput` struct)
2. **Gathers system state**:
- Gitea process status via gopsutil (cross-platform process listing)
- Git repository info via go-git (branch name, dirty state)
@ -43,6 +48,7 @@ Single-file Go application (`main.go`) that:
3. **Outputs formatted status line** with ANSI colors, padding to terminal width
Key functions:
- `formatContextInfo()` - Formats token usage as "Xk/Yk"
- `getGiteaStatus()` - Returns green/red dot based on gitea process running
- `getGitInfo()` - Returns git branch and dirty indicator
@ -50,7 +56,9 @@ Key functions:
## JSON Input Format
The binary expects Claude Code's status hook JSON via stdin. See `test/fixture.json` for the complete structure. Key fields used:
The binary expects Claude Code's status hook JSON via stdin. See
`test/fixture.json` for the complete structure. Key fields used:
- `model.display_name` - Model name to display
- `workspace.current_dir` - Current directory path
- `context_window.context_window_size` - Total context window tokens