Skip to main content

Track Claude CLI Cost

A quick guide on how to track session cost with a Claude hook. This will both keep a running cost counter below your Claude CLI and persist session costs to ~/.claude/cost/.

Quick GitHub PR Creation

Add the following to your ~/.bashrc or ~/.zshrc:

alias ghpr='git push && gh pr create --fill'

Now just run ghpr after you've committed, and now you have a PR!

Disable npm install scripts

(for security purposes)

  • Globally:
    • run npm config set ignore-scripts true
    • this will populate ~/.npmrc
  • Per repo:
    • create ./.npmrc
    • add ignore-scripts=true into that file

A New SSH Key

To create and authorize a new SSH:

  1. Run ssh-keygen -t ed25519 on the client machine.
  2. Enter an absolute path to your .ssh folder and the name of the id (id_*).
  3. Enter a new passphrase twice.
  4. Upload the *.pub file to whatever service the SSH key is for, or add it to ~/.ssh/authorized_keys on the host machine.
  5. Add the following to the client machine's ~/.ssh/config file (for macOS at least). Be sure to fill in the <fill-me> parts
    Host <choose-a-name>
    HostName <ip-or-domain-here>
    User <username>
    AddKeysToAgent yes
    UseKeychain yes
    IdentitiesOnly yes
    IdentityFile ~/.ssh/<your-non-pub-id-file-name>
  6. Connect with ssh choose-a-name (use the name you entered next to Host in the config file).