Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

See [CONTRIBUTING.md](CONTRIBUTING.md) for build commands, testing, code style, and development workflow.

## Workspace Structure

See [README.md](README.md) for the workspace layout and [ARCH.md](ARCH.md) for some additional remark regarding important parts of LDK's architecture.

## Development Rules

- Always ensure tests pass before committing. To this end, you should run the test suite via `./ci/ci-tests.sh`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is always practical when working on draft branches?

Copy link
Contributor

@vincenzopalazzo vincenzopalazzo Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably it is possible to specify it in a way that we can ask claude to run the CI checks? But do not assume to run it always?

On mine I have

### When to run CI checks
- When explicitly asked (e.g., "run CI", "check CI", "verify commits")
- Before creating a PR (if requested)
- After fixing CI-related issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is always practical when working on draft branches?

Hmm, but ensuring tests pass before committing is kinda important, no? And in my experience it will allow Claude to catch a lot of bugs? Any suggestion for a good replacement, maybe cargo test, which should be considerably faster, even if it doesn't catch everything?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it can be:

Always run tests before committing, unless the commit message contains "WIP" or "draft" (case-insensitive).

Copy link
Contributor Author

@tnull tnull Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it can be:

Always run tests before committing, unless the commit message contains "WIP" or "draft" (case-insensitive).

That seems tailored to your specific workflow. Maybe you want to put that in your .claude.local.md override instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try to override the testing behavior.

It isn't my workflow to prepend the commit titles, but I could adopt that as the workflow potentially.

Let's go with what you have and see how it works out, and adapt if necessary

- Run `cargo +1.75.0 fmt --all` after every code change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think we should make this a hook in a claude settings file. I think that might be more reliable.

"hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "cargo +1.75 fmt"
          }
        ]
      }
    ]
  },

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that seems redundant wit git hooks to me? But feel free to open a follow-up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a pre-commit hook. It is a post file edit hook, so formatting remains consistent continuously.

- Never add new dependencies unless explicitly requested
- Please always disclose the use of any AI tools in commit messages and PR descriptions using a `Co-Authored-By:` line.
- When adding new `.rs` files, please ensure to always add the licensing header as found, e.g., in `lightning/src/lib.rs` and other files.
Loading