Unlike other electric automakers, Tesla has long had a lock on its own battery supplies through an exclusive deal with Panasonic and the companies' jointly owned battery Gigafactory in Nevada.

Now the company is working to develop its own batteries at a skunkworks near its main car factory in Fremont, California, according to multiple reports, including CNBC.

As increasing numbers of established automakers ramp up production of electric cars, supplies of batteries and the materials to make them have grown scarce in recent months, and Tesla has expressed concern about obtaining enough raw battery materials to meet production targets for its electric cars.

CEO Elon Musk has said that battery supplies from Panasonic were a constraint on production of its popular Model 3.

In May, Tesla bought Maxwell Technologies, a San Diego company that builds ultra-capacitors that can fill some of the needs for lithium batteries in electric cars at lower cost by charging and discharging quickly. Some observers also noted they could provide a bridge to solid-state battery technology. Musk has also long said he believes supercapacitors are superior to lithium-ion batteries.

The CNBC report cites multiple current and recent employees who say that Tesla has set up a skunkworks a few blocks from the Fremont factory, to work on the project.

It notes that Musk is trying to move as much of Tesla's operations in house as possible to insulate the company from possible disruptions outside its control, Tesla is also seeking new battery suppliers in China for the cars it plans to build at its new factory there. Musk has said that factory will start production on some Model 3s by the end of this year. 

It's not clear how close Tesla may be to producing its own batteries, but at a Technology Day in May where it revealed its self-driving plans, Musk told investors to watch for two things from Tesla: its self-driving features, and its efforts to lower the cost of batteries for its cars. He said at the time he wasn't willing to "let the cat out of the bag" yet on the second effort.