Only write notes file when actually needed