Silicon Valley has a women problem -- make that another women problem.

The lack of women in the tech industry, both in the trenches and at the top, has been well reported. And there are far too many examples of harassment, sexual and otherwise, directed at the few women in the industry. More recently, my former colleague Mike Cassidy extensively documented the troubling fact that there are few female college students preparing to work in the tech industry by getting computer science degrees.

A portrait of Sophia Westwood, a Stanford University graduate student majoring in computer science, on Feb. 12, 2014 at Stanford University’s Gates
A portrait of Sophia Westwood, a Stanford University graduate student majoring in computer science, on Feb. 12, 2014 at Stanford University's Gates Computer Science Building. The photo was made with multiple exposures with computer code she wrote last year. (Dai Sugano/Bay Area News Group) (Dai Sugano)

But what has been often overlooked is the equally troubling issue of what happens when qualified women actually land a job in tech: Many don't stick around. In fact, women leave tech companies at twice the rate of men, according to the Center for Talent Innovation. They report being frustrated about their lack of advancement, the long hours and the lack of flexibility. But many who bail say they do so because they didn't like the company's culture, their boss or their co-workers.

"There's been excusing of the lack of women in Silicon Valley as a pipeline issue," said Kelly Dermody, chair of employment practices at Lieff Cabraser Heimann & Bernstein law firm. "That's such an invalid excuse. The issue is the companies are suffering from gender blindness. They are not inclusive."

Some tech companies are working to reverse this trend, but many are ignoring it, legal and workplace experts say.

And even those making a special effort to reach out to women can still have problems.

Take GitHub, the San Francisco-based code-sharing and publishing service, which suspended a co-founder and another employee after a female engineer publicly accused the firm of not taking seriously her complaints of harassment and a hostile work environment. Julie Ann Horvath was one of GitHub's few female hires -- and she even launched a speaker series at the company to promote women in technology.

But then she quit, claiming she was ignored by management when she brought up her complaints. She tweeted advice to women: "Don't stand for aggressive behavior that's disguised as 'professional feedback' and demand that harassment isn't tolerated."

While people at the company said they wanted to hire more women, they didn't follow through in making women feel more welcome in the workplace, Horvath said in an interview posted on her website before she left GitHub. "I would hear 'We should hire more women!' on almost a daily basis from the same people who kind of refused to respect me as a peer."

In a blog post, Chris Wanstrath, the company's chief executive, apologized and said that GitHub hired a new human resources manager. "We still have work to do," he wrote. "We know that. However, making sure GitHub employees are getting the right feedback and have a safe way to voice their concerns is a primary focus of the company." GitHub and Horvath did not respond to requests for comment.

Silicon Valley is not alone facing these issues, but tech has specific characteristics that can exacerbate the dynamic. The fast pace of projects and deadlines means that creating a welcoming work culture can fall to the wayside. Add to that a general belief that structure, hierarchy and rules are bad for innovation.

"There is a sense in tech that 'We can do what we want and get away with it,' " said David Lowe, whose firm Rudy, Exelrod, Zieff & Lowe represents Ellen Pao, who is suing her former employer, venture capital firm Kleiner Perkins, for sexual harassment, discrimination and retaliation. The youth culture in tech world, which includes socializing with colleagues and often alcohol, can make the situation a powder keg. "It's almost a return of 'Mad Men,' " he said, referring to the TV series about hard-drinking advertising executives and workplaces rife with harassment and affairs.

Workplace biases can also be unconscious and subtle, and female employees often struggle to pinpoint their sense of discomfort.

Telle Whitney, a computer scientist and now president and chief executive of the Anita Borg Institute, recalled one job she had for a startup that was bought by another company. The new company had no women in leadership roles.

"I stayed for about nine months. It was not a particularly comfortable place where I felt like I could grow. ... My experience of leaving bosses was never about sexual harassment but it was more that I didn't like working for them. They didn't appreciate what I did and what I could contribute."

Some companies have been working to break through the gender divide. Recently, 24 firms, including Google, Yahoo and eBay, submitted their internal data to the Anita Borg Institute for an assessment of how well they were doing recruiting, retaining and advancing female technologists.

For the most part, companies know what they have to do. Promoting women within the organization appears to be effective in changing the corporate culture to be more inclusive of women.

But simple things matter too, like checking in with women about how they are doing, and not just listening to their concerns but making changes based on their observations.

Even leaders at a fast-paced startup without an HR specialist can do that.

Contact Michelle Quinn at 510-394-4196 and mquinn@mercurynews.com. Follow her at Twitter.com/michellequinn.